|
@@ -872,14 +872,34 @@ void lcd_status_screen()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void print_stop();
|
|
|
+
|
|
|
void lcd_commands()
|
|
|
{
|
|
|
+ if (planner_aborted) {
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcd_commands_type == LcdCommands::StopPrint)
|
|
|
+ {
|
|
|
+ if (!blocks_queued() && !homing_flag)
|
|
|
+ {
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
+ lcd_setstatuspgm(_T(MSG_PRINT_ABORTED));
|
|
|
+ lcd_commands_type = LcdCommands::Idle;
|
|
|
+ lcd_commands_step = 0;
|
|
|
+ print_stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (lcd_commands_type == LcdCommands::LongPause)
|
|
|
{
|
|
|
if (!blocks_queued() && !homing_flag)
|
|
|
{
|
|
|
if (custom_message_type != CustomMsg::M117)
|
|
|
{
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
lcd_setstatuspgm(_i("Print paused"));
|
|
|
}
|
|
|
lcd_commands_type = LcdCommands::Idle;
|
|
@@ -1070,12 +1090,16 @@ void lcd_return_to_status()
|
|
|
void lcd_pause_print()
|
|
|
{
|
|
|
stop_and_save_print_to_ram(0.0, -default_retraction);
|
|
|
- lcd_return_to_status();
|
|
|
- isPrintPaused = true;
|
|
|
- if (LcdCommands::Idle == lcd_commands_type) {
|
|
|
- lcd_commands_type = LcdCommands::LongPause;
|
|
|
+
|
|
|
+ if (!card.sdprinting) {
|
|
|
+ SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
+
|
|
|
+ isPrintPaused = true;
|
|
|
+
|
|
|
+
|
|
|
+ lcd_commands_type = LcdCommands::LongPause;
|
|
|
+ lcd_return_to_status();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -6289,38 +6313,19 @@ static void lcd_sd_updir()
|
|
|
menu_data_reset();
|
|
|
}
|
|
|
|
|
|
-void lcd_print_stop()
|
|
|
+
|
|
|
+void print_stop()
|
|
|
{
|
|
|
- if (!card.sdprinting) {
|
|
|
- SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL);
|
|
|
- }
|
|
|
- UnconditionalStop();
|
|
|
-
|
|
|
-
|
|
|
-#ifdef MESH_BED_LEVELING
|
|
|
- mbl.active = false;
|
|
|
-#endif
|
|
|
+
|
|
|
+ stoptime = _millis();
|
|
|
+ unsigned long t = (stoptime - starttime - pause_time) / 1000;
|
|
|
+ save_statistics(total_filament_used, t);
|
|
|
|
|
|
- lcd_setstatuspgm(_T(MSG_PRINT_ABORTED));
|
|
|
- stoptime = _millis();
|
|
|
- unsigned long t = (stoptime - starttime - pause_time) / 1000;
|
|
|
- pause_time = 0;
|
|
|
- save_statistics(total_filament_used, t);
|
|
|
+
|
|
|
+ raise_z_above(current_position[Z_AXIS] + 10, true);
|
|
|
|
|
|
-
|
|
|
- lcd_commands_step = 0;
|
|
|
- lcd_commands_type = LcdCommands::Idle;
|
|
|
-
|
|
|
- lcd_cooldown();
|
|
|
-
|
|
|
- if (axis_known_position[Z_AXIS]) {
|
|
|
- current_position[Z_AXIS] += Z_CANCEL_LIFT;
|
|
|
- clamp_to_software_endstops(current_position);
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
|
|
|
- }
|
|
|
-
|
|
|
- if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
|
|
|
- {
|
|
|
+
|
|
|
+ if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) {
|
|
|
current_position[X_AXIS] = X_CANCEL_POS;
|
|
|
current_position[Y_AXIS] = Y_CANCEL_POS;
|
|
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
@@ -6328,17 +6333,32 @@ void lcd_print_stop()
|
|
|
st_synchronize();
|
|
|
|
|
|
if (mmu_enabled) extr_unload();
|
|
|
-
|
|
|
finishAndDisableSteppers();
|
|
|
+ axis_relative_modes = E_AXIS_MASK;
|
|
|
+}
|
|
|
|
|
|
- lcd_setstatuspgm(MSG_WELCOME);
|
|
|
- custom_message_type = CustomMsg::Status;
|
|
|
+void lcd_print_stop()
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ UnconditionalStop();
|
|
|
|
|
|
- planner_abort_hard();
|
|
|
-
|
|
|
- axis_relative_modes = E_AXIS_MASK;
|
|
|
-
|
|
|
- isPrintPaused = false;
|
|
|
+ if (!card.sdprinting) {
|
|
|
+ SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL);
|
|
|
+ }
|
|
|
+
|
|
|
+#ifdef MESH_BED_LEVELING
|
|
|
+ mbl.active = false;
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+ pause_time = 0;
|
|
|
+ isPrintPaused = false;
|
|
|
+
|
|
|
+
|
|
|
+ lcd_commands_type = LcdCommands::StopPrint;
|
|
|
+ lcd_return_to_status();
|
|
|
}
|
|
|
|
|
|
void lcd_sdcard_stop()
|