From 92696d8e86cbd2b33910859ef3286c78d1c04b7f Mon Sep 17 00:00:00 2001 From: Nazar78 Date: Tue, 31 Oct 2023 03:28:18 +0800 Subject: [PATCH 1/5] Fixed [BUG] Crash and reboot after second time gcode preview. modified: Marlin/Configuration.h modified: Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp modified: Marlin/src/lcd/e3v2/proui/dwin.cpp renamed: Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp -> Marlin/src/lcd/e3v2/proui/gcode_preview.cpp modified: Marlin/src/lcd/e3v2/proui/gcode_preview.h deleted: Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h modified: configurations/Andrew427/Configuration.h modified: configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h modified: configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h modified: configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h modified: configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h modified: configurations/Creality Ender/BLT/Configuration.h modified: configurations/Creality Ender/Default-NP/Configuration.h modified: configurations/Creality Ender/MM/Configuration.h modified: configurations/Creality Ender/UBL/Configuration.h modified: configurations/Voxelab Aquila 427/BLT/Configuration.h modified: configurations/Voxelab Aquila 427/Default-NP/Configuration.h modified: configurations/Voxelab Aquila 427/MM/Configuration.h modified: configurations/Voxelab Aquila 427/UBL/Configuration.h modified: configurations/Voxelab Aquila/BLT/Configuration.h modified: configurations/Voxelab Aquila/BLT/ConfigurationPro.h modified: configurations/Voxelab Aquila/Default-NP/Configuration.h modified: configurations/Voxelab Aquila/MM/Configuration.h modified: configurations/Voxelab Aquila/UBL/Configuration.h modified: configurations/Voxelab Aquila/UBL/ConfigurationPro.h modified: configurations/Voxelab Aquila/X3/Configuration.h --- Marlin/Configuration.h | 2 - Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 75 +++++--------- ...de_preview_nopro.cpp => gcode_preview.cpp} | 99 ++++++++++--------- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 39 +++++--- .../src/lcd/e3v2/proui/gcode_preview_nopro.h | 41 -------- configurations/Andrew427/Configuration.h | 2 - .../BTT-SKR_Mini_E3_V2/ConfigurationMM.h | 2 - .../BTT-SKR_Mini_E3_V2/ConfigurationUBL.h | 2 - .../BTT-SKR_Mini_E3_V3/ConfigurationMM.h | 2 - .../BTT-SKR_Mini_E3_V3/ConfigurationUBL.h | 2 - .../Creality Ender/BLT/Configuration.h | 2 - .../Creality Ender/Default-NP/Configuration.h | 2 - .../Creality Ender/MM/Configuration.h | 2 - .../Creality Ender/UBL/Configuration.h | 2 - .../Voxelab Aquila 427/BLT/Configuration.h | 2 - .../Default-NP/Configuration.h | 2 - .../Voxelab Aquila 427/MM/Configuration.h | 2 - .../Voxelab Aquila 427/UBL/Configuration.h | 2 - .../Voxelab Aquila/BLT/Configuration.h | 2 - .../Voxelab Aquila/BLT/ConfigurationPro.h | 2 - .../Voxelab Aquila/Default-NP/Configuration.h | 2 - .../Voxelab Aquila/MM/Configuration.h | 2 - .../Voxelab Aquila/UBL/Configuration.h | 2 - .../Voxelab Aquila/UBL/ConfigurationPro.h | 2 - .../Voxelab Aquila/X3/Configuration.h | 2 - 26 files changed, 101 insertions(+), 199 deletions(-) rename Marlin/src/lcd/e3v2/proui/{gcode_preview_nopro.cpp => gcode_preview.cpp} (60%) delete mode 100644 Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1c5b6e9c30..68dcd123c9 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp index 57a06f4138..8cf7c77cd0 100644 --- a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp +++ b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp @@ -84,7 +84,7 @@ void C108() { } // Enable or disable preview screen -#if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO +#if HAS_GCODE_PREVIEW void C250() { if (parser.seenval('P')) { HMI_data.EnablePreview = !!parser.value_byte(); @@ -120,7 +120,7 @@ void custom_gcode(const int16_t codenum) { case 35: C35(); break; // Launch bed tramming wizard #endif case 108: C108(); break; // Cancel a Wait for User without an Emergecy Parser - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW case 250: C250(); break; // Enable or disable preview screen #endif #if HAS_LOCKSCREEN diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 04558a1e90..bdbdba0874 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -99,8 +99,6 @@ #if HAS_GCODE_PREVIEW #include "file_header.h" #include "gcode_preview.h" -#elif HAS_GCODE_PREVIEW_NOPRO - #include "gcode_preview_nopro.h" #endif #if HAS_TOOLBAR @@ -123,10 +121,6 @@ #include "lockscreen.h" #endif -#if HAS_SOUND - #include "../../../libs/buzzer.h" -#endif - //#define DEBUG_OUT ENABLED(DEBUG_DWIN) #include "../../../core/debug_out.h" @@ -630,12 +624,6 @@ void Draw_PrintDone() { DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); #if HAS_GCODE_PREVIEW - const bool haspreview = Preview_Valid(); - if (haspreview) { - Preview_Show(); - DWINUI::Draw_Button(BTN_Continue, 86, 295, true); - } - #elif HAS_GCODE_PREVIEW_NOPRO const bool haspreview = preview.valid(); if (haspreview) { preview.show(); @@ -768,7 +756,7 @@ void _draw_feedrate() { DWINUI::Draw_String(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, F(" %")); } else { - _value = CEIL(MMS_SCALED(feedrate_mm_s)); + _value = CEIL(feedrate_mm_s * feedrate_percentage / 100); DWIN_Draw_Box(1, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, 30, 20); } DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 116 + 2 * STAT_CHR_W, 384, _value); @@ -802,8 +790,8 @@ void _draw_xyz_position(const bool force) { } void update_variable() { - TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 6 * DWINUI::fontWidth(), 6, checkkey);) - TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 3 * DWINUI::fontWidth(), 6, last_checkkey);) + TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-6*DWINUI::fontWidth(), 6, checkkey);) + TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-3*DWINUI::fontWidth(), 6, last_checkkey);) _draw_xyz_position(false); @@ -1260,6 +1248,8 @@ void HMI_Printing() { DWIN_UpdateLCD(); } +#include "../../../libs/buzzer.h" + void Draw_Main_Area() { switch (checkkey) { case MainMenu: Draw_Main_Menu(); break; @@ -1582,7 +1572,7 @@ void DWIN_HomingStart() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); Title.ShowCaption(GET_TEXT_F(MSG_HOMING)); - DWIN_Show_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + DWIN_Show_Popup(ICON_Printer_0, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); } void DWIN_HomingDone() { @@ -1843,18 +1833,13 @@ void DWIN_LevelingDone() { // Started a Print Job void DWIN_Print_Started() { DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); - TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) { Preview_Invalidate(); }) - TERN_(HAS_GCODE_PREVIEW_NOPRO, if (Host_Printing()) { preview.invalidate(); }) + TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) { preview.invalidate(); }) ui.progress_reset(); ui.reset_remaining_time(); HMI_flag.pause_flag = false; HMI_flag.abort_flag = false; select_print.reset(); - #if PROUI_EX - if (!fileprop.isConfig) { Goto_PrintProcess(); } - #else - Goto_PrintProcess(); - #endif + Goto_PrintProcess(); } // Pause a print job @@ -1876,12 +1861,7 @@ void DWIN_Print_Finished() { HMI_flag.abort_flag = false; HMI_flag.pause_flag = false; wait_for_heatup = false; - #if PROUI_EX - if (!fileprop.isConfig) { Goto_PrintDone(); } - else { fileprop.isConfig = false; } - #else - Goto_PrintDone(); - #endif + Goto_PrintDone(); } // Print was aborted @@ -1909,7 +1889,7 @@ void DWIN_Print_Aborted() { DWIN_Print_Finished(); } -#if (ALT_COLOR_MENU == 1) // 1 = Alternate Aquila +#if (ALT_COLOR_MENU == 1) void DWIN_SetColorDefaults() { HMI_data.Background_Color = Def_Background_Color; HMI_data.Cursor_Color = Def_Cursor_Color; @@ -1931,7 +1911,7 @@ void DWIN_Print_Aborted() { HMI_data.Coordinate_Color = Def_Coordinate_Color; HMI_data.Bottom_Color = Def_Bottom_Color; } -#elif (ALT_COLOR_MENU == 2) // 2 = Ender3V2 Default +#elif (ALT_COLOR_MENU == 2) void DWIN_SetColorDefaults() { #undef Def_Background_Color #undef Def_Text_Color @@ -1959,7 +1939,7 @@ void DWIN_Print_Aborted() { HMI_data.Coordinate_Color = Color_White; HMI_data.Bottom_Color = RGB( 0, 23, 16); } -#else // 0 = Voxelab Default +#else void DWIN_SetColorDefaults() { HMI_data.Background_Color = Def_Background_Color; HMI_data.Cursor_Color = Def_Text_Color; @@ -2039,7 +2019,7 @@ void DWIN_SetDataDefaults() { #endif #endif TERN_(ADAPTIVE_STEP_SMOOTHING, HMI_data.AdaptiveStepSmoothing = true;) - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW HMI_data.EnablePreview = true; #endif #if PROUI_EX @@ -2164,7 +2144,7 @@ void MarlinUI::refresh() { /* Nothing to see here */ } #endif void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { - DWIN_Draw_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + DWIN_Draw_Popup(ICON_Printer_0, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, GET_TEXT_F(MSG_TURN_OFF)); DWIN_UpdateLCD(); } @@ -2279,7 +2259,7 @@ void DWIN_RedrawScreen() { #endif // HAS_LOCKSCREEN -#if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO +#if HAS_GCODE_PREVIEW void SetPreview() { Toggle_Chkb_Line(HMI_data.EnablePreview); } @@ -2297,14 +2277,6 @@ void DWIN_RedrawScreen() { #endif void Goto_ConfirmToPrint() { - #if PROUI_EX - fileprop.clear(); - fileprop.setname(card.filename); - card.openFileRead(fileprop.name, 100); - getFileHeader(); - card.closefile(); - if (fileprop.isConfig) return card.openAndPrintFile(card.filename); - #endif #if ENABLED(CV_LASER_MODULE) if (fileprop.isLaser) { if (laser_device.is_laser_device()) @@ -2316,8 +2288,6 @@ void Goto_ConfirmToPrint() { LaserOn(false); // If it is not laser file turn off laser mode #endif #if HAS_GCODE_PREVIEW - if (HMI_data.EnablePreview) return Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); - #elif HAS_GCODE_PREVIEW_NOPRO if (HMI_data.EnablePreview) return Goto_Popup(preview.drawFromSD, onClick_ConfirmToPrint); #endif card.openAndPrintFile(card.filename); // Direct print SD file @@ -2608,8 +2578,7 @@ void ApplyMove() { #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - void ApplyTimer() { ui.backlight_timeout_minutes = MenuData.Value; } - void SetTimer() { SetIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max, ui.backlight_timeout_minutes, ApplyTimer); } + void SetTimer() { SetPIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max); } #endif #if PROUI_EX && ENABLED(NOZZLE_PARK_FEATURE) @@ -3104,7 +3073,7 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { #if HAS_BED_PROBE && ENABLED(TRAMWIZ_MENU_ITEM) // Trammingwizard Popup - void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), F("Start Tramming Wizard?")); } + void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(ICON_Printer_0, F("Start Tramming Wizard?")); } void onClick_StartTramwiz() { if (HMI_flag.select_flag) { if (HMI_data.FullManualTramming) { @@ -3490,7 +3459,7 @@ void Draw_Tune_Menu() { EDIT_ITEM(ICON_MaxAccelerated, MSG_ADVANCE_K, onDrawPFloat3Menu, SetLA_K, &planner.extruder_advance_K[0]); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); @@ -4505,7 +4474,7 @@ void Draw_AdvancedSettings_Menu() { EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); #endif #if BED_SCREW_INSET EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos); @@ -4520,7 +4489,7 @@ void Draw_AdvancedSettings_Menu() { EDIT_ITEM(ICON_Sound, MSG_TICK, onDrawChkbMenu, SetEnableTick, &ui.tick_on); EDIT_ITEM(ICON_Sound, MSG_SOUND, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW EDIT_ITEM(ICON_File, MSG_HAS_PREVIEW, onDrawChkbMenu, SetPreview, &HMI_data.EnablePreview); #endif #if ENABLED(BAUD_RATE_GCODE) @@ -4560,7 +4529,7 @@ void Draw_Advanced_Menu() { // From Control_Menu (Control) || Default-NP Advance EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); #endif #if BED_SCREW_INSET EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos); @@ -4575,7 +4544,7 @@ void Draw_Advanced_Menu() { // From Control_Menu (Control) || Default-NP Advance EDIT_ITEM(ICON_Sound, MSG_TICK, onDrawChkbMenu, SetEnableTick, &ui.tick_on); EDIT_ITEM(ICON_Sound, MSG_SOUND, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW EDIT_ITEM(ICON_File, MSG_HAS_PREVIEW, onDrawChkbMenu, SetPreview, &HMI_data.EnablePreview); #endif #if ENABLED(BAUD_RATE_GCODE) diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp similarity index 60% rename from Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp rename to Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 5e78053c79..4015d88bd7 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -29,14 +29,13 @@ #include "../../../inc/MarlinConfigPre.h" -#if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW_NOPRO) +#if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW) -#include "gcode_preview_nopro.h" +#include "gcode_preview.h" #include "../../../core/types.h" #include "../../marlinui.h" #include "../../../sd/cardreader.h" -#include "../../../MarlinCore.h" // for wait_for_user #include "dwin.h" #include "dwin_popup.h" #include "base64.h" @@ -75,7 +74,7 @@ typedef struct { } fileprop_t; -fileprop_t fileprop; +fileprop_t fileprop_nopro; void getValue(const char * const buf, PGM_P const key, float &value) { if (value != 0.0f) return; @@ -102,34 +101,34 @@ bool Preview::hasPreview() { uint32_t indx = 0; float tmp = 0; - fileprop.clear(); - fileprop.setname(card.filename); + fileprop_nopro.clear(); + fileprop_nopro.setname(card.filename); - card.openFileRead(fileprop.name); + card.openFileRead(fileprop_nopro.name); char buf[256]; uint8_t nbyte = 1; - while (!fileprop.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { + while (!fileprop_nopro.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { nbyte = card.read(buf, sizeof(buf) - 1); if (nbyte > 0) { buf[nbyte] = '\0'; - getValue(buf, PSTR(";TIME:"), fileprop.time); - getValue(buf, PSTR(";Filament used:"), fileprop.filament); - getValue(buf, PSTR(";Layer height:"), fileprop.layer); + getValue(buf, PSTR(";TIME:"), fileprop_nopro.time); + getValue(buf, PSTR(";Filament used:"), fileprop_nopro.filament); + getValue(buf, PSTR(";Layer height:"), fileprop_nopro.layer); getValue(buf, PSTR(";MINX:"), tmp); - getValue(buf, PSTR(";MAXX:"), fileprop.width); - fileprop.width -= tmp; + getValue(buf, PSTR(";MAXX:"), fileprop_nopro.width); + fileprop_nopro.width -= tmp; tmp = 0; getValue(buf, PSTR(";MINY:"), tmp); - getValue(buf, PSTR(";MAXY:"), fileprop.length); - fileprop.length -= tmp; + getValue(buf, PSTR(";MAXY:"), fileprop_nopro.length); + fileprop_nopro.length -= tmp; tmp = 0; getValue(buf, PSTR(";MINZ:"), tmp); - getValue(buf, PSTR(";MAXZ:"), fileprop.height); - fileprop.height -= tmp; + getValue(buf, PSTR(";MAXZ:"), fileprop_nopro.height); + fileprop_nopro.height -= tmp; posptr = strstr_P(buf, tbstart); if (posptr != nullptr) { - fileprop.thumbstart = indx + (posptr - &buf[0]); + fileprop_nopro.thumbstart = indx + (posptr - &buf[0]); } else { indx += _MAX(10, nbyte - (signed)strlen_P(tbstart)); @@ -138,31 +137,31 @@ bool Preview::hasPreview() { } } - if (!fileprop.thumbstart) { + if (!fileprop_nopro.thumbstart) { card.closefile(); LCD_MESSAGE_F("Thumbnail not found"); return false; } // Get the size of the thumbnail - card.setIndex(fileprop.thumbstart + strlen_P(tbstart)); + card.setIndex(fileprop_nopro.thumbstart + strlen_P(tbstart)); for (uint8_t i = 0; i < 16; i++) { const char c = card.get(); if (ISEOL(c)) { buf[i] = '\0'; break; } buf[i] = c; } - fileprop.thumbsize = atoi(buf); + fileprop_nopro.thumbsize = atoi(buf); // Exit if there isn't a thumbnail - if (!fileprop.thumbsize) { + if (!fileprop_nopro.thumbsize) { card.closefile(); LCD_MESSAGE_F("Invalid Thumbnail Size"); return false; } - uint8_t buf64[fileprop.thumbsize + 1]; + uint8_t buf64[fileprop_nopro.thumbsize + 1]; uint16_t nread = 0; - while (nread < fileprop.thumbsize) { + while (nread < fileprop_nopro.thumbsize) { const uint8_t c = card.get(); if (!ISEOL(c) && c != ';' && c != ' ') buf64[nread++] = c; @@ -170,59 +169,63 @@ bool Preview::hasPreview() { card.closefile(); buf64[nread] = '\0'; - uint8_t thumbdata[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail - fileprop.thumbsize = decode_base64(buf64, thumbdata); - DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, thumbdata); + uint8_t thumbdata[3 + 3 * (fileprop_nopro.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + fileprop_nopro.thumbsize = decode_base64(buf64, thumbdata); + DWINUI::WriteToSRAM(0x00, fileprop_nopro.thumbsize, thumbdata); - fileprop.thumbwidth = THUMBWIDTH; - fileprop.thumbheight = THUMBHEIGHT; + fileprop_nopro.thumbwidth = THUMBWIDTH; + fileprop_nopro.thumbheight = THUMBHEIGHT; return true; } void Preview::drawFromSD() { - if (!hasPreview()) { - HMI_flag.select_flag = 1; - wait_for_user = false; - return; - } + hasPreview(); MString<45> buf; DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 0, DWIN_WIDTH, STATUS_Y - 1); - if (fileprop.time) { - buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); + if (fileprop_nopro.time) { + buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop_nopro.time / 3600, ((uint16_t)fileprop_nopro.time % 3600) / 60); DWINUI::Draw_String(20, 10, &buf); } - if (fileprop.filament) { - buf.set(F("Filament used: "), p_float_t(fileprop.filament, 2), F(" m")); + if (fileprop_nopro.filament) { + buf.set(F("Filament used: "), p_float_t(fileprop_nopro.filament, 2), F(" m")); DWINUI::Draw_String(20, 30, &buf); } - if (fileprop.layer) { - buf.set(F("Layer height: "), p_float_t(fileprop.layer, 2), F(" mm")); + if (fileprop_nopro.layer) { + buf.set(F("Layer height: "), p_float_t(fileprop_nopro.layer, 2), F(" mm")); DWINUI::Draw_String(20, 50, &buf); } - if (fileprop.width) { - buf.set(F("Volume: "), p_float_t(fileprop.width, 1), 'x', p_float_t(fileprop.length, 1), 'x', p_float_t(fileprop.height, 1), F(" mm")); + if (fileprop_nopro.width) { + buf.set(F("Volume: "), p_float_t(fileprop_nopro.width, 1), 'x', p_float_t(fileprop_nopro.length, 1), 'x', p_float_t(fileprop_nopro.height, 1), F(" mm")); DWINUI::Draw_String(20, 70, &buf); } + + if (!fileprop_nopro.thumbsize) { + const uint8_t xpos = ((DWIN_WIDTH) / 2) - 55, // 55 = iconW/2 + ypos = ((DWIN_HEIGHT) / 2) - 125; + DWINUI::Draw_Icon(ICON_Info_0, xpos, ypos); + buf.set(PSTR("No " STRINGIFY(THUMBWIDTH) "x" STRINGIFY(THUMBHEIGHT) " Thumbnail")); + DWINUI::Draw_CenteredString(false, (DWINUI::fontid*3), DWINUI::textcolor, DWINUI::backcolor, 0, DWIN_WIDTH, (DWIN_HEIGHT / 2), &buf); + } DWINUI::Draw_Button(BTN_Print, 26, 290); DWINUI::Draw_Button(BTN_Cancel, 146, 290); - show(); - Draw_Select_Highlight(true, 290); + if (fileprop_nopro.thumbsize) show(); + Draw_Select_Highlight(false, 290); DWIN_UpdateLCD(); } void Preview::invalidate() { - fileprop.thumbsize = 0; + fileprop_nopro.thumbsize = 0; } bool Preview::valid() { - return !!fileprop.thumbsize; + return !!fileprop_nopro.thumbsize; } void Preview::show() { - const uint8_t xpos = ((DWIN_WIDTH) - fileprop.thumbwidth) / 2, - ypos = (205 - fileprop.thumbheight) / 2 + 87; + const uint8_t xpos = ((DWIN_WIDTH) - fileprop_nopro.thumbwidth) / 2, + ypos = (205 - fileprop_nopro.thumbheight) / 2 + 87; DWIN_ICON_Show(xpos, ypos, 0x00); } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index 5de4f953f6..9146642447 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -1,12 +1,13 @@ /** - * DWIN G-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.5.3 - * Date: 2023/04/25 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,15 +15,27 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For commercial applications additional licenses can be requested */ - #pragma once -void Preview_DrawFromSD(); -void Preview_Invalidate(); -bool Preview_Valid(); -void Preview_Show(); +/** + * DWIN G-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 3.1.2 + * Date: 2022/09/03 + */ + +class Preview { +public: + static void drawFromSD(); + static void invalidate(); + static bool valid(); + static void show(); +private: + static bool hasPreview(); +}; + +extern Preview preview; diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h b/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h deleted file mode 100644 index 9146642447..0000000000 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * DWIN G-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.1.2 - * Date: 2022/09/03 - */ - -class Preview { -public: - static void drawFromSD(); - static void invalidate(); - static bool valid(); - static void show(); -private: - static bool hasPreview(); -}; - -extern Preview preview; diff --git a/configurations/Andrew427/Configuration.h b/configurations/Andrew427/Configuration.h index d85e24ceef..1402346caf 100644 --- a/configurations/Andrew427/Configuration.h +++ b/configurations/Andrew427/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h index ecdb7b87ca..55265ea706 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h index 749a43724f..0c8c80f49d 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h index ce179a7ea6..164f4512ac 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h index 1453608d27..cc04082be9 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/BLT/Configuration.h b/configurations/Creality Ender/BLT/Configuration.h index 40c2e889d9..45e900a075 100644 --- a/configurations/Creality Ender/BLT/Configuration.h +++ b/configurations/Creality Ender/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/Default-NP/Configuration.h b/configurations/Creality Ender/Default-NP/Configuration.h index 7257e1ac53..dd46fac988 100644 --- a/configurations/Creality Ender/Default-NP/Configuration.h +++ b/configurations/Creality Ender/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/MM/Configuration.h b/configurations/Creality Ender/MM/Configuration.h index 05574457b3..e9d1255f2b 100644 --- a/configurations/Creality Ender/MM/Configuration.h +++ b/configurations/Creality Ender/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/UBL/Configuration.h b/configurations/Creality Ender/UBL/Configuration.h index 204d8fa8e6..e07b6be190 100644 --- a/configurations/Creality Ender/UBL/Configuration.h +++ b/configurations/Creality Ender/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/BLT/Configuration.h b/configurations/Voxelab Aquila 427/BLT/Configuration.h index 7ad202ff7c..482cfa173c 100644 --- a/configurations/Voxelab Aquila 427/BLT/Configuration.h +++ b/configurations/Voxelab Aquila 427/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h index d2ba1696f2..1703b2bc9a 100644 --- a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/MM/Configuration.h b/configurations/Voxelab Aquila 427/MM/Configuration.h index 12d667de7a..cd3a2afd73 100644 --- a/configurations/Voxelab Aquila 427/MM/Configuration.h +++ b/configurations/Voxelab Aquila 427/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/UBL/Configuration.h b/configurations/Voxelab Aquila 427/UBL/Configuration.h index 3f43ef6d17..7923147524 100644 --- a/configurations/Voxelab Aquila 427/UBL/Configuration.h +++ b/configurations/Voxelab Aquila 427/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/Configuration.h b/configurations/Voxelab Aquila/BLT/Configuration.h index 5d043c78ba..a37b9c2179 100644 --- a/configurations/Voxelab Aquila/BLT/Configuration.h +++ b/configurations/Voxelab Aquila/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h index 1c5b6e9c30..68dcd123c9 100644 --- a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/Default-NP/Configuration.h b/configurations/Voxelab Aquila/Default-NP/Configuration.h index 070c5fe551..04af06fcb1 100644 --- a/configurations/Voxelab Aquila/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/MM/Configuration.h b/configurations/Voxelab Aquila/MM/Configuration.h index e84690fdcd..dd12545907 100644 --- a/configurations/Voxelab Aquila/MM/Configuration.h +++ b/configurations/Voxelab Aquila/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/Configuration.h b/configurations/Voxelab Aquila/UBL/Configuration.h index def8a221d5..1921022260 100644 --- a/configurations/Voxelab Aquila/UBL/Configuration.h +++ b/configurations/Voxelab Aquila/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h index f1994611b7..da25fcf328 100644 --- a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/X3/Configuration.h b/configurations/Voxelab Aquila/X3/Configuration.h index c4ab277c42..4b8bd46d59 100644 --- a/configurations/Voxelab Aquila/X3/Configuration.h +++ b/configurations/Voxelab Aquila/X3/Configuration.h @@ -3421,8 +3421,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) From 7989e213e6958cff348c6c311540de8158316243 Mon Sep 17 00:00:00 2001 From: Nazar78 Date: Tue, 31 Oct 2023 03:28:18 +0800 Subject: [PATCH 2/5] Fixed [BUG] Crash and reboot after second time gcode preview. modified: Marlin/Configuration.h modified: Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp modified: Marlin/src/lcd/e3v2/proui/dwin.cpp renamed: Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp -> Marlin/src/lcd/e3v2/proui/gcode_preview.cpp modified: Marlin/src/lcd/e3v2/proui/gcode_preview.h deleted: Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h modified: configurations/Andrew427/Configuration.h modified: configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h modified: configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h modified: configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h modified: configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h modified: configurations/Creality Ender/BLT/Configuration.h modified: configurations/Creality Ender/Default-NP/Configuration.h modified: configurations/Creality Ender/MM/Configuration.h modified: configurations/Creality Ender/UBL/Configuration.h modified: configurations/Voxelab Aquila 427/BLT/Configuration.h modified: configurations/Voxelab Aquila 427/Default-NP/Configuration.h modified: configurations/Voxelab Aquila 427/MM/Configuration.h modified: configurations/Voxelab Aquila 427/UBL/Configuration.h modified: configurations/Voxelab Aquila/BLT/Configuration.h modified: configurations/Voxelab Aquila/BLT/ConfigurationPro.h modified: configurations/Voxelab Aquila/Default-NP/Configuration.h modified: configurations/Voxelab Aquila/MM/Configuration.h modified: configurations/Voxelab Aquila/UBL/Configuration.h modified: configurations/Voxelab Aquila/UBL/ConfigurationPro.h modified: configurations/Voxelab Aquila/X3/Configuration.h --- Marlin/Configuration.h | 2 - Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 27 ++--- ...de_preview_nopro.cpp => gcode_preview.cpp} | 99 ++++++++++--------- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 39 +++++--- .../src/lcd/e3v2/proui/gcode_preview_nopro.h | 41 -------- configurations/Andrew427/Configuration.h | 2 - .../BTT-SKR_Mini_E3_V2/ConfigurationMM.h | 2 - .../BTT-SKR_Mini_E3_V2/ConfigurationUBL.h | 2 - .../BTT-SKR_Mini_E3_V3/ConfigurationMM.h | 2 - .../BTT-SKR_Mini_E3_V3/ConfigurationUBL.h | 2 - .../Creality Ender/BLT/Configuration.h | 2 - .../Creality Ender/Default-NP/Configuration.h | 2 - .../Creality Ender/MM/Configuration.h | 2 - .../Creality Ender/UBL/Configuration.h | 2 - .../Voxelab Aquila 427/BLT/Configuration.h | 2 - .../Default-NP/Configuration.h | 2 - .../Voxelab Aquila 427/MM/Configuration.h | 2 - .../Voxelab Aquila 427/UBL/Configuration.h | 2 - .../Voxelab Aquila/BLT/Configuration.h | 2 - .../Voxelab Aquila/BLT/ConfigurationPro.h | 2 - .../Voxelab Aquila/Default-NP/Configuration.h | 2 - .../Voxelab Aquila/MM/Configuration.h | 2 - .../Voxelab Aquila/UBL/Configuration.h | 2 - .../Voxelab Aquila/UBL/ConfigurationPro.h | 2 - .../Voxelab Aquila/X3/Configuration.h | 2 - 26 files changed, 87 insertions(+), 165 deletions(-) rename Marlin/src/lcd/e3v2/proui/{gcode_preview_nopro.cpp => gcode_preview.cpp} (60%) delete mode 100644 Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1c5b6e9c30..68dcd123c9 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp index 57a06f4138..8cf7c77cd0 100644 --- a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp +++ b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp @@ -84,7 +84,7 @@ void C108() { } // Enable or disable preview screen -#if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO +#if HAS_GCODE_PREVIEW void C250() { if (parser.seenval('P')) { HMI_data.EnablePreview = !!parser.value_byte(); @@ -120,7 +120,7 @@ void custom_gcode(const int16_t codenum) { case 35: C35(); break; // Launch bed tramming wizard #endif case 108: C108(); break; // Cancel a Wait for User without an Emergecy Parser - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW case 250: C250(); break; // Enable or disable preview screen #endif #if HAS_LOCKSCREEN diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 04558a1e90..a37240e970 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -99,8 +99,6 @@ #if HAS_GCODE_PREVIEW #include "file_header.h" #include "gcode_preview.h" -#elif HAS_GCODE_PREVIEW_NOPRO - #include "gcode_preview_nopro.h" #endif #if HAS_TOOLBAR @@ -630,12 +628,6 @@ void Draw_PrintDone() { DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); #if HAS_GCODE_PREVIEW - const bool haspreview = Preview_Valid(); - if (haspreview) { - Preview_Show(); - DWINUI::Draw_Button(BTN_Continue, 86, 295, true); - } - #elif HAS_GCODE_PREVIEW_NOPRO const bool haspreview = preview.valid(); if (haspreview) { preview.show(); @@ -1843,14 +1835,13 @@ void DWIN_LevelingDone() { // Started a Print Job void DWIN_Print_Started() { DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); - TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) { Preview_Invalidate(); }) - TERN_(HAS_GCODE_PREVIEW_NOPRO, if (Host_Printing()) { preview.invalidate(); }) + TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) { preview.invalidate(); }) ui.progress_reset(); ui.reset_remaining_time(); HMI_flag.pause_flag = false; HMI_flag.abort_flag = false; select_print.reset(); - #if PROUI_EX + #if PROUI_EX && HAS_GCODE_PREVIEW if (!fileprop.isConfig) { Goto_PrintProcess(); } #else Goto_PrintProcess(); @@ -1876,7 +1867,7 @@ void DWIN_Print_Finished() { HMI_flag.abort_flag = false; HMI_flag.pause_flag = false; wait_for_heatup = false; - #if PROUI_EX + #if PROUI_EX && HAS_GCODE_PREVIEW if (!fileprop.isConfig) { Goto_PrintDone(); } else { fileprop.isConfig = false; } #else @@ -2039,7 +2030,7 @@ void DWIN_SetDataDefaults() { #endif #endif TERN_(ADAPTIVE_STEP_SMOOTHING, HMI_data.AdaptiveStepSmoothing = true;) - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW HMI_data.EnablePreview = true; #endif #if PROUI_EX @@ -2279,7 +2270,7 @@ void DWIN_RedrawScreen() { #endif // HAS_LOCKSCREEN -#if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO +#if HAS_GCODE_PREVIEW void SetPreview() { Toggle_Chkb_Line(HMI_data.EnablePreview); } @@ -2297,7 +2288,7 @@ void DWIN_RedrawScreen() { #endif void Goto_ConfirmToPrint() { - #if PROUI_EX + #if PROUI_EX && HAS_GCODE_PREVIEW fileprop.clear(); fileprop.setname(card.filename); card.openFileRead(fileprop.name, 100); @@ -2316,8 +2307,6 @@ void Goto_ConfirmToPrint() { LaserOn(false); // If it is not laser file turn off laser mode #endif #if HAS_GCODE_PREVIEW - if (HMI_data.EnablePreview) return Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); - #elif HAS_GCODE_PREVIEW_NOPRO if (HMI_data.EnablePreview) return Goto_Popup(preview.drawFromSD, onClick_ConfirmToPrint); #endif card.openAndPrintFile(card.filename); // Direct print SD file @@ -4520,7 +4509,7 @@ void Draw_AdvancedSettings_Menu() { EDIT_ITEM(ICON_Sound, MSG_TICK, onDrawChkbMenu, SetEnableTick, &ui.tick_on); EDIT_ITEM(ICON_Sound, MSG_SOUND, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW EDIT_ITEM(ICON_File, MSG_HAS_PREVIEW, onDrawChkbMenu, SetPreview, &HMI_data.EnablePreview); #endif #if ENABLED(BAUD_RATE_GCODE) @@ -4575,7 +4564,7 @@ void Draw_Advanced_Menu() { // From Control_Menu (Control) || Default-NP Advance EDIT_ITEM(ICON_Sound, MSG_TICK, onDrawChkbMenu, SetEnableTick, &ui.tick_on); EDIT_ITEM(ICON_Sound, MSG_SOUND, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif - #if HAS_GCODE_PREVIEW || HAS_GCODE_PREVIEW_NOPRO + #if HAS_GCODE_PREVIEW EDIT_ITEM(ICON_File, MSG_HAS_PREVIEW, onDrawChkbMenu, SetPreview, &HMI_data.EnablePreview); #endif #if ENABLED(BAUD_RATE_GCODE) diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp similarity index 60% rename from Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp rename to Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 5e78053c79..4015d88bd7 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -29,14 +29,13 @@ #include "../../../inc/MarlinConfigPre.h" -#if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW_NOPRO) +#if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW) -#include "gcode_preview_nopro.h" +#include "gcode_preview.h" #include "../../../core/types.h" #include "../../marlinui.h" #include "../../../sd/cardreader.h" -#include "../../../MarlinCore.h" // for wait_for_user #include "dwin.h" #include "dwin_popup.h" #include "base64.h" @@ -75,7 +74,7 @@ typedef struct { } fileprop_t; -fileprop_t fileprop; +fileprop_t fileprop_nopro; void getValue(const char * const buf, PGM_P const key, float &value) { if (value != 0.0f) return; @@ -102,34 +101,34 @@ bool Preview::hasPreview() { uint32_t indx = 0; float tmp = 0; - fileprop.clear(); - fileprop.setname(card.filename); + fileprop_nopro.clear(); + fileprop_nopro.setname(card.filename); - card.openFileRead(fileprop.name); + card.openFileRead(fileprop_nopro.name); char buf[256]; uint8_t nbyte = 1; - while (!fileprop.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { + while (!fileprop_nopro.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { nbyte = card.read(buf, sizeof(buf) - 1); if (nbyte > 0) { buf[nbyte] = '\0'; - getValue(buf, PSTR(";TIME:"), fileprop.time); - getValue(buf, PSTR(";Filament used:"), fileprop.filament); - getValue(buf, PSTR(";Layer height:"), fileprop.layer); + getValue(buf, PSTR(";TIME:"), fileprop_nopro.time); + getValue(buf, PSTR(";Filament used:"), fileprop_nopro.filament); + getValue(buf, PSTR(";Layer height:"), fileprop_nopro.layer); getValue(buf, PSTR(";MINX:"), tmp); - getValue(buf, PSTR(";MAXX:"), fileprop.width); - fileprop.width -= tmp; + getValue(buf, PSTR(";MAXX:"), fileprop_nopro.width); + fileprop_nopro.width -= tmp; tmp = 0; getValue(buf, PSTR(";MINY:"), tmp); - getValue(buf, PSTR(";MAXY:"), fileprop.length); - fileprop.length -= tmp; + getValue(buf, PSTR(";MAXY:"), fileprop_nopro.length); + fileprop_nopro.length -= tmp; tmp = 0; getValue(buf, PSTR(";MINZ:"), tmp); - getValue(buf, PSTR(";MAXZ:"), fileprop.height); - fileprop.height -= tmp; + getValue(buf, PSTR(";MAXZ:"), fileprop_nopro.height); + fileprop_nopro.height -= tmp; posptr = strstr_P(buf, tbstart); if (posptr != nullptr) { - fileprop.thumbstart = indx + (posptr - &buf[0]); + fileprop_nopro.thumbstart = indx + (posptr - &buf[0]); } else { indx += _MAX(10, nbyte - (signed)strlen_P(tbstart)); @@ -138,31 +137,31 @@ bool Preview::hasPreview() { } } - if (!fileprop.thumbstart) { + if (!fileprop_nopro.thumbstart) { card.closefile(); LCD_MESSAGE_F("Thumbnail not found"); return false; } // Get the size of the thumbnail - card.setIndex(fileprop.thumbstart + strlen_P(tbstart)); + card.setIndex(fileprop_nopro.thumbstart + strlen_P(tbstart)); for (uint8_t i = 0; i < 16; i++) { const char c = card.get(); if (ISEOL(c)) { buf[i] = '\0'; break; } buf[i] = c; } - fileprop.thumbsize = atoi(buf); + fileprop_nopro.thumbsize = atoi(buf); // Exit if there isn't a thumbnail - if (!fileprop.thumbsize) { + if (!fileprop_nopro.thumbsize) { card.closefile(); LCD_MESSAGE_F("Invalid Thumbnail Size"); return false; } - uint8_t buf64[fileprop.thumbsize + 1]; + uint8_t buf64[fileprop_nopro.thumbsize + 1]; uint16_t nread = 0; - while (nread < fileprop.thumbsize) { + while (nread < fileprop_nopro.thumbsize) { const uint8_t c = card.get(); if (!ISEOL(c) && c != ';' && c != ' ') buf64[nread++] = c; @@ -170,59 +169,63 @@ bool Preview::hasPreview() { card.closefile(); buf64[nread] = '\0'; - uint8_t thumbdata[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail - fileprop.thumbsize = decode_base64(buf64, thumbdata); - DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, thumbdata); + uint8_t thumbdata[3 + 3 * (fileprop_nopro.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + fileprop_nopro.thumbsize = decode_base64(buf64, thumbdata); + DWINUI::WriteToSRAM(0x00, fileprop_nopro.thumbsize, thumbdata); - fileprop.thumbwidth = THUMBWIDTH; - fileprop.thumbheight = THUMBHEIGHT; + fileprop_nopro.thumbwidth = THUMBWIDTH; + fileprop_nopro.thumbheight = THUMBHEIGHT; return true; } void Preview::drawFromSD() { - if (!hasPreview()) { - HMI_flag.select_flag = 1; - wait_for_user = false; - return; - } + hasPreview(); MString<45> buf; DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 0, DWIN_WIDTH, STATUS_Y - 1); - if (fileprop.time) { - buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); + if (fileprop_nopro.time) { + buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop_nopro.time / 3600, ((uint16_t)fileprop_nopro.time % 3600) / 60); DWINUI::Draw_String(20, 10, &buf); } - if (fileprop.filament) { - buf.set(F("Filament used: "), p_float_t(fileprop.filament, 2), F(" m")); + if (fileprop_nopro.filament) { + buf.set(F("Filament used: "), p_float_t(fileprop_nopro.filament, 2), F(" m")); DWINUI::Draw_String(20, 30, &buf); } - if (fileprop.layer) { - buf.set(F("Layer height: "), p_float_t(fileprop.layer, 2), F(" mm")); + if (fileprop_nopro.layer) { + buf.set(F("Layer height: "), p_float_t(fileprop_nopro.layer, 2), F(" mm")); DWINUI::Draw_String(20, 50, &buf); } - if (fileprop.width) { - buf.set(F("Volume: "), p_float_t(fileprop.width, 1), 'x', p_float_t(fileprop.length, 1), 'x', p_float_t(fileprop.height, 1), F(" mm")); + if (fileprop_nopro.width) { + buf.set(F("Volume: "), p_float_t(fileprop_nopro.width, 1), 'x', p_float_t(fileprop_nopro.length, 1), 'x', p_float_t(fileprop_nopro.height, 1), F(" mm")); DWINUI::Draw_String(20, 70, &buf); } + + if (!fileprop_nopro.thumbsize) { + const uint8_t xpos = ((DWIN_WIDTH) / 2) - 55, // 55 = iconW/2 + ypos = ((DWIN_HEIGHT) / 2) - 125; + DWINUI::Draw_Icon(ICON_Info_0, xpos, ypos); + buf.set(PSTR("No " STRINGIFY(THUMBWIDTH) "x" STRINGIFY(THUMBHEIGHT) " Thumbnail")); + DWINUI::Draw_CenteredString(false, (DWINUI::fontid*3), DWINUI::textcolor, DWINUI::backcolor, 0, DWIN_WIDTH, (DWIN_HEIGHT / 2), &buf); + } DWINUI::Draw_Button(BTN_Print, 26, 290); DWINUI::Draw_Button(BTN_Cancel, 146, 290); - show(); - Draw_Select_Highlight(true, 290); + if (fileprop_nopro.thumbsize) show(); + Draw_Select_Highlight(false, 290); DWIN_UpdateLCD(); } void Preview::invalidate() { - fileprop.thumbsize = 0; + fileprop_nopro.thumbsize = 0; } bool Preview::valid() { - return !!fileprop.thumbsize; + return !!fileprop_nopro.thumbsize; } void Preview::show() { - const uint8_t xpos = ((DWIN_WIDTH) - fileprop.thumbwidth) / 2, - ypos = (205 - fileprop.thumbheight) / 2 + 87; + const uint8_t xpos = ((DWIN_WIDTH) - fileprop_nopro.thumbwidth) / 2, + ypos = (205 - fileprop_nopro.thumbheight) / 2 + 87; DWIN_ICON_Show(xpos, ypos, 0x00); } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index 5de4f953f6..9146642447 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -1,12 +1,13 @@ /** - * DWIN G-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.5.3 - * Date: 2023/04/25 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,15 +15,27 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For commercial applications additional licenses can be requested */ - #pragma once -void Preview_DrawFromSD(); -void Preview_Invalidate(); -bool Preview_Valid(); -void Preview_Show(); +/** + * DWIN G-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 3.1.2 + * Date: 2022/09/03 + */ + +class Preview { +public: + static void drawFromSD(); + static void invalidate(); + static bool valid(); + static void show(); +private: + static bool hasPreview(); +}; + +extern Preview preview; diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h b/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h deleted file mode 100644 index 9146642447..0000000000 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview_nopro.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * DWIN G-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.1.2 - * Date: 2022/09/03 - */ - -class Preview { -public: - static void drawFromSD(); - static void invalidate(); - static bool valid(); - static void show(); -private: - static bool hasPreview(); -}; - -extern Preview preview; diff --git a/configurations/Andrew427/Configuration.h b/configurations/Andrew427/Configuration.h index d85e24ceef..1402346caf 100644 --- a/configurations/Andrew427/Configuration.h +++ b/configurations/Andrew427/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h index ecdb7b87ca..55265ea706 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h index 749a43724f..0c8c80f49d 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h index ce179a7ea6..164f4512ac 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h index 1453608d27..cc04082be9 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/BLT/Configuration.h b/configurations/Creality Ender/BLT/Configuration.h index 40c2e889d9..45e900a075 100644 --- a/configurations/Creality Ender/BLT/Configuration.h +++ b/configurations/Creality Ender/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/Default-NP/Configuration.h b/configurations/Creality Ender/Default-NP/Configuration.h index 7257e1ac53..dd46fac988 100644 --- a/configurations/Creality Ender/Default-NP/Configuration.h +++ b/configurations/Creality Ender/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/MM/Configuration.h b/configurations/Creality Ender/MM/Configuration.h index 05574457b3..e9d1255f2b 100644 --- a/configurations/Creality Ender/MM/Configuration.h +++ b/configurations/Creality Ender/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Creality Ender/UBL/Configuration.h b/configurations/Creality Ender/UBL/Configuration.h index 204d8fa8e6..e07b6be190 100644 --- a/configurations/Creality Ender/UBL/Configuration.h +++ b/configurations/Creality Ender/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/BLT/Configuration.h b/configurations/Voxelab Aquila 427/BLT/Configuration.h index 7ad202ff7c..482cfa173c 100644 --- a/configurations/Voxelab Aquila 427/BLT/Configuration.h +++ b/configurations/Voxelab Aquila 427/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h index d2ba1696f2..1703b2bc9a 100644 --- a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/MM/Configuration.h b/configurations/Voxelab Aquila 427/MM/Configuration.h index 12d667de7a..cd3a2afd73 100644 --- a/configurations/Voxelab Aquila 427/MM/Configuration.h +++ b/configurations/Voxelab Aquila 427/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/UBL/Configuration.h b/configurations/Voxelab Aquila 427/UBL/Configuration.h index 3f43ef6d17..7923147524 100644 --- a/configurations/Voxelab Aquila 427/UBL/Configuration.h +++ b/configurations/Voxelab Aquila 427/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/Configuration.h b/configurations/Voxelab Aquila/BLT/Configuration.h index 5d043c78ba..a37b9c2179 100644 --- a/configurations/Voxelab Aquila/BLT/Configuration.h +++ b/configurations/Voxelab Aquila/BLT/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h index 1c5b6e9c30..68dcd123c9 100644 --- a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/Default-NP/Configuration.h b/configurations/Voxelab Aquila/Default-NP/Configuration.h index 070c5fe551..04af06fcb1 100644 --- a/configurations/Voxelab Aquila/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila/Default-NP/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/MM/Configuration.h b/configurations/Voxelab Aquila/MM/Configuration.h index e84690fdcd..dd12545907 100644 --- a/configurations/Voxelab Aquila/MM/Configuration.h +++ b/configurations/Voxelab Aquila/MM/Configuration.h @@ -3418,8 +3418,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/Configuration.h b/configurations/Voxelab Aquila/UBL/Configuration.h index def8a221d5..1921022260 100644 --- a/configurations/Voxelab Aquila/UBL/Configuration.h +++ b/configurations/Voxelab Aquila/UBL/Configuration.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h index f1994611b7..da25fcf328 100644 --- a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h @@ -3419,8 +3419,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) diff --git a/configurations/Voxelab Aquila/X3/Configuration.h b/configurations/Voxelab Aquila/X3/Configuration.h index c4ab277c42..4b8bd46d59 100644 --- a/configurations/Voxelab Aquila/X3/Configuration.h +++ b/configurations/Voxelab Aquila/X3/Configuration.h @@ -3421,8 +3421,6 @@ #ifdef PROUI_EX #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 - #else - #define HAS_GCODE_PREVIEW_NOPRO 1 #endif #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) From b744148f5b4a852bdc37637de4fed8cab123df78 Mon Sep 17 00:00:00 2001 From: Nazar78 Date: Tue, 31 Oct 2023 04:41:01 +0800 Subject: [PATCH 3/5] Revert "Merge branch 'thumbnail-preview' of https://github.com/Nazar78/MRiscoCProUI into thumbnail-preview" This reverts commit eea7a7013b481edef5fd61fec42e53ca714982ee, reversing changes made to 7989e213e6958cff348c6c311540de8158316243. --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 9f5f87a14c..a37240e970 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -121,6 +121,10 @@ #include "lockscreen.h" #endif +#if HAS_SOUND + #include "../../../libs/buzzer.h" +#endif + //#define DEBUG_OUT ENABLED(DEBUG_DWIN) #include "../../../core/debug_out.h" @@ -756,7 +760,7 @@ void _draw_feedrate() { DWINUI::Draw_String(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, F(" %")); } else { - _value = CEIL(feedrate_mm_s * feedrate_percentage / 100); + _value = CEIL(MMS_SCALED(feedrate_mm_s)); DWIN_Draw_Box(1, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, 30, 20); } DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 116 + 2 * STAT_CHR_W, 384, _value); @@ -790,8 +794,8 @@ void _draw_xyz_position(const bool force) { } void update_variable() { - TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-6*DWINUI::fontWidth(), 6, checkkey);) - TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-3*DWINUI::fontWidth(), 6, last_checkkey);) + TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 6 * DWINUI::fontWidth(), 6, checkkey);) + TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 3 * DWINUI::fontWidth(), 6, last_checkkey);) _draw_xyz_position(false); @@ -1248,8 +1252,6 @@ void HMI_Printing() { DWIN_UpdateLCD(); } -#include "../../../libs/buzzer.h" - void Draw_Main_Area() { switch (checkkey) { case MainMenu: Draw_Main_Menu(); break; @@ -1572,7 +1574,7 @@ void DWIN_HomingStart() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); Title.ShowCaption(GET_TEXT_F(MSG_HOMING)); - DWIN_Show_Popup(ICON_Printer_0, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + DWIN_Show_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); } void DWIN_HomingDone() { @@ -1898,7 +1900,7 @@ void DWIN_Print_Aborted() { DWIN_Print_Finished(); } -#if (ALT_COLOR_MENU == 1) +#if (ALT_COLOR_MENU == 1) // 1 = Alternate Aquila void DWIN_SetColorDefaults() { HMI_data.Background_Color = Def_Background_Color; HMI_data.Cursor_Color = Def_Cursor_Color; @@ -1920,7 +1922,7 @@ void DWIN_Print_Aborted() { HMI_data.Coordinate_Color = Def_Coordinate_Color; HMI_data.Bottom_Color = Def_Bottom_Color; } -#elif (ALT_COLOR_MENU == 2) +#elif (ALT_COLOR_MENU == 2) // 2 = Ender3V2 Default void DWIN_SetColorDefaults() { #undef Def_Background_Color #undef Def_Text_Color @@ -1948,7 +1950,7 @@ void DWIN_Print_Aborted() { HMI_data.Coordinate_Color = Color_White; HMI_data.Bottom_Color = RGB( 0, 23, 16); } -#else +#else // 0 = Voxelab Default void DWIN_SetColorDefaults() { HMI_data.Background_Color = Def_Background_Color; HMI_data.Cursor_Color = Def_Text_Color; @@ -2153,7 +2155,7 @@ void MarlinUI::refresh() { /* Nothing to see here */ } #endif void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { - DWIN_Draw_Popup(ICON_Printer_0, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + DWIN_Draw_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, GET_TEXT_F(MSG_TURN_OFF)); DWIN_UpdateLCD(); } @@ -2595,7 +2597,8 @@ void ApplyMove() { #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - void SetTimer() { SetPIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max); } + void ApplyTimer() { ui.backlight_timeout_minutes = MenuData.Value; } + void SetTimer() { SetIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max, ui.backlight_timeout_minutes, ApplyTimer); } #endif #if PROUI_EX && ENABLED(NOZZLE_PARK_FEATURE) @@ -3090,7 +3093,7 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { #if HAS_BED_PROBE && ENABLED(TRAMWIZ_MENU_ITEM) // Trammingwizard Popup - void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(ICON_Printer_0, F("Start Tramming Wizard?")); } + void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), F("Start Tramming Wizard?")); } void onClick_StartTramwiz() { if (HMI_flag.select_flag) { if (HMI_data.FullManualTramming) { @@ -3476,7 +3479,7 @@ void Draw_Tune_Menu() { EDIT_ITEM(ICON_MaxAccelerated, MSG_ADVANCE_K, onDrawPFloat3Menu, SetLA_K, &planner.extruder_advance_K[0]); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); @@ -4491,7 +4494,7 @@ void Draw_AdvancedSettings_Menu() { EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); #endif #if BED_SCREW_INSET EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos); @@ -4546,7 +4549,7 @@ void Draw_Advanced_Menu() { // From Control_Menu (Control) || Default-NP Advance EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes); #endif #if BED_SCREW_INSET EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos); From 62e57d46957c96bd494cac592a52055acb5014f6 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Sat, 4 Nov 2023 22:14:35 -0400 Subject: [PATCH 4/5] Update file_header.h test --- Marlin/src/lcd/e3v2/proui/file_header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/e3v2/proui/file_header.h b/Marlin/src/lcd/e3v2/proui/file_header.h index ba1ef79df6..32aa6e91af 100644 --- a/Marlin/src/lcd/e3v2/proui/file_header.h +++ b/Marlin/src/lcd/e3v2/proui/file_header.h @@ -20,7 +20,7 @@ * For commercial applications additional licenses can be requested */ -#pragma once +//#pragma once typedef struct { char name[13]; //8.3 From 5771422d4b6d1ef4dbcc0e353b3a1a11d2576d97 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Wed, 8 Nov 2023 06:38:21 -0500 Subject: [PATCH 5/5] Fix for `HAS_GCODE_PREVIEW` Revert back `fileprop` struct, moved to .h header file, rename functions Update **dwin.cpp** #include, rename and omit in `Goto_ConfirmToPrint()` Delete `file_header.h`, changed references to `gcode_preview.h` Update Config files so `HAS_GCODE_PREVIEW` can be used in NoPro ver. --- Marlin/Configuration.h | 2 +- Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp | 2 +- Marlin/src/lcd/e3v2/proui/cv_laser_module.h | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 11 +- Marlin/src/lcd/e3v2/proui/file_header.h | 53 ------- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 129 ++++++++---------- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 28 +++- configurations/Andrew427/Configuration.h | 2 +- .../BTT-SKR_Mini_E3_V2/ConfigurationMM.h | 2 +- .../BTT-SKR_Mini_E3_V2/ConfigurationUBL.h | 2 +- .../BTT-SKR_Mini_E3_V3/ConfigurationMM.h | 2 +- .../BTT-SKR_Mini_E3_V3/ConfigurationUBL.h | 2 +- .../Creality Ender/BLT/Configuration.h | 2 +- .../Creality Ender/Default-NP/Configuration.h | 2 +- .../Creality Ender/MM/Configuration.h | 2 +- .../Creality Ender/UBL/Configuration.h | 2 +- .../Voxelab Aquila 427/BLT/Configuration.h | 2 +- .../Default-NP/Configuration.h | 2 +- .../Voxelab Aquila 427/MM/Configuration.h | 2 +- .../Voxelab Aquila 427/UBL/Configuration.h | 2 +- .../Voxelab Aquila/BLT/Configuration.h | 2 +- .../Voxelab Aquila/BLT/ConfigurationPro.h | 2 +- .../Voxelab Aquila/Default-NP/Configuration.h | 2 +- .../Voxelab Aquila/MM/Configuration.h | 2 +- .../Voxelab Aquila/UBL/Configuration.h | 2 +- .../Voxelab Aquila/UBL/ConfigurationPro.h | 2 +- .../Voxelab Aquila/X3/Configuration.h | 2 +- 27 files changed, 114 insertions(+), 153 deletions(-) delete mode 100644 Marlin/src/lcd/e3v2/proui/file_header.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 01631af74a..673b74c8c0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp index 60f83a5579..02c38007b1 100644 --- a/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp +++ b/Marlin/src/lcd/e3v2/proui/custom_gcodes.cpp @@ -33,7 +33,7 @@ #include "custom_gcodes.h" #if ALL(PROUI_EX, HAS_MEDIA) - #include "file_header.h" + #include "gcode_preview.h" #endif //============================================================================= diff --git a/Marlin/src/lcd/e3v2/proui/cv_laser_module.h b/Marlin/src/lcd/e3v2/proui/cv_laser_module.h index 2807e865b5..ef80d719e0 100644 --- a/Marlin/src/lcd/e3v2/proui/cv_laser_module.h +++ b/Marlin/src/lcd/e3v2/proui/cv_laser_module.h @@ -34,7 +34,7 @@ #include "../../../inc/MarlinConfig.h" #if HAS_MEDIA - #include "file_header.h" + #include "gcode_preview.h" #define LASER_XMIN fileprop.minx #define LASER_XMAX fileprop.maxx #define LASER_YMIN fileprop.miny diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index db557429a4..5ecd78d6e8 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -59,7 +59,7 @@ #include "../../../feature/host_actions.h" #endif -#if HAS_MESH || HAS_BED_PROBE +#if ANY(HAS_MESH, HAS_BED_PROBE) #include "../../../feature/bedlevel/bedlevel.h" #include "bedlevel_tools.h" #endif @@ -96,8 +96,7 @@ #include "../../../feature/tmc_util.h" #endif -#if HAS_GCODE_PREVIEW - #include "file_header.h" +#if ANY(HAS_GCODE_PREVIEW, CV_LASER_MODULE) #include "gcode_preview.h" #endif @@ -2289,10 +2288,10 @@ void DWIN_RedrawScreen() { void Goto_ConfirmToPrint() { #if PROUI_EX && HAS_GCODE_PREVIEW - fileprop.clear(); - fileprop.setname(card.filename); + fileprop.clears(); + fileprop.setnames(card.filename); card.openFileRead(fileprop.name, 100); - getFileHeader(); + //getFileHeader(); // no idea what this does card.closefile(); if (fileprop.isConfig) return card.openAndPrintFile(card.filename); #endif diff --git a/Marlin/src/lcd/e3v2/proui/file_header.h b/Marlin/src/lcd/e3v2/proui/file_header.h deleted file mode 100644 index 32aa6e91af..0000000000 --- a/Marlin/src/lcd/e3v2/proui/file_header.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * DWIN G-code File header utility - * Author: Miguel A. Risco-Castillo - * version: 2.2.3 - * Date: 2023/05/04 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested - */ - -//#pragma once - -typedef struct { - char name[13]; //8.3 - bool isConfig; - bool isLaser; - uint32_t thumbstart; - uint16_t thumbsize; - uint8_t thumbheight; - uint8_t thumbwidth; - uint8_t *thumbdata; - float time; - float filament; - float layer; - float minx; - float maxx; - float miny; - float maxy; - float minz; - float maxz; - float width() { return maxx - minx; } - float length() { return maxy - miny; } - float height() { return maxz - minz + layer; } - void setname(const char * const fn); - void clear(); -} fileprop_t; -extern fileprop_t fileprop; - -void getLine(char *buf, const uint8_t bufsize); -bool getValue(char *buf, const char * const key, float &value); -void getFileHeader(); diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 4015d88bd7..540a4641f0 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -43,38 +43,27 @@ #define THUMBWIDTH 200 #define THUMBHEIGHT 200 -Preview preview; - -typedef struct { - char name[13] = ""; // 8.3 + null - uint32_t thumbstart = 0; - int thumbsize = 0; - int thumbheight = 0, thumbwidth = 0; - float time = 0; - float filament = 0; - float layer = 0; - float width = 0, height = 0, length = 0; - - void setname(const char * const fn) { - const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); - memcpy(name, fn, len); - name[len] = '\0'; - } - - void clear() { - name[0] = '\0'; - thumbstart = 0; - thumbsize = 0; - thumbheight = thumbwidth = 0; - time = 0; - filament = 0; - layer = 0; - height = width = length = 0; - } - -} fileprop_t; +// When `getLine`, `getValue`, `getFileHeader` are enabled - uncomment this +// ??? what they do... Maybe Laser related? +//IF_DISABLED(PROUI_EX, fileprop_t fileprop;) +fileprop_t fileprop; + +void fileprop_t::setnames(const char * const fn) { + const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); + memcpy(name, fn, len); + name[len] = '\0'; +} -fileprop_t fileprop_nopro; +void fileprop_t::clears() { + name[0] = '\0'; + thumbstart = 0; + thumbsize = 0; + thumbheight = thumbwidth = 0; + time = 0; + filament = 0; + layer = 0; + height = width = length = 0; +} void getValue(const char * const buf, PGM_P const key, float &value) { if (value != 0.0f) return; @@ -101,34 +90,34 @@ bool Preview::hasPreview() { uint32_t indx = 0; float tmp = 0; - fileprop_nopro.clear(); - fileprop_nopro.setname(card.filename); + fileprop.clears(); + fileprop.setnames(card.filename); - card.openFileRead(fileprop_nopro.name); + card.openFileRead(fileprop.name); char buf[256]; uint8_t nbyte = 1; - while (!fileprop_nopro.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { + while (!fileprop.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { nbyte = card.read(buf, sizeof(buf) - 1); if (nbyte > 0) { buf[nbyte] = '\0'; - getValue(buf, PSTR(";TIME:"), fileprop_nopro.time); - getValue(buf, PSTR(";Filament used:"), fileprop_nopro.filament); - getValue(buf, PSTR(";Layer height:"), fileprop_nopro.layer); + getValue(buf, PSTR(";TIME:"), fileprop.time); + getValue(buf, PSTR(";Filament used:"), fileprop.filament); + getValue(buf, PSTR(";Layer height:"), fileprop.layer); getValue(buf, PSTR(";MINX:"), tmp); - getValue(buf, PSTR(";MAXX:"), fileprop_nopro.width); - fileprop_nopro.width -= tmp; + getValue(buf, PSTR(";MAXX:"), fileprop.width); + fileprop.width -= tmp; tmp = 0; getValue(buf, PSTR(";MINY:"), tmp); - getValue(buf, PSTR(";MAXY:"), fileprop_nopro.length); - fileprop_nopro.length -= tmp; + getValue(buf, PSTR(";MAXY:"), fileprop.length); + fileprop.length -= tmp; tmp = 0; getValue(buf, PSTR(";MINZ:"), tmp); - getValue(buf, PSTR(";MAXZ:"), fileprop_nopro.height); - fileprop_nopro.height -= tmp; + getValue(buf, PSTR(";MAXZ:"), fileprop.height); + fileprop.height -= tmp; posptr = strstr_P(buf, tbstart); if (posptr != nullptr) { - fileprop_nopro.thumbstart = indx + (posptr - &buf[0]); + fileprop.thumbstart = indx + (posptr - &buf[0]); } else { indx += _MAX(10, nbyte - (signed)strlen_P(tbstart)); @@ -137,31 +126,31 @@ bool Preview::hasPreview() { } } - if (!fileprop_nopro.thumbstart) { + if (!fileprop.thumbstart) { card.closefile(); LCD_MESSAGE_F("Thumbnail not found"); return false; } // Get the size of the thumbnail - card.setIndex(fileprop_nopro.thumbstart + strlen_P(tbstart)); + card.setIndex(fileprop.thumbstart + strlen_P(tbstart)); for (uint8_t i = 0; i < 16; i++) { const char c = card.get(); if (ISEOL(c)) { buf[i] = '\0'; break; } buf[i] = c; } - fileprop_nopro.thumbsize = atoi(buf); + fileprop.thumbsize = atoi(buf); // Exit if there isn't a thumbnail - if (!fileprop_nopro.thumbsize) { + if (!fileprop.thumbsize) { card.closefile(); LCD_MESSAGE_F("Invalid Thumbnail Size"); return false; } - uint8_t buf64[fileprop_nopro.thumbsize + 1]; + uint8_t buf64[fileprop.thumbsize + 1]; uint16_t nread = 0; - while (nread < fileprop_nopro.thumbsize) { + while (nread < fileprop.thumbsize) { const uint8_t c = card.get(); if (!ISEOL(c) && c != ';' && c != ' ') buf64[nread++] = c; @@ -169,12 +158,12 @@ bool Preview::hasPreview() { card.closefile(); buf64[nread] = '\0'; - uint8_t thumbdata[3 + 3 * (fileprop_nopro.thumbsize / 4)]; // Reserve space for the JPEG thumbnail - fileprop_nopro.thumbsize = decode_base64(buf64, thumbdata); - DWINUI::WriteToSRAM(0x00, fileprop_nopro.thumbsize, thumbdata); + uint8_t thumbdata[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + fileprop.thumbsize = decode_base64(buf64, thumbdata); + DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, thumbdata); - fileprop_nopro.thumbwidth = THUMBWIDTH; - fileprop_nopro.thumbheight = THUMBHEIGHT; + fileprop.thumbwidth = THUMBWIDTH; + fileprop.thumbheight = THUMBHEIGHT; return true; } @@ -184,24 +173,24 @@ void Preview::drawFromSD() { MString<45> buf; DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 0, DWIN_WIDTH, STATUS_Y - 1); - if (fileprop_nopro.time) { - buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop_nopro.time / 3600, ((uint16_t)fileprop_nopro.time % 3600) / 60); + if (fileprop.time) { + buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); DWINUI::Draw_String(20, 10, &buf); } - if (fileprop_nopro.filament) { - buf.set(F("Filament used: "), p_float_t(fileprop_nopro.filament, 2), F(" m")); + if (fileprop.filament) { + buf.set(F("Filament used: "), p_float_t(fileprop.filament, 2), F(" m")); DWINUI::Draw_String(20, 30, &buf); } - if (fileprop_nopro.layer) { - buf.set(F("Layer height: "), p_float_t(fileprop_nopro.layer, 2), F(" mm")); + if (fileprop.layer) { + buf.set(F("Layer height: "), p_float_t(fileprop.layer, 2), F(" mm")); DWINUI::Draw_String(20, 50, &buf); } - if (fileprop_nopro.width) { - buf.set(F("Volume: "), p_float_t(fileprop_nopro.width, 1), 'x', p_float_t(fileprop_nopro.length, 1), 'x', p_float_t(fileprop_nopro.height, 1), F(" mm")); + if (fileprop.width) { + buf.set(F("Volume: "), p_float_t(fileprop.width, 1), 'x', p_float_t(fileprop.length, 1), 'x', p_float_t(fileprop.height, 1), F(" mm")); DWINUI::Draw_String(20, 70, &buf); } - if (!fileprop_nopro.thumbsize) { + if (!fileprop.thumbsize) { const uint8_t xpos = ((DWIN_WIDTH) / 2) - 55, // 55 = iconW/2 ypos = ((DWIN_HEIGHT) / 2) - 125; DWINUI::Draw_Icon(ICON_Info_0, xpos, ypos); @@ -210,22 +199,22 @@ void Preview::drawFromSD() { } DWINUI::Draw_Button(BTN_Print, 26, 290); DWINUI::Draw_Button(BTN_Cancel, 146, 290); - if (fileprop_nopro.thumbsize) show(); + if (fileprop.thumbsize) show(); Draw_Select_Highlight(false, 290); DWIN_UpdateLCD(); } void Preview::invalidate() { - fileprop_nopro.thumbsize = 0; + fileprop.thumbsize = 0; } bool Preview::valid() { - return !!fileprop_nopro.thumbsize; + return !!fileprop.thumbsize; } void Preview::show() { - const uint8_t xpos = ((DWIN_WIDTH) - fileprop_nopro.thumbwidth) / 2, - ypos = (205 - fileprop_nopro.thumbheight) / 2 + 87; + const uint8_t xpos = ((DWIN_WIDTH) - fileprop.thumbwidth) / 2, + ypos = (205 - fileprop.thumbheight) / 2 + 87; DWIN_ICON_Show(xpos, ypos, 0x00); } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index 9146642447..6a63302fa4 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -37,5 +37,31 @@ class Preview { private: static bool hasPreview(); }; - extern Preview preview; + +typedef struct { + bool isConfig; + bool isLaser; + char name[13] = ""; // 8.3 + null + uint32_t thumbstart; + int thumbsize, thumbheight, thumbwidth; + float time, + filament, + layer, + width, height, length, + minx, + maxx, + miny, + maxy; + + void setnames(const char * const fn); + void clears(); + +} fileprop_t; + +extern fileprop_t fileprop; + +// These can be enabled, but function use is unknown +//void getLine(char *buf, const uint8_t bufsize); +//bool //void getValue(const char *buf, const char * const key, float &value); +//void getFileHeader(); diff --git a/configurations/Andrew427/Configuration.h b/configurations/Andrew427/Configuration.h index 5c2517f2f2..7e9625cc74 100644 --- a/configurations/Andrew427/Configuration.h +++ b/configurations/Andrew427/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h index 13b6620135..edf5dd333e 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationMM.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h index 7fc84d992e..a780832732 100644 --- a/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V2/ConfigurationUBL.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h index c8c06f4ede..059cf4d6f9 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationMM.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h index 040c75531c..e7c5039f02 100644 --- a/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h +++ b/configurations/BTT-SKR_Mini_E3_V3/ConfigurationUBL.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Creality Ender/BLT/Configuration.h b/configurations/Creality Ender/BLT/Configuration.h index 95f82567ab..7bb549c9ce 100644 --- a/configurations/Creality Ender/BLT/Configuration.h +++ b/configurations/Creality Ender/BLT/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Creality Ender/Default-NP/Configuration.h b/configurations/Creality Ender/Default-NP/Configuration.h index 03f3bb217e..a0544a8ea8 100644 --- a/configurations/Creality Ender/Default-NP/Configuration.h +++ b/configurations/Creality Ender/Default-NP/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: //#define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Creality Ender/MM/Configuration.h b/configurations/Creality Ender/MM/Configuration.h index 4bda09580f..c8da7410f2 100644 --- a/configurations/Creality Ender/MM/Configuration.h +++ b/configurations/Creality Ender/MM/Configuration.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Creality Ender/UBL/Configuration.h b/configurations/Creality Ender/UBL/Configuration.h index 6642708e81..ace591a0b1 100644 --- a/configurations/Creality Ender/UBL/Configuration.h +++ b/configurations/Creality Ender/UBL/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/BLT/Configuration.h b/configurations/Voxelab Aquila 427/BLT/Configuration.h index fa2910c0ba..5fa3fe712f 100644 --- a/configurations/Voxelab Aquila 427/BLT/Configuration.h +++ b/configurations/Voxelab Aquila 427/BLT/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h index 934730b0f0..36ae9c3223 100644 --- a/configurations/Voxelab Aquila 427/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila 427/Default-NP/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: //#define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/MM/Configuration.h b/configurations/Voxelab Aquila 427/MM/Configuration.h index 284eb1ac39..b493444308 100644 --- a/configurations/Voxelab Aquila 427/MM/Configuration.h +++ b/configurations/Voxelab Aquila 427/MM/Configuration.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila 427/UBL/Configuration.h b/configurations/Voxelab Aquila 427/UBL/Configuration.h index 59289f9a05..f4a0e0372b 100644 --- a/configurations/Voxelab Aquila 427/UBL/Configuration.h +++ b/configurations/Voxelab Aquila 427/UBL/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/Configuration.h b/configurations/Voxelab Aquila/BLT/Configuration.h index 1dfead45cf..29110249c1 100644 --- a/configurations/Voxelab Aquila/BLT/Configuration.h +++ b/configurations/Voxelab Aquila/BLT/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: //#define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h index 01631af74a..673b74c8c0 100644 --- a/configurations/Voxelab Aquila/BLT/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/BLT/ConfigurationPro.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/Default-NP/Configuration.h b/configurations/Voxelab Aquila/Default-NP/Configuration.h index 1caeab233f..3db0a324a0 100644 --- a/configurations/Voxelab Aquila/Default-NP/Configuration.h +++ b/configurations/Voxelab Aquila/Default-NP/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: //#define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/MM/Configuration.h b/configurations/Voxelab Aquila/MM/Configuration.h index c42e6cd3da..334311fb7e 100644 --- a/configurations/Voxelab Aquila/MM/Configuration.h +++ b/configurations/Voxelab Aquila/MM/Configuration.h @@ -3416,9 +3416,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/Configuration.h b/configurations/Voxelab Aquila/UBL/Configuration.h index ff5b954c8b..850893d4d6 100644 --- a/configurations/Voxelab Aquila/UBL/Configuration.h +++ b/configurations/Voxelab Aquila/UBL/Configuration.h @@ -3417,9 +3417,9 @@ // Professional firmware features: //#define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h index 53e5a506f7..1f63dc8bb8 100644 --- a/configurations/Voxelab Aquila/UBL/ConfigurationPro.h +++ b/configurations/Voxelab Aquila/UBL/ConfigurationPro.h @@ -3417,9 +3417,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) diff --git a/configurations/Voxelab Aquila/X3/Configuration.h b/configurations/Voxelab Aquila/X3/Configuration.h index 4b8bd46d59..fb5620a0f1 100644 --- a/configurations/Voxelab Aquila/X3/Configuration.h +++ b/configurations/Voxelab Aquila/X3/Configuration.h @@ -3419,9 +3419,9 @@ // Professional firmware features: #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 #define HAS_TOOLBAR 1 #endif + #define HAS_GCODE_PREVIEW 1 #define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash) #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash)