Browse Source

Print progress enhancements (#14647)

pull/1/head
Marcio Teixeira 5 years ago
committed by Scott Lahteine
parent
commit
27c487bab7
  1. 5
      Marlin/src/gcode/lcd/M117.cpp
  2. 4
      Marlin/src/gcode/lcd/M73.cpp
  3. 5
      Marlin/src/gcode/sdcard/M23.cpp
  4. 2
      Marlin/src/gcode/temperature/M104_M109.cpp
  5. 4
      Marlin/src/lcd/menu/menu.cpp
  6. 4
      Marlin/src/lcd/ultralcd.cpp
  7. 2
      Marlin/src/lcd/ultralcd.h
  8. 4
      Marlin/src/module/motion.cpp
  9. 2
      Marlin/src/module/temperature.cpp
  10. 2
      Marlin/src/module/temperature.h
  11. 2
      Marlin/src/module/tool_change.cpp
  12. 8
      Marlin/src/sd/cardreader.cpp
  13. 4
      Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp

5
Marlin/src/gcode/lcd/M117.cpp

@ -28,6 +28,9 @@
*/
void GcodeSuite::M117() {
ui.set_status(parser.string_arg);
if (parser.string_arg && parser.string_arg[0])
ui.set_status(parser.string_arg);
else
ui.reset_status();
}

4
Marlin/src/gcode/lcd/M73.cpp

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && EITHER(EXTENSIBLE_UI, ULTRA_LCD)
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
#include "../gcode.h"
#include "../../lcd/ultralcd.h"
@ -42,4 +42,4 @@ void GcodeSuite::M73() {
ui.set_progress(parser.value_byte());
}
#endif // LCD_SET_PROGRESS_MANUALLY && (EXTENSIBLE_UI || ULTRA_LCD)
#endif // LCD_SET_PROGRESS_MANUALLY

5
Marlin/src/gcode/sdcard/M23.cpp

@ -26,6 +26,7 @@
#include "../gcode.h"
#include "../../sd/cardreader.h"
#include "../../lcd/ultralcd.h"
/**
* M23: Open a file
@ -36,6 +37,10 @@ void GcodeSuite::M23() {
// Simplify3D includes the size, so zero out all spaces (#7227)
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
card.openFile(parser.string_arg, true);
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
ui.set_progress(0);
#endif
}
#endif // SDSUPPORT

2
Marlin/src/gcode/temperature/M104_M109.cpp

@ -125,7 +125,7 @@ void GcodeSuite::M109() {
print_job_timer.start();
#endif
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling)
thermalManager.set_heating_message(target_extruder);
#endif

4
Marlin/src/lcd/menu/menu.cpp

@ -204,6 +204,10 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
lcd_z_fade_height = planner.z_fade_height;
#endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
progress_reset();
#endif
#if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
static millis_t doubleclick_expire_ms = 0;
// Going to menu_main from status screen? Remember first click time.

4
Marlin/src/lcd/ultralcd.cpp

@ -1522,13 +1522,15 @@ void MarlinUI::update() {
uint8_t MarlinUI::get_progress() {
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
uint8_t &progress = progress_bar_percent;
#define _PLIMIT(P) ((P) & 0x7F)
#else
#define _PLIMIT(P) P
uint8_t progress = 0;
#endif
#if ENABLED(SDSUPPORT)
if (IS_SD_PRINTING()) progress = card.percentDone();
#endif
return progress;
return _PLIMIT(progress);
}
#endif

2
Marlin/src/lcd/ultralcd.h

@ -298,6 +298,8 @@ public:
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
static uint8_t progress_bar_percent;
static void set_progress(const uint8_t progress) { progress_bar_percent = _MIN(progress, 100); }
static void set_progress_done() { set_progress(0x80 + 100); }
static bool progress_reset() { if (progress_bar_percent & 0x80) set_progress(0); }
#endif
static uint8_t get_progress();
#else

4
Marlin/src/module/motion.cpp

@ -51,7 +51,7 @@
#include "../feature/bltouch.h"
#endif
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
#include "../lcd/ultralcd.h"
#endif
@ -1044,7 +1044,7 @@ bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool
if (zz) SERIAL_CHAR('Z');
SERIAL_ECHOLNPGM(" " MSG_FIRST);
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
#endif
return true;

2
Marlin/src/module/temperature.cpp

@ -2923,7 +2923,7 @@ void Temperature::isr() {
#endif // AUTO_REPORT_TEMPERATURES
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
void Temperature::set_heating_message(const uint8_t e) {
const bool heating = isHeatingHotend(e);
#if HOTENDS > 1

2
Marlin/src/module/temperature.h

@ -785,7 +785,7 @@ class Temperature {
#endif
#endif
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
static void set_heating_message(const uint8_t e);
#endif

2
Marlin/src/module/tool_change.cpp

@ -982,7 +982,7 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) {
singlenozzle_temp[active_extruder] = thermalManager.temp_hotend[0].target;
if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
thermalManager.setTargetHotend(singlenozzle_temp[tmp_extruder], 0);
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
thermalManager.set_heating_message(0);
#endif
(void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling

8
Marlin/src/sd/cardreader.cpp

@ -1008,18 +1008,16 @@ void CardReader::printingHasFinished() {
#endif
print_job_timer.stop();
if (print_job_timer.duration() > 60) queue.inject_P(PSTR("M31"));
queue.enqueue_now_P(print_job_timer.duration() > 60 ? PSTR("M31") : PSTR("M117"));
#if ENABLED(SDCARD_SORT_ALPHA)
presort();
#endif
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
ui.progress_bar_percent = 0;
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
ui.set_progress_done();
#endif
ui.reset_status();
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
ui.reselect_last_file();
#endif

4
Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp

@ -31,7 +31,7 @@
#include "Sd2Card_FlashDrive.h"
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
#include "../../lcd/ultralcd.h"
#endif
@ -63,7 +63,7 @@ void Sd2Card::idle() {
SERIAL_ECHOPGM("Starting USB host...");
if (!usb.start()) {
SERIAL_ECHOPGM(" Failed. Retrying in 2s.");
#if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
#if HAS_DISPLAY
LCD_MESSAGEPGM("USB start failed");
#endif
state = USB_HOST_DELAY_INIT;

Loading…
Cancel
Save