Browse Source

🎨 Rename MarlinUI::zoffset_overlay

Scott Lahteine 2 years ago
parent
commit
eb784d6e55

+ 7
- 3
Marlin/src/inc/SanityCheck.h View File

@@ -900,7 +900,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
900 900
     #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
901 901
   #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
902 902
     #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
903
-  #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_MARLINUI_U8GLIB
903
+  #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
904 904
     #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
905 905
   #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
906 906
     #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
@@ -1762,8 +1762,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1762 1762
   #endif
1763 1763
 #endif
1764 1764
 
1765
-#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !(ENABLED(AUTO_BED_LEVELING_UBL) && EITHER(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI))
1766
-  #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
1765
+#if ENABLED(MESH_EDIT_GFX_OVERLAY)
1766
+  #if DISABLED(AUTO_BED_LEVELING_UBL)
1767
+    #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL."
1768
+  #elif NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
1769
+    #error "MESH_EDIT_GFX_OVERLAY requires a Graphical LCD."
1770
+  #endif
1767 1771
 #endif
1768 1772
 
1769 1773
 #if ENABLED(G29_RETRY_AND_RECOVER) && NONE(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)

+ 1
- 9
Marlin/src/lcd/dogm/marlinui_DOGM.cpp View File

@@ -715,15 +715,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
715 715
       B00001100,B00000000
716 716
     };
717 717
 
718
-    void _lcd_zoffset_overlay_gfx(const_float_t zvalue) {
719
-      // Determine whether the user is raising or lowering the nozzle.
720
-      static int8_t dir;
721
-      static float old_zvalue;
722
-      if (zvalue != old_zvalue) {
723
-        dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0;
724
-        old_zvalue = zvalue;
725
-      }
726
-
718
+    void MarlinUI::zoffset_overlay(const int8_t dir) {
727 719
       const unsigned char *rot_up = TERN(OVERLAY_GFX_REVERSE, ccw_bmp,  cw_bmp),
728 720
                         *rot_down = TERN(OVERLAY_GFX_REVERSE,  cw_bmp, ccw_bmp);
729 721
 

+ 3
- 11
Marlin/src/lcd/e3v2/marlinui/ui_common.cpp View File

@@ -562,19 +562,11 @@ void MarlinUI::draw_status_message(const bool blink) {
562 562
 
563 563
   #endif // AUTO_BED_LEVELING_UBL
564 564
 
565
-  #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY, BABYSTEP_GFX_OVERLAY)
566
-
567
-    void _lcd_zoffset_overlay_gfx(const float zvalue) {
568
-      // Determine whether the user is raising or lowering the nozzle.
569
-      static int8_t dir;
570
-      static float old_zvalue;
571
-      if (zvalue != old_zvalue) {
572
-        dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0;
573
-        old_zvalue = zvalue;
574
-      }
565
+  #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
575 566
 
567
+    void MarlinUI::zoffset_overlay(const int8_t dir) {
576 568
       const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW),
577
-                rot_down = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCW, ICON_RotateCCW);
569
+              rot_down = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCW, ICON_RotateCCW);
578 570
 
579 571
       const int nozzle = (LCD_PIXEL_WIDTH / 2) - 20;
580 572
 

+ 14
- 0
Marlin/src/lcd/marlinui.cpp View File

@@ -1714,6 +1714,20 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
1714 1714
       if (touch_calibration.need_calibration()) ui.goto_screen(touch_screen_calibration);
1715 1715
     #endif
1716 1716
   }
1717
+
1718
+  #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
1719
+    void MarlinUI::zoffset_overlay(const_float_t zvalue) {
1720
+      // Determine whether the user is raising or lowering the nozzle.
1721
+      static int8_t dir;
1722
+      static float old_zvalue;
1723
+      if (zvalue != old_zvalue) {
1724
+        dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0;
1725
+        old_zvalue = zvalue;
1726
+      }
1727
+      zoffset_overlay(dir);
1728
+    }
1729
+  #endif
1730
+
1717 1731
 #endif
1718 1732
 
1719 1733
 #if BOTH(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE)

+ 5
- 0
Marlin/src/lcd/marlinui.h View File

@@ -474,6 +474,11 @@ public:
474 474
       static bool did_first_redraw;
475 475
     #endif
476 476
 
477
+    #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
478
+      static void zoffset_overlay(const int8_t dir);
479
+      static void zoffset_overlay(const_float_t zvalue);
480
+    #endif
481
+
477 482
     static void draw_kill_screen();
478 483
 
479 484
   #else // No LCD

+ 1
- 4
Marlin/src/lcd/menu/menu.cpp View File

@@ -257,9 +257,6 @@ void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
257 257
  *
258 258
  *   encoderLine is the position based on the encoder
259 259
  *   encoderTopLine is the top menu line to display
260
- *   _lcdLineNr is the index of the LCD line (e.g., 0-3)
261
- *   _menuLineNr is the menu item to draw and process
262
- *   _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
263 260
  *   screen_items is the total number of items in the menu (after one call)
264 261
  */
265 262
 void scroll_screen(const uint8_t limit, const bool is_menu) {
@@ -336,7 +333,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
336 333
     if (ui.should_draw()) {
337 334
       if (do_probe) {
338 335
         MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
339
-        TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(probe.offset.z));
336
+        TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
340 337
       }
341 338
       else {
342 339
         #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)

+ 0
- 4
Marlin/src/lcd/menu/menu.h View File

@@ -39,10 +39,6 @@ typedef void (*selectFunc_t)();
39 39
 #define SS_INVERT  0x02
40 40
 #define SS_DEFAULT SS_CENTER
41 41
 
42
-#if EITHER(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
43
-  void _lcd_zoffset_overlay_gfx(const_float_t zvalue);
44
-#endif
45
-
46 42
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9
47 43
   #define BABYSTEP_TO_STR(N) ftostr43sign(N)
48 44
 #elif ENABLED(BABYSTEPPING)

+ 1
- 1
Marlin/src/lcd/menu/menu_ubl.cpp View File

@@ -83,7 +83,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) {
83 83
   if (ui.should_draw()) {
84 84
     const float rounded_f = rounded_mesh_value();
85 85
     MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f));
86
-    TERN_(MESH_EDIT_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(rounded_f));
86
+    TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f));
87 87
     TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE));
88 88
   }
89 89
 }

Loading…
Cancel
Save