ExtUI homing / leveling additions

This commit is contained in:
Scott Lahteine 2020-11-05 16:45:22 -06:00
parent ef35fc60c1
commit 284cc8f62d
11 changed files with 95 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -52,6 +52,11 @@ namespace ExtUI {
void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); }
void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); }
void onStatusChanged(const char * const msg) {}
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {}
void onStoreSettings(char *buff) {
@ -84,9 +89,14 @@ namespace ExtUI {
// whether successful or not.
}
#if HAS_MESH
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)
void onPowerLossResume() {
@ -99,6 +109,9 @@ namespace ExtUI {
// Called for temperature PID tuning result
}
#endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
}
#endif // ANYCUBIC_LCD_I3MEGA

View File

@ -76,7 +76,12 @@ namespace ExtUI {
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
void onHomingStart() {}
void onHomingComplete() {}
void onPrintFinished() {}
void onFactoryReset() {}
void onStoreSettings(char *buff) {
// 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
@ -108,6 +113,8 @@ namespace ExtUI {
}
#if HAS_MESH
void onMeshLevelingStart() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// Called when any mesh points are updated
}
@ -146,5 +153,8 @@ namespace ExtUI {
}
#endif
void onSteppersDisabled() {}
void onSteppersEnabled() {}
}
#endif // HAS_DGUS_LCD

View File

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

View File

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

View File

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

View File

@ -140,6 +140,7 @@ namespace ExtUI {
bed_mesh_t& getMeshArray();
float getMeshPoint(const xy_uint8_t &pos);
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);
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 onPrintTimerPaused();
void onPrintTimerStopped();
void onPrintFinished();
void onFilamentRunout(const extruder_t extruder);
void onUserConfirmRequired(const char * const msg);
void onUserConfirmRequired_P(PGM_P const pstr);
void onStatusChanged(const char * const msg);
void onStatusChanged_P(PGM_P const pstr);
void onHomingStart();
void onHomingComplete();
void onSteppersDisabled();
void onSteppersEnabled();
void onFactoryReset();
void onStoreSettings(char *);
void onLoadSettings(const char *);