Parcourir la source

Minor LCD cleanup, improvement

Scott Lahteine il y a 3 ans
Parent
révision
f445bc26e5

+ 6
- 10
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Voir le fichier

826
     static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
826
     static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
827
 
827
 
828
     float unified_bed_leveling::measure_business_card_thickness(float in_height) {
828
     float unified_bed_leveling::measure_business_card_thickness(float in_height) {
829
-      TERN_(HAS_LCD_MENU, ui.capture());
829
+      ui.capture();
830
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
830
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
831
 
831
 
832
       do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
832
       do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
857
         SERIAL_ECHOLNPGM("mm thick.");
857
         SERIAL_ECHOLNPGM("mm thick.");
858
       }
858
       }
859
 
859
 
860
-      ui.release();
861
-
862
       restore_ubl_active_state_and_leave();
860
       restore_ubl_active_state_and_leave();
863
 
861
 
864
       return thickness;
862
       return thickness;
865
     }
863
     }
866
 
864
 
867
     void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
865
     void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
868
-      TERN_(HAS_LCD_MENU, ui.capture());
866
+      ui.capture();
869
 
867
 
870
       save_ubl_active_state_and_disable();  // No bed level correction so only raw data is obtained
868
       save_ubl_active_state_and_disable();  // No bed level correction so only raw data is obtained
871
       do_blocking_move_to_xy_z(current_position, z_clearance);
869
       do_blocking_move_to_xy_z(current_position, z_clearance);
893
         do_blocking_move_to_z(z_clearance);
891
         do_blocking_move_to_z(z_clearance);
894
 
892
 
895
         KEEPALIVE_STATE(PAUSED_FOR_USER);
893
         KEEPALIVE_STATE(PAUSED_FOR_USER);
896
-        TERN_(HAS_LCD_MENU, ui.capture());
894
+        ui.capture();
897
 
895
 
898
         if (do_ubl_mesh_map) display_map(g29_map_type);  // show user where we're probing
896
         if (do_ubl_mesh_map) display_map(g29_map_type);  // show user where we're probing
899
 
897
 
907
         if (click_and_hold()) {
905
         if (click_and_hold()) {
908
           SERIAL_ECHOLNPGM("\nMesh only partially populated.");
906
           SERIAL_ECHOLNPGM("\nMesh only partially populated.");
909
           do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
907
           do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
910
-          ui.release();
911
           return restore_ubl_active_state_and_leave();
908
           return restore_ubl_active_state_and_leave();
912
         }
909
         }
913
 
910
 
958
       save_ubl_active_state_and_disable();
955
       save_ubl_active_state_and_disable();
959
 
956
 
960
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
957
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
961
-      TERN_(HAS_LCD_MENU, ui.capture());                    // Take over control of the LCD encoder
958
+      ui.capture();                                               // Take over control of the LCD encoder
962
 
959
 
963
-      do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
960
+      do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES);  // Move to the given XY with probe clearance
964
 
961
 
965
       TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset));  // Move Z to the given 'H' offset
962
       TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset));  // Move Z to the given 'H' offset
966
 
963
 
1016
 
1013
 
1017
       } while (lpos.x >= 0 && --g29_repetition_cnt > 0);
1014
       } while (lpos.x >= 0 && --g29_repetition_cnt > 0);
1018
 
1015
 
1019
-      ui.release();
1020
-
1021
       if (do_ubl_mesh_map) display_map(g29_map_type);
1016
       if (do_ubl_mesh_map) display_map(g29_map_type);
1022
       restore_ubl_active_state_and_leave();
1017
       restore_ubl_active_state_and_leave();
1023
 
1018
 
1168
   }
1163
   }
1169
 
1164
 
