Przeglądaj źródła

ExtUI homing / leveling additions

Scott Lahteine 3 lat temu
rodzic
commit
889695b6ba

+ 8
- 0
Marlin/src/MarlinCore.cpp Wyświetl plik

@@ -77,6 +77,10 @@
77 77
   #include "lcd/dwin/e3v2/rotary_encoder.h"
78 78
 #endif
79 79
 
80
+#if ENABLED(EXTENSIBLE_UI)
81
+  #include "lcd/extui/ui_api.h"
82
+#endif
83
+
80 84
 #if HAS_ETHERNET
81 85
   #include "feature/ethernet.h"
82 86
 #endif
@@ -360,6 +364,8 @@ void enable_all_steppers() {
360 364
   ENABLE_AXIS_Y();
361 365
   ENABLE_AXIS_Z();
362 366
   enable_e_steppers();
367
+
368
+  TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled());
363 369
 }
364 370
 
365 371
 void disable_e_steppers() {
@@ -379,6 +385,8 @@ void disable_all_steppers() {
379 385
   DISABLE_AXIS_Y();
380 386
   DISABLE_AXIS_Z();
381 387
   disable_e_steppers();
388
+
389
+  TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled());
382 390
 }
383 391
 
384 392
 #if ENABLED(G29_RETRY_AND_RECOVER)

+ 2
- 0
Marlin/src/gcode/bedlevel/abl/G29.cpp Wyświetl plik

@@ -177,6 +177,8 @@ G29_TYPE GcodeSuite::G29() {
177 177
     if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false);
178 178
   #endif
179 179
 
180
+  TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart());
181
+
180 182
   const bool seenA = TERN0(PROBE_MANUALLY, parser.seen('A')),
181 183
          no_action = seenA || seenQ,
182 184
               faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action;

+ 8
- 0
Marlin/src/gcode/calibrate/G28.cpp Wyświetl plik

@@ -50,6 +50,10 @@
50 50
   #include "../../lcd/dwin/e3v2/dwin.h"
51 51
 #endif
52 52
 
53
+#if ENABLED(EXTENSIBLE_UI)
54
+  #include "../../lcd/extui/ui_api.h"
55
+#endif
56
+
53 57
 #if HAS_L64XX                         // set L6470 absolute position registers to counts
54 58
   #include "../../libs/L64XX/L64XX_Marlin.h"
55 59
 #endif
@@ -209,6 +213,8 @@ void GcodeSuite::G28() {
209 213
 
210 214
   TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
211 215
 
216
+  TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
217
+
212 218
   #if ENABLED(DUAL_X_CARRIAGE)
213 219
     bool IDEX_saved_duplication_state = extruder_duplication_enabled;
214 220
     DualXMode IDEX_saved_mode = dual_x_carriage_mode;
@@ -462,6 +468,8 @@ void GcodeSuite::G28() {
462 468
 
463 469
   TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
464 470
 
471
+  TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());
472
+
465 473
   report_current_position();
466 474
 
467 475
   if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS)))

+ 2
- 0
Marlin/src/gcode/sd/M1001.cpp Wyświetl plik

@@ -96,6 +96,8 @@ void GcodeSuite::M1001() {
96 96
     queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND));
97 97
   #endif
98 98
 
99
+  TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished());
100
+
99 101
   // Re-select the last printed file in the UI
100 102
   TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
101 103
 }

+ 9
- 0
Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp Wyświetl plik

@@ -62,6 +62,10 @@ namespace ExtUI {
62 62
   void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg);     }
63 63
   void onStatusChanged(const char * const msg)       { Chiron.StatusChange(msg);            }
64 64
 
65
+  void onHomingStart() {}
66
+  void onHomingComplete() {}
67
+  void onPrintFinished() {}
68
+
65 69
   void onFactoryReset() {}
66 70
 
67 71
   void onStoreSettings(char *buff) {
@@ -95,6 +99,8 @@ namespace ExtUI {
95 99
   }
96 100
 
97 101
   #if HAS_MESH
102
+    void onMeshLevelingStart() {}
103
+
98 104
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
99 105
       // Called when any mesh points are updated
100 106
       //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
@@ -116,6 +122,9 @@ namespace ExtUI {
116 122
       // Called for temperature PID tuning result
117 123
     }
118 124
   #endif
125
+
126
+  void onSteppersDisabled() {}
127
+  void onSteppersEnabled()  {}
119 128
 }
120 129
 
121 130
 #endif // ANYCUBIC_LCD_CHIRON

