Browse Source

Clean up LCD print, align (#15498)

ANMay-ru 4 years ago
parent
commit
b119c14017

+ 7
- 7
Marlin/src/lcd/menu/menu_mixer.cpp View File

53
       strcpy_P(tmp, GET_TEXT(MSG_START_Z));
53
       strcpy_P(tmp, GET_TEXT(MSG_START_Z));
54
       sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
54
       sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
55
       SETCURSOR(2, (LCD_HEIGHT - 1) / 2);
55
       SETCURSOR(2, (LCD_HEIGHT - 1) / 2);
56
-      LCDPRINT(tmp);
56
+      lcd_put_u8str(tmp);
57
     }
57
     }
58
 
58
 
59
     if (ui.lcd_clicked) {
59
     if (ui.lcd_clicked) {
79
       strcpy_P(tmp, GET_TEXT(MSG_END_Z));
79
       strcpy_P(tmp, GET_TEXT(MSG_END_Z));
80
       sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
80
       sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
81
       SETCURSOR(2, (LCD_HEIGHT - 1) / 2);
81
       SETCURSOR(2, (LCD_HEIGHT - 1) / 2);
82
-      LCDPRINT(tmp);
82
+      lcd_put_u8str(tmp);
83
     }
83
     }
84
 
84
 
85
     if (ui.lcd_clicked) {
85
     if (ui.lcd_clicked) {
106
     SUBMENU(MSG_START_Z, lcd_mixer_gradient_z_start_edit);
106
     SUBMENU(MSG_START_Z, lcd_mixer_gradient_z_start_edit);
107
     MENU_ITEM_ADDON_START(9);
107
     MENU_ITEM_ADDON_START(9);
108
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
108
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10);
109
-      LCDPRINT(tmp);
109
+      lcd_put_u8str(tmp);
110
     MENU_ITEM_ADDON_END();
110
     MENU_ITEM_ADDON_END();
111
 
111
 
112
     SUBMENU(MSG_END_Z, lcd_mixer_gradient_z_end_edit);
112
     SUBMENU(MSG_END_Z, lcd_mixer_gradient_z_end_edit);
113
     MENU_ITEM_ADDON_START(9);
113
     MENU_ITEM_ADDON_START(9);
114
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
114
       sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10);
115
-      LCDPRINT(tmp);
115
+      lcd_put_u8str(tmp);
116
     MENU_ITEM_ADDON_END();
116
     MENU_ITEM_ADDON_END();
117
 
117
 
118
     END_MENU();
118
     END_MENU();
129
     lcd_put_u8str_P(GET_TEXT(MSG_MIX));
129
     lcd_put_u8str_P(GET_TEXT(MSG_MIX));
130
     SETCURSOR(LCD_WIDTH - 9, y);
130
     SETCURSOR(LCD_WIDTH - 9, y);
131
     sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
131
     sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
132
-    LCDPRINT(tmp);
132
+    lcd_put_u8str(tmp);
133
   }
133
   }
134
 #endif
134
 #endif
135
 
135
 
283
     MENU_ITEM_ADDON_START(10);
283
     MENU_ITEM_ADDON_START(10);
284
       mixer.update_mix_from_vtool();
284
       mixer.update_mix_from_vtool();
285
       sprintf_P(tmp, PSTR("%3d;%3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
285
       sprintf_P(tmp, PSTR("%3d;%3d%%"), int(mixer.mix[0]), int(mixer.mix[1]));
286
-      LCDPRINT(tmp);
286
+      lcd_put_u8str(tmp);
287
     MENU_ITEM_ADDON_END();
287
     MENU_ITEM_ADDON_END();
288
     ACTION_ITEM(MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix);
288
     ACTION_ITEM(MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix);
289
   }
289
   }
299
     SUBMENU(MSG_GRADIENT, lcd_mixer_edit_gradient_menu);
299
     SUBMENU(MSG_GRADIENT, lcd_mixer_edit_gradient_menu);
300
     MENU_ITEM_ADDON_START(10);
300
     MENU_ITEM_ADDON_START(10);
301
       sprintf_P(tmp, PSTR("T%i->T%i"), mixer.gradient.start_vtool, mixer.gradient.end_vtool);
301
       sprintf_P(tmp, PSTR("T%i->T%i"), mixer.gradient.start_vtool, mixer.gradient.end_vtool);
302
-      LCDPRINT(tmp);
302
+      lcd_put_u8str(tmp);
303
     MENU_ITEM_ADDON_END();
303
     MENU_ITEM_ADDON_END();
304
     ACTION_ITEM(MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient);
304
     ACTION_ITEM(MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient);
305
   }
305
   }

+ 2
- 2
Marlin/src/lcd/menu/menu_motion.cpp View File

262
     SUBMENU(MSG_MOVE_01MM, [](){ _goto_manual_move( 0.1f); });
262
     SUBMENU(MSG_MOVE_01MM, [](){ _goto_manual_move( 0.1f); });
263
     if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
263
     if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
264
       SUBMENU_P(PSTR(""), []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
264
       SUBMENU_P(PSTR(""), []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
265
-      MENU_ITEM_ADDON_START(1);
265
+      MENU_ITEM_ADDON_START(0);
266
         char tmp[20], numstr[10];
266
         char tmp[20], numstr[10];
267
         // Determine digits needed right of decimal
267
         // Determine digits needed right of decimal
268
         const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
268
         const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
269
                              !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) *  100 - int((SHORT_MANUAL_Z_MOVE) *  100)) ? 3 : 2;
269
                              !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) *  100 - int((SHORT_MANUAL_Z_MOVE) *  100)) ? 3 : 2;
270
         sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
270
         sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
271
-        LCDPRINT(tmp);
271
+        lcd_put_u8str(tmp);
272
       MENU_ITEM_ADDON_END();
272
       MENU_ITEM_ADDON_END();
273
     }
273
     }
274
   }
274
   }

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

67
     #if HAS_GRAPHICAL_LCD
67
     #if HAS_GRAPHICAL_LCD
68
       #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT))
68
       #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT))
69
       #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT))
69
       #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT))
70
-      #define LCDPRINT(p) u8g.print(p)
71
-      #define LCDWRITE(c) u8g.print(c)
72
     #else
70
     #else
73
       #define SETCURSOR(col, row) lcd_moveto(col, row)
71
       #define SETCURSOR(col, row) lcd_moveto(col, row)
74
       #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row)
72
       #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row)
75
-      #define LCDPRINT(p) lcd_put_u8str(p)
76
-      #define LCDWRITE(c) lcd_put_wchar(c)
77
     #endif
73
     #endif
78
 
74
 
79
     #include "lcdprint.h"
75
     #include "lcdprint.h"

Loading…
Cancel
Save