1170
   void unified_bed_leveling::restore_ubl_active_state_and_leave() {
1165
   void unified_bed_leveling::restore_ubl_active_state_and_leave() {
1166
+    TERN_(HAS_LCD_MENU, ui.release());
1171
     #if ENABLED(UBL_DEVEL_DEBUGGING)
1167
     #if ENABLED(UBL_DEVEL_DEBUGGING)
1172
       if (--ubl_state_recursion_chk) {
1168
       if (--ubl_state_recursion_chk) {
1173
         SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
1169
         SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");

+ 9
- 7
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Voir le fichier

824
 
824
 
825
           #else // !HAS_DUAL_MIXING
825
           #else // !HAS_DUAL_MIXING
826
 
826
 
827
-            if (TERN1(LCD_SHOW_E_TOTAL, !printingIsActive())) {
828
-              const xy_pos_t lpos = current_position.asLogical();
829
-              _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
830
-              lcd_put_wchar(' ');
831
-              _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
832
-            }
833
-            else {
827
+            const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE);
828
+
829
+            if (show_e_total) {
834
               #if ENABLED(LCD_SHOW_E_TOTAL)
830
               #if ENABLED(LCD_SHOW_E_TOTAL)
835
                 char tmp[20];
831
                 char tmp[20];
836
                 const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
832
                 const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
838
                 lcd_put_u8str(tmp);
834
                 lcd_put_u8str(tmp);
839
               #endif
835
               #endif
840
             }
836
             }
837
+            else {
838
+              const xy_pos_t lpos = current_position.asLogical();
839
+              _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
840
+              lcd_put_wchar(' ');
841
+              _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
842
+            }
841
 
843
 
842
           #endif // !HAS_DUAL_MIXING
844
           #endif // !HAS_DUAL_MIXING
843
 
845
 

+ 11
- 11
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Voir le fichier

414
     #endif
414
     #endif
415
   #endif
415
   #endif
416
 
416
 
417
-  const bool showxy = TERN1(LCD_SHOW_E_TOTAL, !printingIsActive());
417
+  const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE);
418
 
418
 
419
   // At the first page, generate new display values
419
   // At the first page, generate new display values
420
   if (first_page) {
420
   if (first_page) {
434
     const xyz_pos_t lpos = current_position.asLogical();
434
     const xyz_pos_t lpos = current_position.asLogical();
435
     strcpy(zstring, ftostr52sp(lpos.z));
435
     strcpy(zstring, ftostr52sp(lpos.z));
436
 
436
 
437
-    if (showxy) {
438
-      strcpy(xstring, ftostr4sign(lpos.x));
439
-      strcpy(ystring, ftostr4sign(lpos.y));
440
-    }
441
-    else {
437
+    if (show_e_total) {
442
       #if ENABLED(LCD_SHOW_E_TOTAL)
438
       #if ENABLED(LCD_SHOW_E_TOTAL)
443
         const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
439
         const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm
444
         sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
440
         sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm
445
       #endif
441
       #endif
446
     }
442
     }
443
+    else {
444
+      strcpy(xstring, ftostr4sign(lpos.x));
445
+      strcpy(ystring, ftostr4sign(lpos.y));
446
+    }
447
 
447
 
448
     #if ENABLED(FILAMENT_LCD_DISPLAY)
448
     #if ENABLED(FILAMENT_LCD_DISPLAY)
449
       strcpy(wstring, ftostr12ns(filwidth.measured_mm));
449
       strcpy(wstring, ftostr12ns(filwidth.measured_mm));
772
 
772
 
773
       #else
773
       #else
774
 
774
 
775
-        if (showxy) {
776
-          _draw_axis_value(X_AXIS, xstring, blink);
777
-          _draw_axis_value(Y_AXIS, ystring, blink);
778
-        }
779
-        else {
775
+        if (show_e_total) {
780
           _draw_axis_value(E_AXIS, xstring, true);
776
           _draw_axis_value(E_AXIS, xstring, true);
781
           lcd_put_u8str_P(PSTR("       "));
777
           lcd_put_u8str_P(PSTR("       "));
782
         }
778
         }
779
+        else {
780
+          _draw_axis_value(X_AXIS, xstring, blink);
781
+          _draw_axis_value(Y_AXIS, ystring, blink);
782
+        }
783
 
783
 
784
       #endif
784
       #endif
785
 
785
 

+ 20
- 18
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp Voir le fichier

318
 
318
 
319
   #endif // ADVANCED_PAUSE_FEATURE
319
   #endif // ADVANCED_PAUSE_FEATURE
320
 
320
 
321
-  // Set the colors for a menu item based on whether it is selected
321
+  // Mark a menu item and set font color if selected.
322
+  // Return 'false' if the item is not on screen.
322
   static bool mark_as_selected(const uint8_t row, const bool sel) {
323
   static bool mark_as_selected(const uint8_t row, const bool sel) {
323
     row_y1 = row * (MENU_FONT_HEIGHT) + 1;
324
     row_y1 = row * (MENU_FONT_HEIGHT) + 1;
324
     row_y2 = row_y1 + MENU_FONT_HEIGHT - 1;
325
     row_y2 = row_y1 + MENU_FONT_HEIGHT - 1;
330
         u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH);
331
         u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH);
331
         u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
332
         u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
332
       #else
333
       #else
333
-        u8g.setColorIndex(1); // black on white
334
+        u8g.setColorIndex(1); // solid outline
334
         u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1);
335
         u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1);
335
-        u8g.setColorIndex(0); // white on black
336
+        u8g.setColorIndex(0); // inverted text
336
       #endif
337
       #endif
337
     }
338
     }