+ 16
- 3
Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp Wyświetl plik

@@ -52,6 +52,11 @@ namespace ExtUI {
52 52
   void onFilamentRunout(const extruder_t extruder)   { AnycubicTFT.OnFilamentRunout(); }
53 53
   void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); }
54 54
   void onStatusChanged(const char * const msg) {}
55
+
56
+  void onHomingStart() {}
57
+  void onHomingComplete() {}
58
+  void onPrintFinished() {}
59
+
55 60
   void onFactoryReset() {}
56 61
 
57 62
   void onStoreSettings(char *buff) {
@@ -84,9 +89,14 @@ namespace ExtUI {
84 89
     // whether successful or not.
85 90
   }
86 91
 
87
-  void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
88
-    // Called when any mesh points are updated
89
-  }
92
+  #if HAS_MESH
93
+
94
+    void onMeshLevelingStart() {}
95
+
96
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
97
+      // Called when any mesh points are updated
98
+    }
99
+  #endif
90 100
 
91 101
   #if ENABLED(POWER_LOSS_RECOVERY)
92 102
     void onPowerLossResume() {
@@ -99,6 +109,9 @@ namespace ExtUI {
99 109
       // Called for temperature PID tuning result
100 110
     }
101 111
   #endif
112
+
113
+  void onSteppersDisabled() {}
114
+  void onSteppersEnabled()  {}
102 115
 }
103 116
 
104 117
 #endif // ANYCUBIC_LCD_I3MEGA

+ 10
- 0
Marlin/src/lcd/extui/dgus_lcd.cpp Wyświetl plik

@@ -76,7 +76,12 @@ namespace ExtUI {
76 76
 
77 77
   void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
78 78
 
79
+  void onHomingStart() {}
80
+  void onHomingComplete() {}
81
+  void onPrintFinished() {}
82
+
79 83
   void onFactoryReset() {}
84
+
80 85
   void onStoreSettings(char *buff) {
81 86
     // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
82 87
     // permanent data to be stored, it can write up to eeprom_data_size bytes
@@ -108,6 +113,8 @@ namespace ExtUI {
108 113
   }
109 114
 
110 115
   #if HAS_MESH
116
+    void onMeshLevelingStart() {}
117
+
111 118
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
112 119
       // Called when any mesh points are updated
113 120
     }
@@ -146,5 +153,8 @@ namespace ExtUI {
146 153
     }
147 154
   #endif
148 155
 
156
+  void onSteppersDisabled() {}
157
+  void onSteppersEnabled()  {}
149 158
 }
159
+
150 160
 #endif // HAS_DGUS_LCD

+ 13
- 3
Marlin/src/lcd/extui/example.cpp Wyświetl plik

@@ -47,9 +47,9 @@ namespace ExtUI {
47 47
   }
48 48
   void onIdle() {}
49 49
   void onPrinterKilled(PGM_P const error, PGM_P const component) {}
50
-  void onMediaInserted() {};
51
-  void onMediaError() {};
52
-  void onMediaRemoved() {};
50
+  void onMediaInserted() {}
51
+  void onMediaError() {}
52
+  void onMediaRemoved() {}
53 53
   void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
54 54
   void onPrintTimerStarted() {}
55 55
   void onPrintTimerPaused() {}
@@ -57,6 +57,11 @@ namespace ExtUI {
57 57
   void onFilamentRunout(const extruder_t extruder) {}
58 58
   void onUserConfirmRequired(const char * const msg) {}
59 59
   void onStatusChanged(const char * const msg) {}
60
+
61
+  void onHomingStart() {}
62
+  void onHomingComplete() {}
63
+  void onPrintFinished() {}
64
+
60 65
   void onFactoryReset() {}
61 66
 
62 67
   void onStoreSettings(char *buff) {
@@ -90,6 +95,8 @@ namespace ExtUI {
90 95
   }
91 96
 
92 97
   #if HAS_MESH
98
+    void onMeshLevelingStart() {}
99
+
93 100
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
94 101
       // Called when any mesh points are updated
95 102
     }
@@ -110,6 +117,9 @@ namespace ExtUI {
110 117
       // Called for temperature PID tuning result
111 118
     }
112 119
   #endif
120
+
121
+  void onSteppersDisabled() {}
122
+  void onSteppersEnabled()  {}
113 123
 }
114 124
 
115 125
 #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI

+ 11
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp Wyświetl plik

@@ -87,8 +87,9 @@ namespace ExtUI {
87 87
     InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
88 88
   }
89 89
 
