Browse Source

ExtUI homing / leveling additions

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
284cc8f62d
  1. 8
      Marlin/src/MarlinCore.cpp
  2. 2
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  3. 8
      Marlin/src/gcode/calibrate/G28.cpp
  4. 2
      Marlin/src/gcode/sd/M1001.cpp
  5. 9
      Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp
  6. 19
      Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp
  7. 10
      Marlin/src/lcd/extui/dgus_lcd.cpp
  8. 16
      Marlin/src/lcd/extui/example.cpp
  9. 13
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp
  10. 13
      Marlin/src/lcd/extui/malyan_lcd.cpp
  11. 6
      Marlin/src/lcd/extui/ui_api.h

8
Marlin/src/MarlinCore.cpp

@ -77,6 +77,10 @@
#include "lcd/dwin/e3v2/rotary_encoder.h" #include "lcd/dwin/e3v2/rotary_encoder.h"
#endif #endif
#if ENABLED(EXTENSIBLE_UI)
#include "lcd/extui/ui_api.h"
#endif
#if HAS_ETHERNET #if HAS_ETHERNET
#include "feature/ethernet.h" #include "feature/ethernet.h"
#endif #endif
@ -360,6 +364,8 @@ void enable_all_steppers() {
ENABLE_AXIS_Y(); ENABLE_AXIS_Y();
ENABLE_AXIS_Z(); ENABLE_AXIS_Z();
enable_e_steppers(); enable_e_steppers();
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled());
} }
void disable_e_steppers() { void disable_e_steppers() {
@ -379,6 +385,8 @@ void disable_all_steppers() {
DISABLE_AXIS_Y(); DISABLE_AXIS_Y();
DISABLE_AXIS_Z(); DISABLE_AXIS_Z();
disable_e_steppers(); disable_e_steppers();
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled());
} }
#if ENABLED(G29_RETRY_AND_RECOVER) #if ENABLED(G29_RETRY_AND_RECOVER)

2
Marlin/src/gcode/bedlevel/abl/G29.cpp

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

8
Marlin/src/gcode/calibrate/G28.cpp

@ -50,6 +50,10 @@
#include "../../lcd/dwin/e3v2/dwin.h" #include "../../lcd/dwin/e3v2/dwin.h"
#endif #endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
#if HAS_L64XX // set L6470 absolute position registers to counts #if HAS_L64XX // set L6470 absolute position registers to counts
#include "../../libs/L64XX/L64XX_Marlin.h" #include "../../libs/L64XX/L64XX_Marlin.h"
#endif #endif
@ -209,6 +213,8 @@ void GcodeSuite::G28() {
TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true); TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
bool IDEX_saved_duplication_state = extruder_duplication_enabled; bool IDEX_saved_duplication_state = extruder_duplication_enabled;
DualXMode IDEX_saved_mode = dual_x_carriage_mode; DualXMode IDEX_saved_mode = dual_x_carriage_mode;
@ -462,6 +468,8 @@ void GcodeSuite::G28() {
TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());
report_current_position(); report_current_position();
if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS))) if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS)))

2
Marlin/src/gcode/sd/M1001.cpp

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

9
Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp

@ -62,6 +62,10 @@ namespace ExtUI {
void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); } void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); }
void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); } void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); }
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {} void onFactoryReset() {}
void onStoreSettings(char *buff) { void onStoreSettings(char *buff) {
@ -95,6 +99,8 @@ namespace ExtUI {
} }
#if HAS_MESH #if HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
//SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval); //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
@ -116,6 +122,9 @@ namespace ExtUI {
// Called for temperature PID tuning result // Called for temperature PID tuning result
} }
#endif #endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // ANYCUBIC_LCD_CHIRON #endif // ANYCUBIC_LCD_CHIRON

19
Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp

@ -52,6 +52,11 @@ namespace ExtUI {
void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); } void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); }
void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); } void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); }
void onStatusChanged(const char * const msg) {} void onStatusChanged(const char * const msg) {}
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {} void onFactoryReset() {}
void onStoreSettings(char *buff) { void onStoreSettings(char *buff) {
@ -84,9 +89,14 @@ namespace ExtUI {
// whether successful or not. // whether successful or not.
} }
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { #if HAS_MESH
// Called when any mesh points are updated
} void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// Called when any mesh points are updated
}
#endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() { void onPowerLossResume() {
@ -99,6 +109,9 @@ namespace ExtUI {
// Called for temperature PID tuning result // Called for temperature PID tuning result
} }
#endif #endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // ANYCUBIC_LCD_I3MEGA #endif // ANYCUBIC_LCD_I3MEGA

10
Marlin/src/lcd/extui/dgus_lcd.cpp

@ -76,7 +76,12 @@ namespace ExtUI {
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); } void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {} void onFactoryReset() {}
void onStoreSettings(char *buff) { void onStoreSettings(char *buff) {
// Called when saving to EEPROM (i.e. M500). If the ExtUI needs // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
// permanent data to be stored, it can write up to eeprom_data_size bytes // permanent data to be stored, it can write up to eeprom_data_size bytes
@ -108,6 +113,8 @@ namespace ExtUI {
} }
#if HAS_MESH #if HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
} }
@ -146,5 +153,8 @@ namespace ExtUI {
} }
#endif #endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // HAS_DGUS_LCD #endif // HAS_DGUS_LCD

16
Marlin/src/lcd/extui/example.cpp