338
     #if DISABLED(MENU_HOLLOW_FRAME)
339
     #if DISABLED(MENU_HOLLOW_FRAME)
339
-      else {
340
-        u8g.setColorIndex(1); // unmarked text is black on white
341
-      }
340
+      else u8g.setColorIndex(1); // solid text
342
     #endif
341
     #endif
343
 
342
 
344
     if (!PAGE_CONTAINS(row_y1, row_y2)) return false;
343
     if (!PAGE_CONTAINS(row_y1, row_y2)) return false;
352
 
351
 
353
     if (mark_as_selected(row, style & SS_INVERT)) {
352
     if (mark_as_selected(row, style & SS_INVERT)) {
354
 
353
 
355
-      u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
354
+      pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
356
 
355
 
357
-      if ((style & SS_CENTER) && !valstr) {
358
-        int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2;
359
-        while (--pad >= 0) { lcd_put_wchar(' '); n--; }
360
-      }
361
-      n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH) * (MENU_FONT_WIDTH);
356
+      if ((style & SS_CENTER) && !valstr)
357
+        for (int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; pad > 0; --pad) {
358
+          lcd_put_wchar(' ');
359
+          n -= MENU_FONT_WIDTH;
360
+        }
361
+
362
+      n = lcd_put_u8str_ind_P(pstr, itemIndex, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
362
       if (valstr) n -= lcd_put_u8str_max(valstr, n);
363
       if (valstr) n -= lcd_put_u8str_max(valstr, n);
363
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
364
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
364
     }
365
     }
367
   // Draw a generic menu item
368
   // Draw a generic menu item
368
   void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
369
   void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) {
369
     if (mark_as_selected(row, sel)) {
370
     if (mark_as_selected(row, sel)) {
370
-      u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2) * (MENU_FONT_WIDTH);
371
+      pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 1) * (MENU_FONT_WIDTH);
371
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
372
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
372
       lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
373
       lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char);
373
       lcd_put_wchar(' ');
374
       lcd_put_wchar(' ');
380
       const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)),
381
       const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)),
381
                     pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), data) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)data));
382
                     pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), data) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)data));
382
 
383
 
383
-      u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH);
384
+      pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH);
384
       if (vallen) {
385
       if (vallen) {
385
         lcd_put_wchar(':');
386
         lcd_put_wchar(':');
386
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
387
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
440
   }
441
   }
441
 
442
 
442
   inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) {
443
   inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) {
443
-    const u8g_uint_t len = utf8_strlen_P(pstr), bw = len * (MENU_FONT_WIDTH),
444
-                     bx = x * (MENU_FONT_WIDTH), by = (y + 1) * (MENU_FONT_HEIGHT);
444
+    const u8g_uint_t len = utf8_strlen_P(pstr),
445
+                      by = (y + 1) * (MENU_FONT_HEIGHT);
446
+    const pixel_len_t bw = len * (MENU_FONT_WIDTH), bx = x * (MENU_FONT_WIDTH);
445
     if (inv) {
447
     if (inv) {
446
       u8g.setColorIndex(1);
448
       u8g.setColorIndex(1);
447
       u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1);
449
       u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1);
463
       if (mark_as_selected(row, sel)) {
465
       if (mark_as_selected(row, sel)) {
464
         if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);
466
         if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]);
465
         constexpr uint8_t maxlen = LCD_WIDTH - 1;
467
         constexpr uint8_t maxlen = LCD_WIDTH - 1;
466
-        const u8g_uint_t pixw = maxlen * (MENU_FONT_WIDTH);
467
-        u8g_uint_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
468
+        const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH);
469
+        pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw);
468
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
470
         while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
469
       }
471
       }
470
     }
472
     }

+ 11
- 17
Marlin/src/lcd/menu/menu_motion.cpp Voir le fichier

46
   #include "../../feature/bedlevel/bedlevel.h"
46
   #include "../../feature/bedlevel/bedlevel.h"
47
 #endif
47
 #endif
48
 
48
 
49
-extern millis_t manual_move_start_time;
50
-extern int8_t manual_move_axis;
51
 #if ENABLED(MANUAL_E_MOVES_RELATIVE)
49
 #if ENABLED(MANUAL_E_MOVES_RELATIVE)
52
   float manual_move_e_origin = 0;
50
   float manual_move_e_origin = 0;
53
 #endif
51
 #endif
54
-#if IS_KINEMATIC
55
-  extern float manual_move_offset;
56
-#endif
57
 
52
 
58
 //
53
 //
59
 // Tell ui.update() to start a move to current_position" after a short delay.
54
 // Tell ui.update() to start a move to current_position" after a short delay.
66
   #if MULTI_MANUAL
61
   #if MULTI_MANUAL
67
     if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
62
     if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
68
   #endif
63
   #endif
69
-  manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
70
-  manual_move_axis = (int8_t)axis;
64
+  ui.manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
65
+  ui.manual_move_axis = (int8_t)axis;
71
 }
66
 }
72
 
67
 
73
 //
68
 //
112
     // Get the new position
107
     // Get the new position
113
     const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
108
     const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
114
     #if IS_KINEMATIC
109
     #if IS_KINEMATIC
115
-      manual_move_offset += diff;
110
+      ui.manual_move_offset += diff;
116
       if (int32_t(ui.encoderPosition) < 0)
111
       if (int32_t(ui.encoderPosition) < 0)
117
-        NOLESS(manual_move_offset, min - current_position[axis]);
112
+        NOLESS(ui.manual_move_offset, min - current_position[axis]);
118
       else
113
       else
119
-        NOMORE(manual_move_offset, max - current_position[axis]);
114
+        NOMORE(ui.manual_move_offset, max - current_position[axis]);
120
     #else
115
     #else
121
       current_position[axis] += diff;
116
       current_position[axis] += diff;
122
       if (int32_t(ui.encoderPosition) < 0)
117
       if (int32_t(ui.encoderPosition) < 0)
130
   }
125
   }
131
   ui.encoderPosition = 0;
126
   ui.encoderPosition = 0;
132
   if (ui.should_draw()) {
127
   if (ui.should_draw()) {
133
-    const float pos = NATIVE_TO_LOGICAL(ui.processing_manual_move ? destination[axis] : current_position[axis]
134
-      #if IS_KINEMATIC
135
-        + manual_move_offset
136
-      #endif
137
-    , axis);
128
+    const float pos = NATIVE_TO_LOGICAL(
129
+      ui.processing_manual_move ? destination[axis] : current_position[axis] + TERN0(IS_KINEMATIC, ui.manual_move_offset),
130
+      axis
131
+    );
138
     MenuEditItemBase::draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
132
     MenuEditItemBase::draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
139
   }
133
   }
140
 }
134
 }
149
     if (ui.encoderPosition) {
143
     if (ui.encoderPosition) {
150
       if (!ui.processing_manual_move) {
144
       if (!ui.processing_manual_move) {
151
         const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
145
         const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale;
152
-        TERN(IS_KINEMATIC, manual_move_offset, current_position.e) += diff;
146
+        TERN(IS_KINEMATIC, ui.manual_move_offset, current_position.e) += diff;
153
         manual_move_to_current(E_AXIS
147
         manual_move_to_current(E_AXIS
154
           #if MULTI_MANUAL
148
           #if MULTI_MANUAL
155
             , eindex
149
             , eindex
166
       MenuEditItemBase::draw_edit_screen(
160
       MenuEditItemBase::draw_edit_screen(
167
         GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
161
         GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)),
168
         ftostr41sign(current_position.e
162
         ftostr41sign(current_position.e
169
-          + TERN0(IS_KINEMATIC, manual_move_offset)
163
+          + TERN0(IS_KINEMATIC, ui.manual_move_offset)
170
           - TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
164
           - TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin)
171
         )
165
         )
172
       );
166
       );

+ 7
- 17
Marlin/src/lcd/menu/menu_ubl.cpp Voir le fichier

31
 #include "menu.h"
31
 #include "menu.h"
32
 #include "../../gcode/gcode.h"
32
 #include "../../gcode/gcode.h"
33
 #include "../../gcode/queue.h"
33
 #include "../../gcode/queue.h"
34
+#include "../../module/motion.h"
34
 #include "../../module/planner.h"
35
 #include "../../module/planner.h"
35
 #include "../../module/configuration_store.h"
36
 #include "../../module/configuration_store.h"
36
 #include "../../feature/bedlevel/bedlevel.h"
37
 #include "../../feature/bedlevel/bedlevel.h"
356
 }
357
 }
357
 
358
 
358
 /**
359
 /**
359
- * UBL Load Mesh Command
360
+ * UBL Load / Save Mesh Commands
360
  */
361
  */
361
-void _lcd_ubl_load_mesh_cmd() {
362
+inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) {
362
   char ubl_lcd_gcode[40];
363
   char ubl_lcd_gcode[40];
363
-  sprintf_P(ubl_lcd_gcode, PSTR("G29 L%i\nM117 "), ubl_storage_slot);
364
-  sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], GET_TEXT(MSG_MESH_LOADED), ubl_storage_slot);
365
-  gcode.process_subcommands_now(ubl_lcd_gcode);
366
-}
367
-
368
-/**
369
- * UBL Save Mesh Command
370
- */
371
-void _lcd_ubl_save_mesh_cmd() {
372
-  char ubl_lcd_gcode[40];
373
-  sprintf_P(ubl_lcd_gcode, PSTR("G29 S%i\nM117 "), ubl_storage_slot);
374
-  sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], GET_TEXT(MSG_MESH_SAVED), ubl_storage_slot);
364
+  sprintf_P(ubl_lcd_gcode, PSTR("G29 %c%i\nM117 "), loadsave, ubl_storage_slot);
365
+  sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot);
375
   gcode.process_subcommands_now(ubl_lcd_gcode);
