Merge pull request #4751 from sarusani/FilamentRunoutActions
Send host actions on filament runout
This commit is contained in:
commit
055f601ad3
|
|
@ -149,6 +149,7 @@ void Filament_sensor::triggerFilamentRemoved() {
|
|||
|
||||
void Filament_sensor::filRunout() {
|
||||
// SERIAL_ECHOLNPGM("filRunout");
|
||||
sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED);
|
||||
runoutEnabled = false;
|
||||
autoLoadEnabled = false;
|
||||
stop_and_save_print_to_ram(0, 0);
|
||||
|
|
|
|||
|
|
@ -3406,6 +3406,7 @@ static void gcode_M600(const bool automatic, const float x_position, const float
|
|||
current_position[E_AXIS] += e_shift;
|
||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED);
|
||||
st_synchronize();
|
||||
SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED);
|
||||
} else {
|
||||
// Print is paused and the extruder may be cold
|
||||
// Filament change can be issued via the Tune menu
|
||||
|
|
@ -3505,8 +3506,13 @@ static void gcode_M600(const bool automatic, const float x_position, const float
|
|||
feedmultiply = saved_feedmultiply2;
|
||||
enquecommandf_P(MSG_M220, saved_feedmultiply2);
|
||||
|
||||
if (printingIsPaused()) lcd_setstatuspgm(_T(MSG_PRINT_PAUSED));
|
||||
else lcd_setstatuspgm(MSG_WELCOME);
|
||||
if (printingIsPaused()) {
|
||||
lcd_setstatuspgm(_T(MSG_PRINT_PAUSED));
|
||||
}
|
||||
else {
|
||||
lcd_setstatuspgm(MSG_WELCOME);
|
||||
SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED);
|
||||
}
|
||||
custom_message_type = CustomMsg::Status;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ const char MSG_HOST_ACTION_NOT_READY[] PROGMEM_N1 = "//action:not_ready"; ////
|
|||
const char MSG_HOST_ACTION_START[] PROGMEM_N1 = "//action:start"; ////
|
||||
const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_recovery_ready"; ////
|
||||
const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_auto_recovery_ready"; ////
|
||||
const char MSG_HOST_ACTION_NOTIFICATION[] PROGMEM_N1 = "//action:notification %S\n"; ////
|
||||
#ifdef HOST_SHUTDOWN
|
||||
const char MSG_HOST_ACTION_SHUTDOWN[] PROGMEM_N1 = "//action:shutdown"; ////
|
||||
#endif //HOST_SHUTOWN
|
||||
|
|
@ -424,6 +425,7 @@ const char MSG_ADVANCE_K[] PROGMEM_N1 = "Advance K:"; ////c=13
|
|||
const char MSG_POWERPANIC_DETECTED[] PROGMEM_N1 = "POWER PANIC DETECTED"; ////c=20
|
||||
const char MSG_LCD_STATUS_CHANGED[] PROGMEM_N1 = "LCD status changed";
|
||||
const char MSG_UNKNOWN_CODE[] PROGMEM_N1 = "Unknown %c code: %s\n";
|
||||
const char MSG_FILAMENT_RUNOUT_DETECTED[] PROGMEM_N1 = "Filament runout detected!"; ////c=20 r=2
|
||||
|
||||
// Common G-gcodes
|
||||
const char G1_E_F2700[] PROGMEM_N1 = "G1 E%-.3f F2700";
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ extern const char MSG_HOST_ACTION_NOT_READY[];
|
|||
extern const char MSG_HOST_ACTION_START[];
|
||||
extern const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[];
|
||||
extern const char MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY[];
|
||||
extern const char MSG_HOST_ACTION_NOTIFICATION[];
|
||||
#ifdef HOST_SHUTDOWN
|
||||
extern const char MSG_HOST_ACTION_SHUTDOWN[];
|
||||
#endif //HOST_SHUTOWN
|
||||
|
|
@ -426,6 +427,7 @@ extern const char MSG_ADVANCE_K[];
|
|||
extern const char MSG_POWERPANIC_DETECTED[];
|
||||
extern const char MSG_LCD_STATUS_CHANGED[];
|
||||
extern const char MSG_UNKNOWN_CODE[];
|
||||
extern const char MSG_FILAMENT_RUNOUT_DETECTED[];
|
||||
|
||||
// Common G-gcodes
|
||||
extern const char G1_E_F2700[];
|
||||
|
|
|
|||
|
|
@ -5074,7 +5074,11 @@ static void change_sheet()
|
|||
menu_back(3);
|
||||
}
|
||||
|
||||
|
||||
//! @brief Send a notification to the host. Param 'message' must reside in program memory!
|
||||
void sendHostNotification_P(const char* message)
|
||||
{
|
||||
printf_P(MSG_HOST_ACTION_NOTIFICATION, message);
|
||||
}
|
||||
|
||||
static void lcd_rename_sheet_menu()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -260,4 +260,6 @@ extern void lcd_heat_bed_on_load_toggle();
|
|||
extern void retract_for_ooze_prevention();
|
||||
#endif //COMMUNITY_PREVENT_OOZE
|
||||
|
||||
extern void sendHostNotification_P(const char* message);
|
||||
|
||||
#endif //ULTRALCD_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue