Malyan M200 V2 (#17840)
This commit is contained in:
@ -150,19 +150,19 @@ namespace ExtUI {
|
||||
#if HAS_PID_HEATING
|
||||
void onPidTuning(const result_t rst) {
|
||||
// Called for temperature PID tuning result
|
||||
SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
|
||||
//SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
|
||||
switch (rst) {
|
||||
case PID_BAD_EXTRUDER_NUM:
|
||||
StatusScreen::setStatusMessage(STR_PID_BAD_EXTRUDER_NUM);
|
||||
StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
break;
|
||||
case PID_TEMP_TOO_HIGH:
|
||||
StatusScreen::setStatusMessage(STR_PID_TEMP_TOO_HIGH);
|
||||
StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
|
||||
break;
|
||||
case PID_TUNING_TIMEOUT:
|
||||
StatusScreen::setStatusMessage(STR_PID_TIMEOUT);
|
||||
StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
|
||||
break;
|
||||
case PID_DONE:
|
||||
StatusScreen::setStatusMessage(STR_PID_AUTOTUNE_FINISHED);
|
||||
StatusScreen::setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
|
||||
break;
|
||||
}
|
||||
GOTO_SCREEN(StatusScreen);
|
||||
|
@ -330,8 +330,8 @@ namespace ExtUI {
|
||||
// Delta limits XY based on the current offset from center
|
||||
// This assumes the center is 0,0
|
||||
#if ENABLED(DELTA)
|
||||
if (axis != Z_AXIS) {
|
||||
max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis
|
||||
if (axis != Z) {
|
||||
max = SQRT(sq(float(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis
|
||||
min = -max;
|
||||
}
|
||||
#endif
|
||||
|
@ -45,7 +45,7 @@ namespace ExtUI {
|
||||
|
||||
void onIdle() { ScreenHandler.loop(); }
|
||||
|
||||
void onPrinterKilled(PGM_P error, PGM_P component) {
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
||||
ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
|
||||
while (!ScreenHandler.loop()); // Wait while anything is left to be sent
|
||||
@ -127,19 +127,18 @@ namespace ExtUI {
|
||||
#if HAS_PID_HEATING
|
||||
void onPidTuning(const result_t rst) {
|
||||
// Called for temperature PID tuning result
|
||||
SERIAL_ECHOLNPAIR("onPidTuning:",rst);
|
||||
switch(rst) {
|
||||
switch (rst) {
|
||||
case PID_BAD_EXTRUDER_NUM:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_BAD_EXTRUDER_NUM));
|
||||
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
break;
|
||||
case PID_TEMP_TOO_HIGH:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TEMP_TOO_HIGH));
|
||||
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
|
||||
break;
|
||||
case PID_TUNING_TIMEOUT:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TIMEOUT));
|
||||
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
|
||||
break;
|
||||
case PID_DONE:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_AUTOTUNE_FINISHED));
|
||||
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
|
||||
break;
|
||||
}
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
|
@ -97,6 +97,18 @@ void write_to_lcd(const char * const message) {
|
||||
LCD_SERIAL.Print::write(encoded_message, message_length);
|
||||
}
|
||||
|
||||
// {E:<msg>} is for error states.
|
||||
void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr) {
|
||||
write_to_lcd_P(PSTR("{E:"));
|
||||
write_to_lcd_P(error);
|
||||
if (component) {
|
||||
write_to_lcd_P(PSTR(" "));
|
||||
write_to_lcd_P(component);
|
||||
}
|
||||
write_to_lcd_P(PSTR("}"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process an LCD 'C' command.
|
||||
* These are currently all temperature commands
|
||||
@ -465,15 +477,33 @@ namespace ExtUI {
|
||||
#endif
|
||||
}
|
||||
|
||||
// {E:<msg>} is for error states.
|
||||
void onPrinterKilled(PGM_P error, PGM_P component) {
|
||||
write_to_lcd_P(PSTR("{E:"));
|
||||
write_to_lcd_P(error);
|
||||
write_to_lcd_P(PSTR(" "));
|
||||
write_to_lcd_P(component);
|
||||
write_to_lcd_P("}");
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
||||
set_lcd_error_P(error, component);
|
||||
}
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
|
||||
void onPidTuning(const result_t rst) {
|
||||
// Called for temperature PID tuning result
|
||||
//SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
|
||||
switch (rst) {
|
||||
case PID_BAD_EXTRUDER_NUM:
|
||||
set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
break;
|
||||
case PID_TEMP_TOO_HIGH:
|
||||
set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
|
||||
break;
|
||||
case PID_TUNING_TIMEOUT:
|
||||
set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT));
|
||||
break;
|
||||
case PID_DONE:
|
||||
set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); }
|
||||
void onPrintTimerPaused() {}
|
||||
void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); }
|
||||
@ -500,10 +530,6 @@ namespace ExtUI {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void onPowerLossResume() {}
|
||||
#endif
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void onPidTuning(const result_t rst) {}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // MALYAN_LCD
|
||||
|
@ -266,6 +266,10 @@ namespace Language_en {
|
||||
PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off");
|
||||
PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune");
|
||||
PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *");
|
||||
PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done");
|
||||
PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder.");
|
||||
PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high.");
|
||||
PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout.");
|
||||
PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P");
|
||||
PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *");
|
||||
PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I");
|
||||
|
Reference in New Issue
Block a user