366
   gcode.process_subcommands_now(ubl_lcd_gcode);
376
 }
367
 }
368
+void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT(MSG_MESH_LOADED)); }
369
+void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT(MSG_MESH_SAVED)); }
377
 
370
 
378
 /**
371
 /**
379
  * UBL Mesh Storage submenu
372
  * UBL Mesh Storage submenu
444
 /**
437
 /**
445
  * UBL LCD "radar" map
438
  * UBL LCD "radar" map
446
  */
439
  */
447
-void set_current_from_steppers_for_axis(const AxisEnum axis);
448
-void sync_plan_position();
449
-
450
 void _lcd_ubl_output_map_lcd() {
440
 void _lcd_ubl_output_map_lcd() {
451
 
441
 
452
   static int16_t step_scaler = 0;
442
   static int16_t step_scaler = 0;

+ 5
- 5
Marlin/src/lcd/ultralcd.cpp Voir le fichier

637
 
637
 
638
 #if HAS_LCD_MENU
638
 #if HAS_LCD_MENU
639
 
639
 
640
-  int8_t manual_move_axis = (int8_t)NO_AXIS;
641
-  millis_t manual_move_start_time = 0;
640
+  int8_t MarlinUI::manual_move_axis = (int8_t)NO_AXIS;
641
+  millis_t MarlinUI::manual_move_start_time = 0;
642
 
642
 
643
   #if IS_KINEMATIC
643
   #if IS_KINEMATIC
644
     bool MarlinUI::processing_manual_move = false;
644
     bool MarlinUI::processing_manual_move = false;
645
-    float manual_move_offset = 0;
645
+    float MarlinUI::manual_move_offset = 0;
646
   #endif
646
   #endif
647
 
647
 
648
   #if MULTI_MANUAL
648
   #if MULTI_MANUAL
905
       }
905
       }
906
     #endif
906
     #endif
907
 
907
 
908
-    // then we want to use 1/2 of the time only.
909
-    uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
908
+    // Then we want to use only 50% of the time
909
+    const uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
910
 
910
 
911
     if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) {
911
     if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) {
912
 
912
 

+ 4
- 0
Marlin/src/lcd/ultralcd.h Voir le fichier

494
       static void enable_encoder_multiplier(const bool onoff);
494
       static void enable_encoder_multiplier(const bool onoff);
495
     #endif
495
     #endif
496
 
496
 
497
+    static int8_t manual_move_axis;
498
+    static millis_t manual_move_start_time;
499
+
497
     #if IS_KINEMATIC
500
     #if IS_KINEMATIC
501
+      static float manual_move_offset;
498
       static bool processing_manual_move;
502
       static bool processing_manual_move;
499
     #else
503
     #else
500
       static constexpr bool processing_manual_move = false;
504
       static constexpr bool processing_manual_move = false;

+ 1
- 1
Marlin/src/module/planner.cpp Voir le fichier

2039
   const uint8_t moves_queued = nonbusy_movesplanned();
2039
   const uint8_t moves_queued = nonbusy_movesplanned();
2040
 
2040
 
2041
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
2041
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
2042
-  #if EITHER(SLOWDOWN, ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
2042
+  #if EITHER(SLOWDOWN, HAS_SPI_LCD) || defined(XY_FREQUENCY_LIMIT)
2043
     // Segment time im micro seconds
2043
     // Segment time im micro seconds
2044
     int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
2044
     int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
2045
   #endif
2045
   #endif

Chargement…
Annuler
Enregistrer