|
@@ -74,12 +74,9 @@
|
74
|
74
|
#endif
|
75
|
75
|
#endif // SIMULATE_ROMFONT
|
76
|
76
|
|
77
|
|
-#define FONT_STATUSMENU_NAME FONT_MENU_NAME
|
78
|
|
-
|
79
|
|
-#define FONT_STATUSMENU 1
|
|
77
|
+#define FONT_MENU 1
|
80
|
78
|
#define FONT_SPECIAL 2
|
81
|
79
|
#define FONT_MENU_EDIT 3
|
82
|
|
-#define FONT_MENU 4
|
83
|
80
|
|
84
|
81
|
// DOGM parameters (size in pixels)
|
85
|
82
|
#define DOG_CHAR_WIDTH 6
|
|
@@ -137,7 +134,6 @@ char currentfont = 0;
|
137
|
134
|
|
138
|
135
|
static void lcd_setFont(char font_nr) {
|
139
|
136
|
switch(font_nr) {
|
140
|
|
- case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break;
|
141
|
137
|
case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break;
|
142
|
138
|
case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break;
|
143
|
139
|
case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break;
|
|
@@ -218,7 +214,7 @@ static void lcd_implementation_init()
|
218
|
214
|
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
|
219
|
215
|
u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
|
220
|
216
|
#endif
|
221
|
|
- } while(u8g.nextPage());
|
|
217
|
+ } while (u8g.nextPage());
|
222
|
218
|
}
|
223
|
219
|
|
224
|
220
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
|
@@ -227,7 +223,7 @@ static void _draw_heater_status(int x, int heater) {
|
227
|
223
|
bool isBed = heater < 0;
|
228
|
224
|
int y = 17 + (isBed ? 1 : 0);
|
229
|
225
|
|
230
|
|
- lcd_setFont(FONT_STATUSMENU);
|
|
226
|
+ lcd_setFont(FONT_MENU);
|
231
|
227
|
u8g.setPrintPos(x,7);
|
232
|
228
|
lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5)));
|
233
|
229
|
lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
|
|
@@ -252,7 +248,8 @@ static void lcd_implementation_status_screen() {
|
252
|
248
|
|
253
|
249
|
// Symbols menu graphics, animated fan
|
254
|
250
|
u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
|
255
|
|
-
|
|
251
|
+ lcd_setFont(FONT_MENU);
|
|
252
|
+
|
256
|
253
|
#ifdef SDSUPPORT
|
257
|
254
|
// SD Card Symbol
|
258
|
255
|
u8g.drawBox(42,42,8,7);
|
|
@@ -264,14 +261,12 @@ static void lcd_implementation_status_screen() {
|
264
|
261
|
u8g.drawFrame(54,49,73,4);
|
265
|
262
|
|
266
|
263
|
// SD Card Progress bar and clock
|
267
|
|
- lcd_setFont(FONT_STATUSMENU);
|
268
|
|
-
|
269
|
264
|
if (IS_SD_PRINTING) {
|
270
|
265
|
// Progress bar solid part
|
271
|
266
|
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2);
|
272
|
267
|
}
|
273
|
268
|
|
274
|
|
- u8g.setPrintPos(80,47);
|
|
269
|
+ u8g.setPrintPos(80,48);
|
275
|
270
|
if (starttime != 0) {
|
276
|
271
|
uint16_t time = (millis() - starttime) / 60000;
|
277
|
272
|
lcd_print(itostr2(time/60));
|
|
@@ -290,11 +285,11 @@ static void lcd_implementation_status_screen() {
|
290
|
285
|
if (EXTRUDERS < 4) _draw_heater_status(81, -1);
|
291
|
286
|
|
292
|
287
|
// Fan
|
293
|
|
- lcd_setFont(FONT_STATUSMENU);
|
294
|
288
|
u8g.setPrintPos(104,27);
|
295
|
289
|
#if defined(FAN_PIN) && FAN_PIN > -1
|
296
|
290
|
int per = ((fanSpeed + 1) * 100) / 256;
|
297
|
291
|
if (per) {
|
|
292
|
+
|
298
|
293
|
lcd_print(itostr3(per));
|
299
|
294
|
lcd_print('%');
|
300
|
295
|
}
|
|
@@ -305,50 +300,38 @@ static void lcd_implementation_status_screen() {
|
305
|
300
|
}
|
306
|
301
|
|
307
|
302
|
// X, Y, Z-Coordinates
|
308
|
|
- lcd_setFont(FONT_STATUSMENU);
|
309
|
|
- u8g.drawBox(0,29,128,10);
|
|
303
|
+ #define XYZ_BASELINE 38
|
|
304
|
+ u8g.drawBox(0,30,128,9);
|
310
|
305
|
u8g.setColorIndex(0); // white on black
|
311
|
|
- u8g.setPrintPos(2,37);
|
|
306
|
+ u8g.setPrintPos(2,XYZ_BASELINE);
|
312
|
307
|
lcd_print('X');
|
313
|
|
- u8g.drawPixel(8,33);
|
314
|
|
- u8g.drawPixel(8,35);
|
315
|
|
- u8g.setPrintPos(10,37);
|
|
308
|
+ u8g.drawPixel(8,XYZ_BASELINE - 5);
|
|
309
|
+ u8g.drawPixel(8,XYZ_BASELINE - 3);
|
|
310
|
+ u8g.setPrintPos(10,XYZ_BASELINE);
|
316
|
311
|
lcd_print(ftostr31ns(current_position[X_AXIS]));
|
317
|
|
- u8g.setPrintPos(43,37);
|
|
312
|
+ u8g.setPrintPos(43,XYZ_BASELINE);
|
318
|
313
|
lcd_print('Y');
|
319
|
|
- u8g.drawPixel(49,33);
|
320
|
|
- u8g.drawPixel(49,35);
|
321
|
|
- u8g.setPrintPos(51,37);
|
|
314
|
+ u8g.drawPixel(49,XYZ_BASELINE - 5);
|
|
315
|
+ u8g.drawPixel(49,XYZ_BASELINE - 3);
|
|
316
|
+ u8g.setPrintPos(51,XYZ_BASELINE);
|
322
|
317
|
lcd_print(ftostr31ns(current_position[Y_AXIS]));
|
323
|
|
- u8g.setPrintPos(83,37);
|
|
318
|
+ u8g.setPrintPos(83,XYZ_BASELINE);
|
324
|
319
|
lcd_print('Z');
|
325
|
|
- u8g.drawPixel(89,33);
|
326
|
|
- u8g.drawPixel(89,35);
|
327
|
|
- u8g.setPrintPos(91,37);
|
|
320
|
+ u8g.drawPixel(89,XYZ_BASELINE - 5);
|
|
321
|
+ u8g.drawPixel(89,XYZ_BASELINE - 3);
|
|
322
|
+ u8g.setPrintPos(91,XYZ_BASELINE);
|
328
|
323
|
lcd_print(ftostr31(current_position[Z_AXIS]));
|
329
|
324
|
u8g.setColorIndex(1); // black on white
|
330
|
325
|
|
331
|
326
|
// Feedrate
|
332
|
|
- lcd_setFont(FONT_MENU);
|
333
|
327
|
u8g.setPrintPos(3,49);
|
334
|
328
|
lcd_print(LCD_STR_FEEDRATE[0]);
|
335
|
|
- lcd_setFont(FONT_STATUSMENU);
|
336
|
|
- u8g.setPrintPos(12,48);
|
|
329
|
+ u8g.setPrintPos(12,49);
|
337
|
330
|
lcd_print(itostr3(feedmultiply));
|
338
|
331
|
lcd_print('%');
|
339
|
332
|
|
340
|
333
|
// Status line
|
341
|
|
-/* The new fonts are small enough
|
342
|
|
- #ifndef MAPPER_C2C3
|
343
|
|
- lcd_setFont(FONT_MENU);
|
344
|
|
- #else
|
345
|
|
- lcd_setFont(FONT_STATUSMENU);
|
346
|
|
- #endif
|
347
|
|
-*/
|
348
|
|
- lcd_setFont(FONT_MENU);
|
349
|
|
-
|
350
|
|
- u8g.setPrintPos(0,61);
|
351
|
|
-
|
|
334
|
+ u8g.setPrintPos(0,63);
|
352
|
335
|
#ifndef FILAMENT_LCD_DISPLAY
|
353
|
336
|
lcd_print(lcd_status_message);
|
354
|
337
|
#else
|
|
@@ -365,10 +348,10 @@ static void lcd_implementation_status_screen() {
|
365
|
348
|
#endif
|
366
|
349
|
}
|
367
|
350
|
|
368
|
|
-static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
|
369
|
|
- if ((pr_char == '>') || (pr_char == LCD_STR_UPLEVEL[0] )) {
|
|
351
|
+static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
352
|
+ if (isSelected) {
|
370
|
353
|
u8g.setColorIndex(1); // black on white
|
371
|
|
- u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
|
|
354
|
+ u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
|
372
|
355
|
u8g.setColorIndex(0); // following text must be white on black
|
373
|
356
|
}
|
374
|
357
|
else {
|
|
@@ -377,96 +360,78 @@ static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
|
377
|
360
|
u8g.setPrintPos(START_ROW * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
|
378
|
361
|
}
|
379
|
362
|
|
380
|
|
-static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
363
|
+static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
381
|
364
|
char c;
|
382
|
365
|
uint8_t n = LCD_WIDTH - 2;
|
383
|
366
|
|
384
|
|
- lcd_implementation_mark_as_selected(row, pre_char);
|
|
367
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
385
|
368
|
|
386
|
|
- while((c = pgm_read_byte(pstr))) {
|
|
369
|
+ while (c = pgm_read_byte(pstr)) {
|
387
|
370
|
n -= lcd_print(c);
|
388
|
371
|
pstr++;
|
389
|
372
|
}
|
390
|
|
- while(n--) lcd_print(' ');
|
|
373
|
+ while (n--) lcd_print(' ');
|
391
|
374
|
lcd_print(post_char);
|
392
|
375
|
lcd_print(' ');
|
393
|
376
|
}
|
394
|
377
|
|
395
|
|
-static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
|
|
378
|
+static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
396
|
379
|
char c;
|
397
|
380
|
uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
398
|
381
|
|
399
|
|
- lcd_implementation_mark_as_selected(row, pre_char);
|
|
382
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
400
|
383
|
|
401
|
|
- while( (c = pgm_read_byte(pstr))) {
|
|
384
|
+ while (c = pgm_read_byte(pstr)) {
|
402
|
385
|
n -= lcd_print(c);
|
403
|
386
|
pstr++;
|
404
|
387
|
}
|
405
|
388
|
lcd_print(':');
|
406
|
|
- while(n--) lcd_print(' ');
|
|
389
|
+ while (n--) lcd_print(' ');
|
407
|
390
|
if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); }
|
408
|
391
|
}
|
409
|
392
|
|
410
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, false)
|
411
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, true)
|
412
|
|
-
|
413
|
|
-#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
|
414
|
|
-#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
|
415
|
|
-#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
|
416
|
|
-#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
|
417
|
|
-#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
|
418
|
|
-#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
|
419
|
|
-#define lcd_implementation_drawmenu_setting_edit_float43_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
|
420
|
|
-#define lcd_implementation_drawmenu_setting_edit_float43(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
|
421
|
|
-#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
422
|
|
-#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
423
|
|
-#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
|
424
|
|
-#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
|
425
|
|
-#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
|
426
|
|
-#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
|
427
|
|
-#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
428
|
|
-#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
429
|
|
-#define lcd_implementation_drawmenu_setting_edit_bool_selected(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
430
|
|
-#define lcd_implementation_drawmenu_setting_edit_bool(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
|
393
|
+#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
|
394
|
+#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
|
395
|
+
|
|
396
|
+#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
|
397
|
+#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
|
398
|
+#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
|
399
|
+#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
|
|
400
|
+#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
|
|
401
|
+#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
|
|
402
|
+#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
|
|
403
|
+#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
|
|
404
|
+#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
431
|
405
|
|
432
|
406
|
//Add version for callback functions
|
433
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_int3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
|
434
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_int3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
|
435
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
|
436
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
|
437
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float32_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
|
438
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float32(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
|
439
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float43_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
|
440
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
|
441
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
442
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
443
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float52_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
|
444
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
|
445
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float51_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
|
446
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
|
447
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_long5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
448
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
449
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
450
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
|
407
|
+#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
|
408
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
|
409
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
|
410
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
|
|
411
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
|
|
412
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
|
|
413
|
+#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
|
|
414
|
+#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
|
|
415
|
+#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
451
|
416
|
|
452
|
417
|
void lcd_implementation_drawedit(const char* pstr, char* value) {
|
453
|
418
|
uint8_t rows = 1;
|
454
|
|
- uint8_t lcd_width = LCD_WIDTH;
|
455
|
|
- uint8_t char_width = DOG_CHAR_WIDTH;
|
|
419
|
+ uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
|
|
420
|
+ uint8_t vallen = lcd_strlen(value);
|
456
|
421
|
|
457
|
422
|
#ifdef USE_BIG_EDIT_FONT
|
458
|
423
|
if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
|
459
|
424
|
lcd_setFont(FONT_MENU_EDIT);
|
460
|
425
|
lcd_width = LCD_WIDTH_EDIT + 1;
|
461
|
426
|
char_width = DOG_CHAR_WIDTH_EDIT;
|
462
|
|
- if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2;
|
|
427
|
+ if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
|
463
|
428
|
}
|
464
|
429
|
else {
|
465
|
430
|
lcd_setFont(FONT_MENU);
|
466
|
431
|
}
|
467
|
432
|
#endif
|
468
|
433
|
|
469
|
|
- if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2;
|
|
434
|
+ if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
|
470
|
435
|
|
471
|
436
|
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
|
472
|
437
|
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
|
|
@@ -474,42 +439,36 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
|
474
|
439
|
u8g.setPrintPos(0, rowHeight + kHalfChar);
|
475
|
440
|
lcd_printPGM(pstr);
|
476
|
441
|
lcd_print(':');
|
477
|
|
- u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar);
|
|
442
|
+ u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
|
478
|
443
|
lcd_print(value);
|
479
|
444
|
}
|
480
|
445
|
|
481
|
|
-static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) {
|
|
446
|
+static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir) {
|
482
|
447
|
char c;
|
483
|
448
|
uint8_t n = LCD_WIDTH - 1;
|
484
|
449
|
|
485
|
|
- if (longFilename[0] != '\0') {
|
|
450
|
+ if (longFilename[0]) {
|
486
|
451
|
filename = longFilename;
|
487
|
452
|
longFilename[n] = '\0';
|
488
|
453
|
}
|
489
|
454
|
|
490
|
|
- lcd_implementation_mark_as_selected(row, ((isSelected) ? '>' : ' '));
|
|
455
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
491
|
456
|
|
492
|
457
|
if (isDir) lcd_print(LCD_STR_FOLDER[0]);
|
493
|
|
- while((c = *filename) != '\0') {
|
|
458
|
+ while (c = *filename) {
|
494
|
459
|
n -= lcd_print(c);
|
495
|
460
|
filename++;
|
496
|
461
|
}
|
497
|
|
- while(n--) lcd_print(' ');
|
|
462
|
+ while (n--) lcd_print(' ');
|
498
|
463
|
}
|
499
|
464
|
|
500
|
|
-#define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true)
|
501
|
|
-#define lcd_implementation_drawmenu_sdfile(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, false)
|
502
|
|
-#define lcd_implementation_drawmenu_sddirectory_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, true)
|
503
|
|
-#define lcd_implementation_drawmenu_sddirectory(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, false)
|
504
|
|
-
|
505
|
|
-#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
506
|
|
-#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
|
507
|
|
-#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
508
|
|
-#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
|
509
|
|
-#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
510
|
|
-#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
511
|
|
-#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
512
|
|
-#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
|
465
|
+#define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)
|
|
466
|
+#define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true)
|
|
467
|
+
|
|
468
|
+#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
469
|
+#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
470
|
+#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
471
|
+#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
513
|
472
|
|
514
|
473
|
static void lcd_implementation_quick_feedback() {
|
515
|
474
|
#if BEEPER > -1
|