Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨♻️ Big progress display revision #24767

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 72 additions & 72 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,80 +35,80 @@ jobs:
test-platform:
# Base Environments

- DUE
- DUE_archim
- esp32
# - DUE
# - DUE_archim
# - esp32
- linux_native
- mega2560
- at90usb1286_dfu
- teensy31
- teensy35
- teensy41
- SAMD51_grandcentral_m4
- PANDA_PI_V29

# Extended AVR Environments

- FYSETC_F6
- mega1280
- rambo
- sanguino1284p
- sanguino644p

# STM32F1 (Maple) Environments

#- STM32F103RC_btt_maple
- STM32F103RC_btt_USB_maple
- STM32F103RC_fysetc_maple
- STM32F103RC_meeb_maple
- jgaurora_a5s_a1_maple
- STM32F103VE_longer_maple
#- mks_robin_maple
- mks_robin_lite_maple
- mks_robin_pro_maple
#- mks_robin_nano_v1v2_maple
#- STM32F103RE_creality_maple
- STM32F103VE_ZM3E4V2_USB_maple

# STM32 (ST) Environments

- STM32F103RC_btt
#- STM32F103RC_btt_USB
- STM32F103RE_btt
- STM32F103RE_btt_USB
- STM32F103RE_creality
- STM32F401RC_creality
- STM32F103VE_longer
- STM32F407VE_black
- BIGTREE_BTT002
- BIGTREE_SKR_PRO
- BIGTREE_GTR_V1_0
- mks_robin
- ARMED
- FYSETC_S6
- STM32F070CB_malyan
- STM32F070RB_malyan
- malyan_M300
- FLYF407ZG
- rumba32
- LERDGEX
- LERDGEK
- mks_robin_nano_v1v2
#- mks_robin_nano_v1v2_usbmod
#- mks_robin_nano_v1_3_f4_usbmod
- NUCLEO_F767ZI
- REMRAM_V1
- BTT_SKR_SE_BX
- chitu_f103
- Opulo_Lumen_REV3

# ESP32 environments
- mks_tinybee

# Put lengthy tests last

- LPC1768
- LPC1769
# - at90usb1286_dfu
# - teensy31
# - teensy35
# - teensy41
# - SAMD51_grandcentral_m4
# - PANDA_PI_V29

# # Extended AVR Environments

# - FYSETC_F6
# - mega1280
# - rambo
# - sanguino1284p
# - sanguino644p

# # STM32F1 (Maple) Environments

# #- STM32F103RC_btt_maple
# - STM32F103RC_btt_USB_maple
# - STM32F103RC_fysetc_maple
# - STM32F103RC_meeb_maple
# - jgaurora_a5s_a1_maple
# - STM32F103VE_longer_maple
# #- mks_robin_maple
# - mks_robin_lite_maple
# - mks_robin_pro_maple
# #- mks_robin_nano_v1v2_maple
# #- STM32F103RE_creality_maple
# - STM32F103VE_ZM3E4V2_USB_maple

# # STM32 (ST) Environments

# - STM32F103RC_btt
# #- STM32F103RC_btt_USB
# - STM32F103RE_btt
# - STM32F103RE_btt_USB
# - STM32F103RE_creality
# - STM32F401RC_creality
# - STM32F103VE_longer
# - STM32F407VE_black
# - BIGTREE_BTT002
# - BIGTREE_SKR_PRO
# - BIGTREE_GTR_V1_0
# - mks_robin
# - ARMED
# - FYSETC_S6
# - STM32F070CB_malyan
# - STM32F070RB_malyan
# - malyan_M300
# - FLYF407ZG
# - rumba32
# - LERDGEX
# - LERDGEK
# - mks_robin_nano_v1v2
# #- mks_robin_nano_v1v2_usbmod
# #- mks_robin_nano_v1_3_f4_usbmod
# - NUCLEO_F767ZI
# - REMRAM_V1
# - BTT_SKR_SE_BX
# - chitu_f103
# - Opulo_Lumen_REV3

# # ESP32 environments
# - mks_tinybee

# # Put lengthy tests last

# - LPC1768
# - LPC1769

# Non-working environment tests
#- at90usb1286_cdc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ vc-fileutils.settings
imgui.ini
eeprom.dat
spi_flash.bin
fs.img

#cmake
CMakeLists.txt
Expand Down
59 changes: 28 additions & 31 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1403,9 +1403,6 @@
// On the Info Screen, display XY with one decimal place when possible
//#define LCD_DECIMAL_SMALL_XY

// Add an 'M73' G-code to set the current percentage
//#define LCD_SET_PROGRESS_MANUALLY

// Show the E position (filament used) during printing
//#define LCD_SHOW_E_TOTAL

Expand All @@ -1426,37 +1423,43 @@
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#if ENABLED(NEO2_COLOR_PRESETS)
#define NEO2_USER_PRESET_RED 255 // User defined RED value
#define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value
#define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value
#define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value
#define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip
#define NEO2_USER_PRESET_RED 255 // User defined RED value
#define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value
#define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value
#define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value
#define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip
#endif
#endif

#endif
#endif // HAS_DISPLAY || DWIN_LCD_PROUI