@ -47,9 +47,9 @@ namespace ExtUI {
} }
void onIdle() {} void onIdle() {}
void onPrinterKilled(PGM_P const error, PGM_P const component) {} void onPrinterKilled(PGM_P const error, PGM_P const component) {}
void onMediaInserted() {}; void onMediaInserted() {}
void onMediaError() {}; void onMediaError() {}
void onMediaRemoved() {}; void onMediaRemoved() {}
void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
void onPrintTimerStarted() {} void onPrintTimerStarted() {}
void onPrintTimerPaused() {} void onPrintTimerPaused() {}
@ -57,6 +57,11 @@ namespace ExtUI {
void onFilamentRunout(const extruder_t extruder) {} void onFilamentRunout(const extruder_t extruder) {}
void onUserConfirmRequired(const char * const msg) {} void onUserConfirmRequired(const char * const msg) {}
void onStatusChanged(const char * const msg) {} void onStatusChanged(const char * const msg) {}
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {} void onFactoryReset() {}
void onStoreSettings(char *buff) { void onStoreSettings(char *buff) {
@ -90,6 +95,8 @@ namespace ExtUI {
} }
#if HAS_MESH #if HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
} }
@ -110,6 +117,9 @@ namespace ExtUI {
// Called for temperature PID tuning result // Called for temperature PID tuning result
} }
#endif #endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // EXTUI_EXAMPLE && EXTENSIBLE_UI #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI

13
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp

@ -87,8 +87,9 @@ namespace ExtUI {
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED); InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
} }
void onPrintTimerPaused() { void onPrintTimerPaused() {}
}
void onPrintFinished() {}
void onFilamentRunout(const extruder_t extruder) { void onFilamentRunout(const extruder_t extruder) {
char lcd_msg[30]; char lcd_msg[30];
@ -97,6 +98,9 @@ namespace ExtUI {
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, FTDI::PLAY_SYNCHRONOUS); InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, FTDI::PLAY_SYNCHRONOUS);
} }
void onHomingStart() {}
void onHomingComplete() {}
void onFactoryReset() { void onFactoryReset() {
InterfaceSettingsScreen::defaultSettings(); InterfaceSettingsScreen::defaultSettings();
} }
@ -134,6 +138,8 @@ namespace ExtUI {
} }
#if HAS_LEVELING && HAS_MESH #if HAS_LEVELING && HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t x, const int8_t y, const float val) { void onMeshUpdate(const int8_t x, const int8_t y, const float val) {
BedMeshScreen::onMeshUpdate(x, y, val); BedMeshScreen::onMeshUpdate(x, y, val);
} }
@ -170,6 +176,9 @@ namespace ExtUI {
GOTO_SCREEN(StatusScreen); GOTO_SCREEN(StatusScreen);
} }
#endif // HAS_PID_HEATING #endif // HAS_PID_HEATING
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // TOUCH_UI_FTDI_EVE #endif // TOUCH_UI_FTDI_EVE

13
Marlin/src/lcd/extui/malyan_lcd.cpp

@ -511,12 +511,15 @@ namespace ExtUI {
// Not needed for Malyan LCD // Not needed for Malyan LCD
void onStatusChanged(const char * const) {} void onStatusChanged(const char * const) {}
void onMediaInserted() {}; void onMediaInserted() {}
void onMediaError() {}; void onMediaError() {}
void onMediaRemoved() {}; void onMediaRemoved() {}
void onPlayTone(const uint16_t, const uint16_t) {} void onPlayTone(const uint16_t, const uint16_t) {}
void onFilamentRunout(const extruder_t extruder) {} void onFilamentRunout(const extruder_t extruder) {}
void onUserConfirmRequired(const char * const) {} void onUserConfirmRequired(const char * const) {}
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {} void onFactoryReset() {}
void onStoreSettings(char*) {} void onStoreSettings(char*) {}
void onLoadSettings(const char*) {} void onLoadSettings(const char*) {}
@ -524,6 +527,7 @@ namespace ExtUI {
void onConfigurationStoreRead(bool) {} void onConfigurationStoreRead(bool) {}
#if HAS_MESH #if HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
#endif #endif
@ -531,6 +535,9 @@ namespace ExtUI {
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {} void onPowerLossResume() {}
#endif #endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
} }
#endif // MALYAN_LCD #endif // MALYAN_LCD

6
Marlin/src/lcd/extui/ui_api.h

@ -140,6 +140,7 @@ namespace ExtUI {
bed_mesh_t& getMeshArray(); bed_mesh_t& getMeshArray();
float getMeshPoint(const xy_uint8_t &pos); float getMeshPoint(const xy_uint8_t &pos);
void setMeshPoint(const xy_uint8_t &pos, const float zval); void setMeshPoint(const xy_uint8_t &pos, const float zval);
void onMeshLevelingStart();
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval); void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval);
inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); } inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); }
@ -344,11 +345,16 @@ namespace ExtUI {
void onPrintTimerStarted(); void onPrintTimerStarted();
void onPrintTimerPaused(); void onPrintTimerPaused();
void onPrintTimerStopped(); void onPrintTimerStopped();
void onPrintFinished();
void onFilamentRunout(const extruder_t extruder); void onFilamentRunout(const extruder_t extruder);
void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired(const char * const msg);
void onUserConfirmRequired_P(PGM_P const pstr); void onUserConfirmRequired_P(PGM_P const pstr);
void onStatusChanged(const char * const msg); void onStatusChanged(const char * const msg);
void onStatusChanged_P(PGM_P const pstr); void onStatusChanged_P(PGM_P const pstr);
void onHomingStart();
void onHomingComplete();
void onSteppersDisabled();
void onSteppersEnabled();
void onFactoryReset(); void onFactoryReset();
void onStoreSettings(char *); void onStoreSettings(char *);
void onLoadSettings(const char *); void onLoadSettings(const char *);

Loading…
Cancel
Save