90
-  void onPrintTimerPaused() {
91
-  }
90
+  void onPrintTimerPaused() {}
91
+
92
+  void onPrintFinished() {}
92 93
 
93 94
   void onFilamentRunout(const extruder_t extruder) {
94 95
     char lcd_msg[30];
@@ -97,6 +98,9 @@ namespace ExtUI {
97 98
     InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, FTDI::PLAY_SYNCHRONOUS);
98 99
   }
99 100
 
101
+  void onHomingStart() {}
102
+  void onHomingComplete() {}
103
+
100 104
   void onFactoryReset() {
101 105
     InterfaceSettingsScreen::defaultSettings();
102 106
   }
@@ -134,6 +138,8 @@ namespace ExtUI {
134 138
   }
135 139
 
136 140
   #if HAS_LEVELING && HAS_MESH
141
+    void onMeshLevelingStart() {}
142
+
137 143
     void onMeshUpdate(const int8_t x, const int8_t y, const float val) {
138 144
       BedMeshScreen::onMeshUpdate(x, y, val);
139 145
     }
@@ -170,6 +176,9 @@ namespace ExtUI {
170 176
       GOTO_SCREEN(StatusScreen);
171 177
     }
172 178
   #endif // HAS_PID_HEATING
179
+
180
+  void onSteppersDisabled() {}
181
+  void onSteppersEnabled()  {}
173 182
 }
174 183
 
175 184
 #endif // TOUCH_UI_FTDI_EVE

+ 10
- 3
Marlin/src/lcd/extui/malyan_lcd.cpp Wyświetl plik

@@ -511,12 +511,15 @@ namespace ExtUI {
511 511
 
512 512
   // Not needed for Malyan LCD
513 513
   void onStatusChanged(const char * const) {}
514
-  void onMediaInserted() {};
515
-  void onMediaError() {};
516
-  void onMediaRemoved() {};
514
+  void onMediaInserted() {}
515
+  void onMediaError() {}
516
+  void onMediaRemoved() {}
517 517
   void onPlayTone(const uint16_t, const uint16_t) {}
518 518
   void onFilamentRunout(const extruder_t extruder) {}
519 519
   void onUserConfirmRequired(const char * const) {}
520
+  void onHomingStart() {}
521
+  void onHomingComplete() {}
522
+  void onPrintFinished() {}
520 523
   void onFactoryReset() {}
521 524
   void onStoreSettings(char*) {}
522 525
   void onLoadSettings(const char*) {}
@@ -524,6 +527,7 @@ namespace ExtUI {
524 527
   void onConfigurationStoreRead(bool) {}
525 528
 
526 529
   #if HAS_MESH
530
+    void onMeshLevelingStart() {}
527 531
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {}
528 532
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
529 533
   #endif
@@ -531,6 +535,9 @@ namespace ExtUI {
531 535
   #if ENABLED(POWER_LOSS_RECOVERY)
532 536
     void onPowerLossResume() {}
533 537
   #endif
538
+
539
+  void onSteppersDisabled() {}
540
+  void onSteppersEnabled()  {}
534 541
 }
535 542
 
536 543
 #endif // MALYAN_LCD

+ 6
- 0
Marlin/src/lcd/extui/ui_api.h Wyświetl plik

@@ -140,6 +140,7 @@ namespace ExtUI {
140 140
       bed_mesh_t& getMeshArray();
141 141
       float getMeshPoint(const xy_uint8_t &pos);
142 142
       void setMeshPoint(const xy_uint8_t &pos, const float zval);
143
+      void onMeshLevelingStart();
143 144
       void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval);
144 145
       inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); }
145 146
 
@@ -344,11 +345,16 @@ namespace ExtUI {
344 345
   void onPrintTimerStarted();
345 346
   void onPrintTimerPaused();
346 347
   void onPrintTimerStopped();
348
+  void onPrintFinished();
347 349
   void onFilamentRunout(const extruder_t extruder);
348 350
   void onUserConfirmRequired(const char * const msg);
349 351
   void onUserConfirmRequired_P(PGM_P const pstr);
350 352
   void onStatusChanged(const char * const msg);
351 353
   void onStatusChanged_P(PGM_P const pstr);
354
+  void onHomingStart();
355
+  void onHomingComplete();
356
+  void onSteppersDisabled();
357
+  void onSteppersEnabled();
352 358
   void onFactoryReset();
353 359
   void onStoreSettings(char *);
354 360
   void onLoadSettings(const char *);

Ładowanie…
Anuluj
Zapisz