// LCD Print Progress options
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
#if CAN_SHOW_REMAINING_TIME
//#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME)
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
#endif
// Add an 'M73' G-code to set the current percentage
//#define SET_PROGRESS_MANUALLY
#if ENABLED(SET_PROGRESS_MANUALLY)
//#define USE_M73_PERCENT // Add 'P' parameter to set percentage done, otherwise use Marlin's estimate
//#define USE_M73_REMAINING_TIME // Add 'R' parameter to set remaining time, otherwise use Marlin's estimate
//#define USE_M73_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
#if ENABLED(USE_M73_INTERACTION_TIME)
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
#endif
//#define M73_REPORT // Report M73 values to host
#endif

#if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI)
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
#endif
// LCD Print Progress options, multiple can be rotated depending on screen layout
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')

//#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this

#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
#define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
#define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever)
//#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it
//#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar
#endif
Expand Down Expand Up @@ -1799,14 +1802,8 @@
#endif // HAS_MARLINUI_U8GLIB

#if HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
// Show SD percentage next to the progress bar
//#define SHOW_SD_PERCENT

// Enable to save many cycles by drawing a hollow frame on Menu Screens
#define MENU_HOLLOW_FRAME

// Swap the CW/CCW indicators in the graphics overlay
//#define OVERLAY_GFX_REVERSE
#define MENU_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens
//#define OVERLAY_GFX_REVERSE // Swap the CW/CCW indicators in the graphics overlay
#endif

//
Expand Down Expand Up @@ -4058,7 +4055,7 @@

/**
* Mechanical Gantry Calibration
* Modern replacement for the Prusa TMC_Z_CALIBRATION.
* Modern replacement for the Průša TMC_Z_CALIBRATION.
* Adds capability to work with any adjustable current drivers.
* Implemented as G34 because M915 is deprecated.
* @section calibrate
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void startOrResumeJob() {
TERN_(GCODE_REPEAT_MARKERS, repeat.reset());
TERN_(CANCEL_OBJECTS, cancelable.reset());
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
#if BOTH(SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
ui.reset_remaining_time();
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 48: M48(); break; // M48: Z probe repeatability test
#endif

#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
#if ENABLED(SET_PROGRESS_MANUALLY)
case 73: M73(); break; // M73: Set progress percentage
#endif

case 75: M75(); break; // M75: Start print timer
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
* M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
*
* M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
* M73 - Set the progress percentage. (Requires SET_PROGRESS_MANUALLY)
* M75 - Start the print job timer.
* M76 - Pause the print job timer.
* M77 - Stop the print job timer.
Expand Down Expand Up @@ -677,7 +677,7 @@ class GcodeSuite {
static void M48();
#endif

#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
#if ENABLED(SET_PROGRESS_MANUALLY)
static void M73();
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void GcodeSuite::M115() {
cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));

// BUILD_PERCENT (M73)
cap_line(F("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
cap_line(F("BUILD_PERCENT"), BOTH(SET_PROGRESS_MANUALLY, USE_M73_PERCENT));

// SOFTWARE_POWER (M80, M81)
cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
Expand Down
52 changes: 44 additions & 8 deletions Marlin/src/gcode/lcd/M73.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,35 @@

#include "../../inc/MarlinConfig.h"

#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
#if ENABLED(SET_PROGRESS_MANUALLY)

#include "../gcode.h"
#include "../../lcd/marlinui.h"
#include "../../sd/cardreader.h"
#include "../../libs/numtostr.h"

#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

#if ENABLED(M73_REPORT)
#define M73_REPORT_PRUSA
#endif

/**
* M73: Set percentage complete (for display on LCD)
*
* Example:
* M73 P25 ; Set progress to 25%
* M73 P25.63 ; Set progress to 25.63%
* M73 R456 ; Set remaining time to 456 minutes
* M73 C12 ; Set next interaction countdown to 12 minutes
* M73 ; Report current values
*
* Use a shorter-than-Průša report format:
* M73 Percent done: ---%; Time left: -----m; Change: -----m;
*
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100 / 23.4 / 3.45 format
*
*/
void GcodeSuite::M73() {

Expand All @@ -46,17 +60,39 @@ void GcodeSuite::M73() {

#else

if (parser.seenval('P'))
ui.set_progress((PROGRESS_SCALE) > 1
? parser.value_float() * (PROGRESS_SCALE)
: parser.value_byte()
);
#if ENABLED(USE_M73_PERCENT)
if (parser.seenval('P'))
ui.set_progress((PROGRESS_SCALE) > 1
? parser.value_float() * (PROGRESS_SCALE)
: parser.value_byte()
);
#endif

#if ENABLED(USE_M73_REMAINING_TIME)
if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
#endif

#if ENABLED(USE_M73_INTERACTION_TIME)
if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong());
#endif

#endif

#if ENABLED(M73_REPORT)
{
SERIAL_ECHO_MSG(
TERN(M73_REPORT_PRUSA, "M73 Percent done: ", "Progress: ")
, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent())
#if ENABLED(USE_M73_REMAINING_TIME)
, TERN(M73_REPORT_PRUSA, "; Print time remaining in mins: ", "%; Time left: "), ui.remaining_time / 60
#endif
#if ENABLED(USE_M73_INTERACTION_TIME)
, TERN(M73_REPORT_PRUSA, "; Change in mins: ", "m; Change: "), ui.interaction_time / 60
#endif
, TERN(M73_REPORT_PRUSA, ";", "m")
);
}
#endif
}

#endif // LCD_SET_PROGRESS_MANUALLY
#endif // SET_PROGRESS_MANUALLY
Loading