Ask for steel sheet on bed during Z calibration

This commit is contained in:
Alex Voinea 2024-08-31 14:23:36 +02:00
parent d2119c24e1
commit 357b68cf76
3 changed files with 14 additions and 11 deletions

View File

@ -2950,7 +2950,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
if (lcd_calibrate_z_end_stop_manual(onlyZ))
{
#endif //TMC2130
prompt_steel_sheet_on_bed(true);
lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN));
if(onlyZ){
lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1));
@ -2971,12 +2971,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
if(!onlyZ)
{
KEEPALIVE_STATE(PAUSED_FOR_USER);
#ifdef STEEL_SHEET
uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false);
if(result == LCD_LEFT_BUTTON_CHOICE) {
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
}
#endif //STEEL_SHEET
prompt_steel_sheet_on_bed(false);
lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER));
KEEPALIVE_STATE(IN_HANDLER);
lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1));

View File

@ -3748,6 +3748,16 @@ static void wizard_lay1cal_message(bool cold)
_T(MSG_WIZARD_V2_CAL_2));
}
void prompt_steel_sheet_on_bed(bool wantedState) {
#ifdef STEEL_SHEET
bool sheetIsOnBed = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, !wantedState);
if (sheetIsOnBed != wantedState) {
lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET));
}
#endif //STEEL_SHEET
}
//! @brief Printer first run wizard (Selftest and calibration)
//!
//!
@ -3865,10 +3875,6 @@ void lcd_wizard(WizState state)
case S::Z:
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS));
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT));
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false);
if (wizard_event == LCD_MIDDLE_BUTTON_CHOICE) {
lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET));
}
lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL));
wizard_event = gcode_M45(true, 0);
if (!wizard_event) {

View File

@ -220,6 +220,8 @@ void lcd_temp_calibration_set();
void lcd_language();
#endif
void prompt_steel_sheet_on_bed(bool wantedState);
void lcd_wizard();
//! @brief Wizard state