Browse Source

Fixes and additions to FTDI EVE Touch UI (#20393)

- Fixed name conflict with "SUBSCRIPT_TWO"
- Fixed rendering bugs in "Leveling Menu"
- Only show "Bed Mesh Screen" when UBL is enabled
- Removed CocoaPress code from generic "Main Menu"
- Removed CocoaPress code from LulzBot Bio "Status" screen
- Moved generic "Move Axis" functionality into a base class
- Added CocoaPress custom screens:
   - Status Screen
   - Unload Cartridge
   - Load Chocolate
   - Main Menu
   - Advanced Settings
   - XYZ Move (based on "Move Axis" base class)
   - Extrusion Move (based on "Move Axis" base class)
- CocoaPress tweaks to "Temperature" screen
- Fix FTDI EVE Touch UI compilation errors when not using leveling.
Marcio T 4 years ago
parent
commit
f3bddc4e4e
No account linked to committer's email address
23 changed files with 1166 additions and 243 deletions
  1. 6
    6
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp
  2. 15
    9
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h
  3. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp
  4. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp
  5. 47
    130
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp
  6. 102
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp
  7. 101
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp
  8. 89
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp
  9. 62
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp
  10. 53
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp
  11. 51
    21
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp
  12. 64
    4
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp
  13. 307
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp
  14. 54
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h
  15. 101
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp
  16. 10
    7
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp
  17. 14
    24
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp
  18. 5
    5
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp
  19. 4
    0
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp
  20. 63
    26
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h
  21. 13
    6
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp
  22. 2
    2
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp
  23. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp

+ 6
- 6
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp View File

@@ -71,9 +71,9 @@
71 71
       YEN_SIGN,
72 72
     #endif
73 73
     #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
74
-      SUPERSCRIPT_ONE,
75
-      SUPERSCRIPT_TWO,
76
-      SUPERSCRIPT_THREE,
74
+      SUPERSCRIPT_1,
75
+      SUPERSCRIPT_2,
76
+      SUPERSCRIPT_3,
77 77
     #endif
78 78
     #if ENABLED(TOUCH_UI_UTF8_ORDINALS)
79 79
       MASCULINE_ORDINAL,
@@ -177,15 +177,15 @@
177 177
       {UTF8('±'),  0 , NOT_SIGN,           32   },
178 178
     #endif
179 179
     #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
180
-      {UTF8('²'),  0 , SUPERSCRIPT_TWO,    16   },
181
-      {UTF8('³'),  0 , SUPERSCRIPT_THREE,  16   },
180
+      {UTF8('²'),  0 , SUPERSCRIPT_2,    16   },
181
+      {UTF8('³'),  0 , SUPERSCRIPT_3,  16   },
182 182
     #endif
183 183
     #if ENABLED(TOUCH_UI_UTF8_SYMBOLS)
184 184
       {UTF8('µ'),  0 , MICRON_SIGN,        28   },
185 185
       {UTF8('¶'),  0 , PILCROW_SIGN,       24   },
186 186
     #endif
187 187
     #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
188
-      {UTF8('¹'),  0 , SUPERSCRIPT_ONE,    16   },
188
+      {UTF8('¹'),  0 , SUPERSCRIPT_1,    16   },
189 189
     #endif
190 190
     #if ENABLED(TOUCH_UI_UTF8_ORDINALS)
191 191
       {UTF8('º'),  0 , MASCULINE_ORDINAL,  19   },

+ 15
- 9
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h View File

@@ -29,12 +29,6 @@
29 29
   #define COPYRIGHT_SIGN    u8"(c)"
30 30
 #endif
31 31
 
32
-#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
33
-  #define SUPERSCRIPT_TWO   u8"²"
34
-#else
35
-  #define SUPERSCRIPT_TWO   u8"^2"
36
-#endif
37
-
38 32
 #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET)
39 33
   #define DEGREE_SIGN       u8"°"
40 34
 #else
@@ -162,9 +156,21 @@ namespace Language_en {
162 156
   #endif
163 157
 
164 158
   #ifdef TOUCH_UI_COCOA_PRESS
165
-    PROGMEM Language_Str MSG_ZONE_1                 = u8"Zone 1:";
166
-    PROGMEM Language_Str MSG_ZONE_2                 = u8"Zone 2:";
167
-    PROGMEM Language_Str MSG_ZONE_3                 = u8"Zone 3:";
159
+    PROGMEM Language_Str MSG_BODY                   = u8"Body";
160
+    PROGMEM Language_Str MSG_INTERNAL               = u8"Internal";
161
+    PROGMEM Language_Str MSG_EXTERNAL               = u8"External";
162
+    PROGMEM Language_Str MSG_CHOCOLATE              = u8"Chocolate";
163
+    PROGMEM Language_Str MSG_UNLOAD_CARTRIDGE       = u8"Unload Cartridge";
164
+    PROGMEM Language_Str MSG_LOAD_CHOCOLATE         = u8"Load Chocolate";
165
+    PROGMEM Language_Str MSG_CARTRIDGE_IN           = u8"Cartridge In";
166
+    PROGMEM Language_Str MSG_CARTRIDGE_OUT          = u8"Cartridge Out";
167
+    PROGMEM Language_Str MSG_PREHEAT_CHOCOLATE      = u8"Preheat Chocolate";
168 168
     PROGMEM Language_Str MSG_PREHEAT_FINISHED       = u8"Preheat finished";
169
+    PROGMEM Language_Str MSG_PREHEAT                = u8"Preheat";
170
+    PROGMEM Language_Str MSG_BUTTON_PAUSE           = u8"Pause";
171
+    PROGMEM Language_Str MSG_BUTTON_RESUME          = u8"Resume";
172
+    PROGMEM Language_Str MSG_ELAPSED_PRINT          = u8"Elapsed Print";
173
+    PROGMEM Language_Str MSG_XYZ_MOVE               = u8"XYZ Move";
174
+    PROGMEM Language_Str MSG_E_MOVE                 = u8"Extrusion Move";
169 175
   #endif
170 176
 }; // namespace Language_en

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../config.h"
24 24
 
25
-#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO)
25
+#if ENABLED(TOUCH_UI_FTDI_EVE) && NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
26 26
 
27 27
 #include "screens.h"
28 28
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp View File

@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "../config.h"
23 23
 
24
-#if BOTH(TOUCH_UI_FTDI_EVE, HAS_MESH)
24
+#if BOTH(TOUCH_UI_FTDI_EVE, AUTO_BED_LEVELING_UBL)
25 25
 
26 26
 #include "screens.h"
27 27
 #include "screen_data.h"

+ 47
- 130
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp View File

@@ -23,15 +23,13 @@
23 23
 
24 24
 #include "../config.h"
25 25
 
26
-#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
26
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO)
27 27
 
28 28
 #include "screens.h"
29 29
 
30 30
 #include "../ftdi_eve_lib/extras/poly_ui.h"
31 31
 
32
-#if ENABLED(TOUCH_UI_COCOA_PRESS)
33
-  #include "cocoa_press_ui.h"
34
-#elif ENABLED(TOUCH_UI_PORTRAIT)
32
+#if ENABLED(TOUCH_UI_PORTRAIT)
35 33
   #include "bio_printer_ui_portrait.h"
36 34
 #else
37 35
   #include "bio_printer_ui_landscape.h"
@@ -72,55 +70,30 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
72 70
   if (what & BACKGROUND) {
73 71
     cmd.cmd(COLOR_RGB(bg_color));
74 72
 
75
-    #if ENABLED(TOUCH_UI_LULZBOT_BIO)
76
-       // The LulzBot Bio shows the temperature for
77
-       // the bed.
78
-
79
-      #ifdef TOUCH_UI_PORTRAIT
80
-        // Draw touch surfaces
81
-        ui.bounds(POLY(target_temp), x, y, h, v);
82
-        cmd.rectangle(x, y, h, v);
83
-        ui.bounds(POLY(actual_temp), x, y, h, v);
84
-        cmd.rectangle(x, y, h, v);
85
-      #else
86
-        ui.bounds(POLY(bed_temp), x, y, h, v);
87
-        cmd.rectangle(x, y, h, v);
88
-      #endif
89
-      ui.bounds(POLY(bed_icon), x, y, h, v);
90
-      cmd.rectangle(x, y, h, v);
91
-
92
-      // Draw bed icon
93
-      cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info))
94
-         .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info))
95
-         .cmd(BITMAP_SIZE  (Bed_Heat_Icon_Info))
96
-         .cmd(COLOR_RGB(shadow_rgb))
97
-         .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2)
98
-         .cmd(COLOR_RGB(bg_text_enabled))
99
-         .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2);
100
-    #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT)
101
-      // The CocoaPress shows the temperature for two
102
-      // heating zones, but has no bed temperature
103
-
104
-      cmd.cmd(COLOR_RGB(bg_text_enabled));
105
-      cmd.font(font_xsmall);
73
+    // The LulzBot Bio shows the temperature for
74
+    // the bed.
106 75
 
107
-      ui.bounds(POLY(h0_label), x, y, h, v);
108
-      cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_1));
109
-
110
-      ui.bounds(POLY(h1_label), x, y, h, v);
111
-      cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_2));
112
-
113
-      ui.bounds(POLY(h2_label), x, y, h, v);
114
-      cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_3));
115
-
116
-      ui.bounds(POLY(h3_label), x, y, h, v);
117
-      cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER));
76
+    #ifdef TOUCH_UI_PORTRAIT
77
+      // Draw touch surfaces
78
+      ui.bounds(POLY(target_temp), x, y, h, v);
79
+      cmd.rectangle(x, y, h, v);
80
+      ui.bounds(POLY(actual_temp), x, y, h, v);
81
+      cmd.rectangle(x, y, h, v);
118 82
     #else
119
-      UNUSED(x);
120
-      UNUSED(y);
121
-      UNUSED(h);
122
-      UNUSED(v);
83
+      ui.bounds(POLY(bed_temp), x, y, h, v);
84
+      cmd.rectangle(x, y, h, v);
123 85
     #endif
86
+    ui.bounds(POLY(bed_icon), x, y, h, v);
87
+    cmd.rectangle(x, y, h, v);
88
+
89
+    // Draw bed icon
90
+    cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info))
91
+       .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info))
92
+       .cmd(BITMAP_SIZE  (Bed_Heat_Icon_Info))
93
+       .cmd(COLOR_RGB(shadow_rgb))
94
+       .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2)
95
+       .cmd(COLOR_RGB(bg_text_enabled))
96
+       .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2);
124 97
 
125 98
     #ifdef TOUCH_UI_USE_UTF8
126 99
       load_utf8_bitmaps(cmd); // Restore font bitmap handles
@@ -130,71 +103,29 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
130 103
   if (what & FOREGROUND) {
131 104
     char str[15];
132 105
     cmd.cmd(COLOR_RGB(bg_text_enabled));
133
-    #if ENABLED(TOUCH_UI_LULZBOT_BIO)
134
-      cmd.font(font_medium);
135
-
136
-      #ifdef TOUCH_UI_PORTRAIT
137
-        if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0)
138
-          format_temp(str, getTargetTemp_celsius(BED));
139
-        else
140
-          strcpy_P(str, GET_TEXT(MSG_BED));
141
-
142
-        ui.bounds(POLY(target_temp), x, y, h, v);
143
-        cmd.text(x, y, h, v, str);
144
-
145
-        format_temp(str, getActualTemp_celsius(BED));
146
-        ui.bounds(POLY(actual_temp), x, y, h, v);
147
-        cmd.text(x, y, h, v, str);
148
-      #else
149
-        if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0)
150
-          format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED));
151
-        else
152
-          format_temp_and_idle(str, getActualTemp_celsius(BED));
153
-
154
-        ui.bounds(POLY(bed_temp), x, y, h, v);
155
-        cmd.text(x, y, h, v, str);
156
-      #endif
157
-
158
-    #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT)
159
-      // The CocoaPress shows the temperature for two
160
-      // heating zones, but has no bed temperature
161
-
162
-      cmd.font(font_large);
163
-
164
-      if (!isHeaterIdle(E0) && getTargetTemp_celsius(E0) > 0)
165
-        format_temp_and_temp(str, getActualTemp_celsius(E0), getTargetTemp_celsius(E0));
166
-      else
167
-        format_temp_and_idle(str, getActualTemp_celsius(E0));
106
+    cmd.font(font_medium);
168 107
 
169
-      ui.bounds(POLY(h0_temp), x, y, h, v);
170
-      cmd.text(x, y, h, v, str);
171
-
172
-      if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0)
173
-        format_temp_and_temp(str, getActualTemp_celsius(E1), getTargetTemp_celsius(E1));
108
+    #ifdef TOUCH_UI_PORTRAIT
109
+      if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0)
110
+        format_temp(str, getTargetTemp_celsius(BED));
174 111
       else
175
-        format_temp_and_idle(str, getActualTemp_celsius(E1));
112
+        strcpy_P(str, GET_TEXT(MSG_BED));
176 113
 
177
-      ui.bounds(POLY(h1_temp), x, y, h, v);
114
+      ui.bounds(POLY(target_temp), x, y, h, v);
178 115
       cmd.text(x, y, h, v, str);
179 116
 
180
-      if (!isHeaterIdle(E2) && getTargetTemp_celsius(E2) > 0)
181
-        format_temp_and_temp(str, getActualTemp_celsius(E2), getTargetTemp_celsius(E2));
182
-      else
183
-        format_temp_and_idle(str, getActualTemp_celsius(E2));
184
-
185
-      ui.bounds(POLY(h2_temp), x, y, h, v);
117
+      format_temp(str, getActualTemp_celsius(BED));
118
+      ui.bounds(POLY(actual_temp), x, y, h, v);
186 119
       cmd.text(x, y, h, v, str);
187
-
188
-      if (!isHeaterIdle(CHAMBER) && getTargetTemp_celsius(CHAMBER) > 0)
189
-        format_temp_and_temp(str, getActualTemp_celsius(CHAMBER), getTargetTemp_celsius(CHAMBER));
120
+    #else
121
+      if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0)
122
+        format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED));
190 123
       else
191
-        format_temp_and_idle(str, getActualTemp_celsius(CHAMBER));
124
+        format_temp_and_idle(str, getActualTemp_celsius(BED));
192 125
 
193
-      ui.bounds(POLY(h3_temp), x, y, h, v);
126
+      ui.bounds(POLY(bed_temp), x, y, h, v);
194 127
       cmd.text(x, y, h, v, str);
195
-    #else
196
-      UNUSED(str);
197
-    #endif
128
+      #endif
198 129
   }
199 130
 }
200 131
 
@@ -207,7 +138,7 @@ void StatusScreen::draw_syringe(draw_mode_t what) {
207 138
       0.75
208 139
     #endif
209 140
   );
210
-  const bool e_homed = TERN0(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0));
141
+  const bool e_homed = TERN1(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0));
211 142
 
212 143
   CommandProcessor cmd;
213 144
   PolyUI ui(cmd, what);
@@ -247,7 +178,7 @@ void StatusScreen::draw_arrows(draw_mode_t what) {
247 178
   ui.button_stroke(stroke_rgb, 28);
248 179
   ui.button_shadow(shadow_rgb, shadow_depth);
249 180
 
250
-  constexpr uint8_t style = TERN(TOUCH_UI_COCOA_PRESS, PolyUI::FILL | PolyUI::SHADOW, PolyUI::REGULAR);
181
+  constexpr uint8_t style = PolyUI::REGULAR;
251 182
 
252 183
   if ((what & BACKGROUND) || jog_xy) {
253 184
     ui.button(1, POLY(x_neg), style);
@@ -262,9 +193,7 @@ void StatusScreen::draw_arrows(draw_mode_t what) {
262 193
   }
263 194
 
264 195
   if ((what & BACKGROUND) || e_homed) {
265
-    #if DISABLED(TOUCH_UI_COCOA_PRESS)
266
-      ui.button(7, POLY(e_neg), style);
267
-    #endif
196
+    ui.button(7, POLY(e_neg), style);
268 197
     ui.button(8, POLY(e_pos), style);
269 198
   }
270 199
 }
@@ -304,11 +233,11 @@ void StatusScreen::draw_overlay_icons(draw_mode_t what) {
304 233
   PolyUI ui(cmd, what);
305 234
 
306 235
   if (what & FOREGROUND) {
307
-    ui.button_fill  (TERN(TOUCH_UI_COCOA_PRESS, stroke_rgb, fill_rgb));
236
+    ui.button_fill  (fill_rgb);
308 237
     ui.button_stroke(stroke_rgb, 28);
309 238
     ui.button_shadow(shadow_rgb, shadow_depth);
310 239
 
311
-    constexpr uint8_t style = TERN(TOUCH_UI_COCOA_PRESS, PolyUI::FILL | PolyUI::SHADOW, PolyUI::REGULAR);
240
+    constexpr uint8_t style = PolyUI::REGULAR;
312 241
     if (!jog_xy)  ui.button(12, POLY(padlock), style);
313 242
     if (!e_homed) ui.button(13, POLY(home_e), style);
314 243
     if (!z_homed) ui.button(14, POLY(home_z), style);
@@ -389,9 +318,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
389 318
       break;
390 319
     case  9: GOTO_SCREEN(FilesScreen); break;
391 320
     case 10: GOTO_SCREEN(MainMenu); break;
392
-    #if ENABLED(TOUCH_UI_LULZBOT_BIO)
393
-      case 13: GOTO_SCREEN(BioConfirmHomeE); break;
394
-    #endif
321
+    case 13: GOTO_SCREEN(BioConfirmHomeE); break;
395 322
     case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break;
396 323
     case 15: GOTO_SCREEN(TemperatureScreen);  break;
397 324
     case 16: fine_motion = !fine_motion; break;
@@ -431,19 +358,11 @@ bool StatusScreen::onTouchHeld(uint8_t tag) {
431 358
 }
432 359
 
433 360
 void StatusScreen::setStatusMessage(progmem_str pstr) {
434
-  #ifdef TOUCH_UI_LULZBOT_BIO
435
-    BioPrintingDialogBox::setStatusMessage(pstr);
436
-  #else
437
-    UNUSED(pstr);
438
-  #endif
361
+  BioPrintingDialogBox::setStatusMessage(pstr);
439 362
 }
440 363
 
441 364
 void StatusScreen::setStatusMessage(const char * const str) {
442
-  #ifdef TOUCH_UI_LULZBOT_BIO
443
-    BioPrintingDialogBox::setStatusMessage(str);
444
-  #else
445
-    UNUSED(str);
446
-  #endif
365
+  BioPrintingDialogBox::setStatusMessage(str);
447 366
 }
448 367
 
449 368
 void StatusScreen::onIdle() {
@@ -451,10 +370,8 @@ void StatusScreen::onIdle() {
451 370
   if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
452 371
     if (!EventLoop::is_touch_held())
453 372
       onRefresh();
454
-    #ifdef TOUCH_UI_LULZBOT_BIO
455
-      if (isPrintingFromMedia())
456
-        BioPrintingDialogBox::show();
457
-    #endif
373
+    if (isPrintingFromMedia())
374
+      BioPrintingDialogBox::show();
458 375
     refresh_timer.start();
459 376
   }
460 377
 }

+ 102
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp View File

@@ -0,0 +1,102 @@
1
+/*****************************************
2
+ * cocoa_press_advance_settings_menu.cpp *
3
+ *****************************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *                                                                          *
9
+ *   This program is free software: you can redistribute it and/or modify   *
10
+ *   it under the terms of the GNU General Public License as published by   *
11
+ *   the Free Software Foundation, either version 3 of the License, or      *
12
+ *   (at your option) any later version.                                    *
13
+ *                                                                          *
14
+ *   This program is distributed in the hope that it will be useful,        *
15
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
16
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
17
+ *   GNU General Public License for more details.                           *
18
+ *                                                                          *
19
+ *   To view a copy of the GNU General Public License, go to the following  *
20
+ *   location: <https://www.gnu.org/licenses/>.                              *
21
+ ****************************************************************************/
22
+
23
+#include "../config.h"
24
+
25
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS)
26
+
27
+#include "screens.h"
28
+
29
+using namespace FTDI;
30
+using namespace ExtUI;
31
+using namespace Theme;
32
+
33
+#define GRID_ROWS 4
34
+#define GRID_COLS 3
35
+#define STEPS_PER_MM_POS        BTN_POS(1,1), BTN_SIZE(1,1)
36
+#define TMC_CURRENT_POS         BTN_POS(2,1), BTN_SIZE(1,1)
37
+#define LIN_ADVANCE_POS         BTN_POS(3,1), BTN_SIZE(1,1)
38
+#define VELOCITY_POS            BTN_POS(1,2), BTN_SIZE(1,1)
39
+#define ACCELERATION_POS        BTN_POS(2,2), BTN_SIZE(1,1)
40
+#define JERK_POS                BTN_POS(3,2), BTN_SIZE(1,1)
41
+#define DISPLAY_POS             BTN_POS(1,3), BTN_SIZE(1,1)
42
+#define INTERFACE_POS           BTN_POS(2,3), BTN_SIZE(1,1)
43
+#define ENDSTOPS_POS            BTN_POS(3,3), BTN_SIZE(1,1)
44
+#define CASE_LIGHT_POS          BTN_POS(1,4), BTN_SIZE(1,1)
45
+#define RESTORE_DEFAULTS_POS    BTN_POS(2,4), BTN_SIZE(1,1)
46
+#define BACK_POS                BTN_POS(3,4), BTN_SIZE(1,1)
47
+
48
+void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
49
+  if (what & BACKGROUND) {
50
+    CommandProcessor cmd;
51
+    cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
52
+       .cmd(CLEAR(true,true,true));
53
+  }
54
+
55
+  if (what & FOREGROUND) {
56
+    CommandProcessor cmd;
57
+    cmd.colors(normal_btn)
58
+       .font(Theme::font_medium)
59
+      .tag(2) .button( STEPS_PER_MM_POS,       GET_TEXT_F(MSG_STEPS_PER_MM))
60
+      .enabled(ENABLED(HAS_TRINAMIC_CONFIG))
61
+      .tag(3) .button( TMC_CURRENT_POS,        GET_TEXT_F(MSG_TMC_CURRENT))
62
+      .enabled(ENABLED(LIN_ADVANCE))
63
+      .tag(4) .button(LIN_ADVANCE_POS,         GET_TEXT_F(MSG_LINEAR_ADVANCE))
64
+      .tag(5) .button( VELOCITY_POS,           GET_TEXT_F(MSG_VELOCITY))
65
+      .tag(6) .button( ACCELERATION_POS,       GET_TEXT_F(MSG_ACCELERATION))
66
+      .tag(7) .button( JERK_POS,               GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK)))
67
+      .tag(8) .button( ENDSTOPS_POS,           GET_TEXT_F(MSG_LCD_ENDSTOPS))
68
+      .tag(9) .button( INTERFACE_POS,          GET_TEXT_F(MSG_INTERFACE))
69
+      .tag(10).button( DISPLAY_POS,            GET_TEXT_F(MSG_DISPLAY_MENU))
70
+      .enabled(ENABLED(CASE_LIGHT_ENABLE))
71
+      .tag(11).button( CASE_LIGHT_POS,         GET_TEXT_F(MSG_CASE_LIGHT))
72
+      .tag(12).button( RESTORE_DEFAULTS_POS,   GET_TEXT_F(MSG_RESTORE_DEFAULTS))
73
+      .colors(action_btn)
74
+      .tag(1).button( BACK_POS,                GET_TEXT_F(MSG_BACK));
75
+  }
76
+}
77
+
78
+bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
79
+  switch (tag) {
80
+    case  1: SaveSettingsDialogBox::promptToSaveSettings(); break;
81
+    case  2: GOTO_SCREEN(StepsScreen); break;
82
+    #if HAS_TRINAMIC_CONFIG
83
+    case  3: GOTO_SCREEN(StepperCurrentScreen); break;
84
+    #endif
85
+    #if ENABLED(LIN_ADVANCE)
86
+    case  4: GOTO_SCREEN(LinearAdvanceScreen);  break;
87
+    #endif
88
+    case  5: GOTO_SCREEN(MaxVelocityScreen); break;
89
+    case  6: GOTO_SCREEN(DefaultAccelerationScreen);  break;
90
+    case  7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break;
91
+    case  8: GOTO_SCREEN(EndstopStatesScreen); break;
92
+    case  9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
93
+    case 10: GOTO_SCREEN(DisplayTuningScreen); break;
94
+    #if ENABLED(CASE_LIGHT_ENABLE)
95
+    case 11: GOTO_SCREEN(CaseLightScreen); break;
96
+    #endif
97
+    case 12: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
98
+    default: return false;
99
+  }
100
+  return true;
101
+}
102
+#endif // TOUCH_UI_FTDI_EVE

+ 101
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp View File

@@ -0,0 +1,101 @@
1
+/************************************
2
+ * cocoa_press_unload_cartridge.cpp *
3
+ ************************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2020 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if ENABLED(TOUCH_UI_FTDI_EVE) && ENABLED(TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+#include "screen_data.h"
30
+
31
+using namespace ExtUI;
32
+using namespace FTDI;
33
+using namespace Theme;
34
+
35
+#define GRID_COLS 2
36
+#define GRID_ROWS 6
37
+
38
+#define TITLE_POS             BTN_POS(1,1), BTN_SIZE(2,1)
39
+#define DESCRIPTION_POS       BTN_POS(1,2), BTN_SIZE(2,3)
40
+#define CARTRIDGE_OUT_BTN_POS BTN_POS(1,5), BTN_SIZE(1,1)
41
+#define CARTRIDGE_IN_BTN_POS  BTN_POS(2,5), BTN_SIZE(1,1)
42
+#define BACK_BTN_POS          BTN_POS(1,6), BTN_SIZE(2,1)
43
+
44
+void LoadChocolateScreen::onRedraw(draw_mode_t what) {
45
+  CommandProcessor cmd;
46
+
47
+  if (what & BACKGROUND) {
48
+    cmd.cmd(CLEAR_COLOR_RGB(bg_color))
49
+       .cmd(CLEAR(true,true,true))
50
+       .cmd(COLOR_RGB(bg_text_enabled))
51
+       .tag(0)
52
+       .font(font_large)
53
+       .text(TITLE_POS, GET_TEXT_F(MSG_LOAD_CHOCOLATE));
54
+       draw_text_box(cmd, DESCRIPTION_POS, F(
55
+        "Drop your chocolate refill into the cartridge. "
56
+        "Press and hold the Cartridge Out button until "
57
+        "the plunger adapter is visible at the bottom of "
58
+        "the extruder. Securely attach a red plunger to "
59
+        "the plunger adapter and load the cartridge onto "
60
+        "the plunger. Press and hold Cartridge In button "
61
+        "until cartridge is fully loaded into the extruder, "
62
+        "and use the buttons to help follow the locking path "
63
+        "to lock"),
64
+        OPT_CENTERY, font_medium);
65
+  }
66
+
67
+  if (what & FOREGROUND) {
68
+    cmd.font(font_medium)
69
+       .colors(normal_btn)
70
+       .tag(2).button(CARTRIDGE_OUT_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_OUT))
71
+       .tag(3).button(CARTRIDGE_IN_BTN_POS,  GET_TEXT_F(MSG_CARTRIDGE_IN))
72
+              .colors(action_btn)
73
+       .tag(1).button(BACK_BTN_POS,    GET_TEXT_F(MSG_BACK));
74
+  }
75
+}
76
+
77
+bool LoadChocolateScreen::onTouchEnd(uint8_t tag) {
78
+  using namespace ExtUI;
79
+  switch (tag) {
80
+    case 1: GOTO_PREVIOUS(); break;
81
+  }
82
+  return true;
83
+}
84
+
85
+bool LoadChocolateScreen::onTouchHeld(uint8_t tag) {
86
+  if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate
87
+  constexpr float increment = 0.25;
88
+  MoveAxisScreen::setManualFeedrate(E0, increment);
89
+  #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis);
90
+  #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis);
91
+  switch (tag) {
92
+    case 2: UI_DECREMENT_AXIS(E0); break;
93
+    case 3: UI_INCREMENT_AXIS(E0); break;
94
+    default: return false;
95
+  }
96
+  #undef UI_DECREMENT_AXIS
97
+  #undef UI_INCREMENT_AXIS
98
+  return false;
99
+}
100
+
101
+#endif // TOUCH_UI_FTDI_EVE

+ 89
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp View File

@@ -0,0 +1,89 @@
1
+/*****************************
2
+ * cocoa_press_main_menu.cpp *
3
+ *****************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2019 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+
30
+using namespace FTDI;
31
+using namespace Theme;
32
+
33
+#define GRID_ROWS 4
34
+#define GRID_COLS 2
35
+
36
+#define MOVE_XYZ_POS          BTN_POS(1,1), BTN_SIZE(1,1)
37
+#define TEMPERATURE_POS       BTN_POS(2,1), BTN_SIZE(1,1)
38
+#define ZPROBE_ZOFFSET_POS    BTN_POS(1,2), BTN_SIZE(1,1)
39
+#define MOVE_E_POS            BTN_POS(2,2), BTN_SIZE(1,1)
40
+#define SPEED_POS             BTN_POS(1,3), BTN_SIZE(1,1)
41
+#define ADVANCED_SETTINGS_POS BTN_POS(2,3), BTN_SIZE(1,1)
42
+#define ABOUT_PRINTER_POS     BTN_POS(1,4), BTN_SIZE(1,1)
43
+#define BACK_POS              BTN_POS(2,4), BTN_SIZE(1,1)
44
+
45
+void MainMenu::onRedraw(draw_mode_t what) {
46
+  if (what & BACKGROUND) {
47
+    CommandProcessor cmd;
48
+    cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
49
+       .cmd(CLEAR(true,true,true));
50
+  }
51
+
52
+  if (what & FOREGROUND) {
53
+    CommandProcessor cmd;
54
+    cmd.colors(normal_btn)
55
+       .font(Theme::font_medium)
56
+       .tag(2).button( MOVE_XYZ_POS,          GET_TEXT_F(MSG_XYZ_MOVE))
57
+       .tag(3).button( TEMPERATURE_POS,       GET_TEXT_F(MSG_TEMPERATURE))
58
+       .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE))
59
+       .tag(4).button( ZPROBE_ZOFFSET_POS,    GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
60
+       .tag(5).button( MOVE_E_POS,            GET_TEXT_F(MSG_E_MOVE))
61
+       .tag(6).button( SPEED_POS,             GET_TEXT_F(MSG_PRINT_SPEED))
62
+       .tag(7).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
63
+       .tag(8).button( ABOUT_PRINTER_POS,     GET_TEXT_F(MSG_INFO_MENU))
64
+       .colors(action_btn)
65
+       .tag(1).button( BACK_POS,              GET_TEXT_F(MSG_BACK));
66
+  }
67
+}
68
+
69
+bool MainMenu::onTouchEnd(uint8_t tag) {
70
+  using namespace ExtUI;
71
+
72
+  switch (tag) {
73
+    case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
74
+    case 2: GOTO_SCREEN(MoveXYZScreen);                    break;
75
+    case 3: GOTO_SCREEN(TemperatureScreen);                break;
76
+    #if BOTH(HAS_LEVELING, HAS_BED_PROBE)
77
+    case 4: GOTO_SCREEN(ZOffsetScreen);                    break;
78
+    #endif
79
+    case 5: GOTO_SCREEN(MoveEScreen);                      break;
80
+    case 6: GOTO_SCREEN(FeedratePercentScreen);            break;
81
+    case 7: GOTO_SCREEN(AdvancedSettingsMenu);             break;
82
+    case 8: GOTO_SCREEN(AboutScreen);                      break;
83
+    default:
84
+      return false;
85
+  }
86
+  return true;
87
+}
88
+
89
+#endif // TOUCH_UI_FTDI_EVE

+ 62
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp View File

@@ -0,0 +1,62 @@
1
+/*********************************
2
+ * cocoa_press_move_e_screen.cpp *
3
+ *********************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2019 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+#include "screen_data.h"
30
+
31
+using namespace FTDI;
32
+using namespace ExtUI;
33
+
34
+void MoveEScreen::onRedraw(draw_mode_t what) {
35
+  widgets_t w(what);
36
+  w.precision(1);
37
+  w.units(GET_TEXT_F(MSG_UNITS_MM));
38
+  w.heading(                           GET_TEXT_F(MSG_E_MOVE));
39
+  w.color(Theme::e_axis);
40
+  #if EXTRUDERS == 1
41
+    w.adjuster(  8, GET_TEXT_F(MSG_AXIS_E),  screen_data.MoveAxisScreen.e_rel[0], canMove(E0));
42
+  #elif HAS_MULTI_EXTRUDER
43
+    w.adjuster(  8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0));
44
+    w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1));
45
+    #if EXTRUDERS > 2
46
+      w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxisScreen.e_rel[2], canMove(E2));
47
+    #endif
48
+    #if EXTRUDERS > 3
49
+      w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxisScreen.e_rel[3], canMove(E3));
50
+    #endif
51
+  #endif
52
+  w.increments();
53
+}
54
+
55
+void MoveEScreen::onIdle() {
56
+  if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
57
+    onRefresh();
58
+    refresh_timer.start();
59
+  }
60
+  BaseScreen::onIdle();
61
+}
62
+#endif // TOUCH_UI_FTDI_EVE

+ 53
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp View File

@@ -0,0 +1,53 @@
1
+/************************************
2
+ * cocoa_press_move_xyz_screen.cpp *
3
+ ************************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2019 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+#include "screen_data.h"
30
+
31
+using namespace FTDI;
32
+using namespace ExtUI;
33
+
34
+void MoveXYZScreen::onRedraw(draw_mode_t what) {
35
+  widgets_t w(what);
36
+  w.precision(1);
37
+  w.units(GET_TEXT_F(MSG_UNITS_MM));
38
+  w.heading(                           GET_TEXT_F(MSG_XYZ_MOVE));
39
+  w.home_buttons(20);
40
+  w.color(Theme::x_axis).adjuster(  2, GET_TEXT_F(MSG_AXIS_X),  getAxisPosition_mm(X), canMove(X));
41
+  w.color(Theme::y_axis).adjuster(  4, GET_TEXT_F(MSG_AXIS_Y),  getAxisPosition_mm(Y), canMove(Y));
42
+  w.color(Theme::z_axis).adjuster(  6, GET_TEXT_F(MSG_AXIS_Z),  getAxisPosition_mm(Z), canMove(Z));
43
+  w.increments();
44
+}
45
+
46
+void MoveXYZScreen::onIdle() {
47
+  if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
48
+    onRefresh();
49
+    refresh_timer.start();
50
+  }
51
+  BaseScreen::onIdle();
52
+}
53
+#endif // TOUCH_UI_FTDI_EVE

Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp → Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp View File

@@ -1,6 +1,6 @@
1
-/********************
2
- * preheat_menu.cpp *
3
- ********************/
1
+/********************************
2
+ * cocoa_press_preheat_menu.cpp *
3
+ ********************************/
4 4
 
5 5
 /****************************************************************************
6 6
  *   Written By Marcio Teixeira 2020 - Cocoa Press                          *
@@ -29,28 +29,40 @@ using namespace FTDI;
29 29
 using namespace ExtUI;
30 30
 using namespace Theme;
31 31
 
32
+#define GRID_ROWS 5
33
+#define GRID_COLS 2
34
+
32 35
 void PreheatMenu::onRedraw(draw_mode_t what) {
36
+  const int16_t w = has_extra_heater() ? BTN_W(1) : BTN_W(2);
37
+  const int16_t h = BTN_H(1);
38
+
33 39
   if (what & BACKGROUND) {
34 40
     CommandProcessor cmd;
35 41
     cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
36 42
        .cmd(CLEAR(true,true,true))
37
-       .tag(0);
43
+       .tag(0)
44
+       .cmd(COLOR_RGB(bg_text_enabled))
45
+       .font(Theme::font_medium)
46
+       .text  ( BTN_POS(1,1), w, h, GET_TEXT_F(MSG_INTERNAL));
47
+    if (has_extra_heater()) {
48
+        cmd.text( BTN_POS(2,1), w, h, GET_TEXT_F(MSG_EXTERNAL));
49
+    }
38 50
   }
39 51
 
40
-  #define GRID_ROWS 3
41
-  #define GRID_COLS 2
42
-
43 52
   if (what & FOREGROUND) {
44 53
     CommandProcessor cmd;
45
-    cmd.cmd(COLOR_RGB(bg_text_enabled))
46
-       .font(Theme::font_medium)
47
-       .text  ( BTN_POS(1,1),  BTN_SIZE(2,1), GET_TEXT_F(MSG_PREHEAT_1))
54
+    cmd.font(Theme::font_medium)
48 55
        .colors(normal_btn)
49
-       .tag(2).button( BTN_POS(1,2),  BTN_SIZE(1,1), F("Dark Chocolate"))
50
-       .tag(3).button( BTN_POS(2,2),  BTN_SIZE(1,1), F("Milk Chocolate"))
51
-       .tag(4).button( BTN_POS(1,3),  BTN_SIZE(1,1), F("White Chocolate"))
52
-       .colors(action_btn)
53
-       .tag(1) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
56
+       .tag(2).button( BTN_POS(1,2), w, h, F("Dark Chocolate"))
57
+       .tag(3).button( BTN_POS(1,3), w, h, F("Milk Chocolate"))
58
+       .tag(4).button( BTN_POS(1,4), w, h, F("White Chocolate"));
59
+    if (has_extra_heater()) {
60
+        cmd.tag(5).button( BTN_POS(2,2), w, h, F("Dark Chocolate"))
61
+           .tag(6).button( BTN_POS(2,3), w, h, F("Milk Chocolate"))
62
+           .tag(7).button( BTN_POS(2,4), w, h, F("White Chocolate"));
63
+    }
64
+    cmd.colors(action_btn)
65
+       .tag(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
54 66
   }
55 67
 }
56 68
 
@@ -58,20 +70,38 @@ bool PreheatMenu::onTouchEnd(uint8_t tag) {
58 70
   switch (tag) {
59 71
     case 1: GOTO_PREVIOUS();                   break;
60 72
     case 2:
61
-      #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT
62
-        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT));
73
+      #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT
74
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT));
63 75
       #endif
64 76
       GOTO_SCREEN(PreheatTimerScreen);
65 77
       break;
66 78
     case 3:
67
-      #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT
68
-        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT));
79
+      #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT
80
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT));
69 81
       #endif
70 82
       GOTO_SCREEN(PreheatTimerScreen);
71 83
       break;
72 84
     case 4:
73
-      #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT
74
-        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT));
85
+      #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT
86
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT));
87
+      #endif
88
+      GOTO_SCREEN(PreheatTimerScreen);
89
+      break;
90
+    case 5:
91
+      #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT
92
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT));
93
+      #endif
94
+      GOTO_SCREEN(PreheatTimerScreen);
95
+      break;
96
+    case 6:
97
+      #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT
98
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT));
99
+      #endif
100
+      GOTO_SCREEN(PreheatTimerScreen);
101
+      break;
102
+    case 7:
103
+      #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT
104
+        injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT));
75 105
       #endif
76 106
       GOTO_SCREEN(PreheatTimerScreen);
77 107
       break;

Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp → Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp View File

@@ -33,7 +33,14 @@ using namespace ExtUI;
33 33
 using namespace Theme;
34 34
 
35 35
 #define GRID_COLS 2
36
-#define GRID_ROWS 5
36
+#define GRID_ROWS 8
37
+
38
+#define HEADER_POS      BTN_POS(2,1), BTN_SIZE(1,2)
39
+#define NOZZLE_ADJ_POS  BTN_POS(2,3), BTN_SIZE(1,2)
40
+#define BODY_ADJ_POS    BTN_POS(2,5), BTN_SIZE(1,2)
41
+#define CHAMBER_ADJ_POS BTN_POS(2,7), BTN_SIZE(1,2)
42
+#define PROGRESS_POS    BTN_POS(1,1), BTN_SIZE(1,7)
43
+#define BACK_POS        BTN_POS(1,8), BTN_SIZE(1,1)
37 44
 
38 45
 void PreheatTimerScreen::draw_message(draw_mode_t what) {
39 46
   if (what & BACKGROUND) {
@@ -42,7 +49,7 @@ void PreheatTimerScreen::draw_message(draw_mode_t what) {
42 49
        .cmd(CLEAR(true,true,true))
43 50
        .cmd(COLOR_RGB(bg_text_enabled))
44 51
        .tag(0);
45
-    draw_text_box(cmd, BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large);
52
+    draw_text_box(cmd, HEADER_POS, GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large);
46 53
   }
47 54
 }
48 55
 
@@ -62,7 +69,7 @@ void PreheatTimerScreen::draw_time_remaining(draw_mode_t what) {
62 69
 
63 70
     CommandProcessor cmd;
64 71
     cmd.font(font_xlarge);
65
-    draw_circular_progress(cmd, BTN_POS(1,1), BTN_SIZE(1,5), float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest);
72
+    draw_circular_progress(cmd, PROGRESS_POS, float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest);
66 73
   }
67 74
 }
68 75
 
@@ -71,10 +78,45 @@ void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) {
71 78
     CommandProcessor cmd;
72 79
     cmd.colors(normal_btn)
73 80
        .font(font_medium)
74
-       .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Cancel"));
81
+       .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK));
75 82
   }
76 83
 }
77 84
 
85
+void PreheatTimerScreen::draw_adjuster(draw_mode_t what, uint8_t tag, progmem_str label, float value, int16_t x, int16_t y, int16_t w, int16_t h) {
86
+    #define SUB_COLS          9
87
+    #define SUB_ROWS          2
88
+    #define SUB_GRID_W(W)     ((W)*w/SUB_COLS)
89
+    #define SUB_GRID_H(H)     ((H)*h/SUB_ROWS)
90
+    #define SUB_GRID_X(X)     (SUB_GRID_W((X)-1) + x)
91
+    #define SUB_GRID_Y(Y)     (SUB_GRID_H((Y)-1) + y)
92
+    #define SUB_X(X)          (SUB_GRID_X(X) + MARGIN_L)
93
+    #define SUB_Y(Y)          (SUB_GRID_Y(Y) + MARGIN_T)
94
+    #define SUB_W(W)          (SUB_GRID_W(W) - MARGIN_L - MARGIN_R)
95
+    #define SUB_H(H)          (SUB_GRID_H(H) - MARGIN_T - MARGIN_B)
96
+    #define SUB_POS(X,Y)      SUB_X(X), SUB_Y(Y)
97
+    #define SUB_SIZE(W,H)     SUB_W(W), SUB_H(H)
98
+
99
+    CommandProcessor cmd;
100
+    cmd.tag(0)
101
+       .font(font_small);
102
+    if (what & BACKGROUND) {
103
+        cmd.text(   SUB_POS(1,1), SUB_SIZE(9,1), label)
104
+           .button( SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT);
105
+    }
106
+
107
+    if (what & FOREGROUND) {
108
+        char str[32];
109
+        dtostrf(value, 5, 1, str);
110
+        strcat_P(str, PSTR(" "));
111
+        strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C));
112
+
113
+        cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str)
114
+           .font(font_medium)
115
+           .tag(tag  ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-"))
116
+           .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+"));
117
+    }
118
+}
119
+
78 120
 void PreheatTimerScreen::onEntry() {
79 121
   screen_data.PreheatTimerScreen.start_ms = millis();
80 122
 }
@@ -83,6 +125,24 @@ void PreheatTimerScreen::onRedraw(draw_mode_t what) {
83 125
   draw_message(what);
84 126
   draw_time_remaining(what);
85 127
   draw_interaction_buttons(what);
128
+  draw_adjuster(what, 1, GET_TEXT_F(MSG_NOZZLE),  getTargetTemp_celsius(E0),      NOZZLE_ADJ_POS);
129
+  draw_adjuster(what, 3, GET_TEXT_F(MSG_BODY),    getTargetTemp_celsius(E1),      BODY_ADJ_POS);
130
+  draw_adjuster(what, 5, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS);
131
+}
132
+
133
+bool PreheatTimerScreen::onTouchHeld(uint8_t tag) {
134
+  const float increment = (tag == 5 || tag == 6) ? 1 : 0.1;
135
+  switch (tag) {
136
+    case 1: UI_DECREMENT(TargetTemp_celsius, E0); break;
137
+    case 2: UI_INCREMENT(TargetTemp_celsius, E0); break;
138
+    case 3: UI_DECREMENT(TargetTemp_celsius, E1); break;
139
+    case 4: UI_INCREMENT(TargetTemp_celsius, E1); break;
140
+    case 5: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break;
141
+    case 6: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break;
142
+    default:
143
+      return false;
144
+  }
145
+  return true;
86 146
 }
87 147
 
88 148
 bool PreheatTimerScreen::onTouchEnd(uint8_t tag) {

+ 307
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp View File

@@ -0,0 +1,307 @@
1
+/*********************************
2
+ * cocoa_press_status_screen.cpp *
3
+ *********************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2019 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+
30
+#include "../ftdi_eve_lib/extras/poly_ui.h"
31
+
32
+#include "cocoa_press_ui.h"
33
+
34
+#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0]))
35
+
36
+const uint8_t shadow_depth = 5;
37
+
38
+using namespace FTDI;
39
+using namespace Theme;
40
+using namespace ExtUI;
41
+
42
+float StatusScreen::increment;
43
+
44
+void StatusScreen::loadBitmaps() {
45
+  constexpr uint32_t base = ftdi_memory_map::RAM_G;
46
+
47
+  // Load fonts for internationalization
48
+  #ifdef TOUCH_UI_USE_UTF8
49
+    load_utf8_data(base + UTF8_FONT_OFFSET);
50
+  #endif
51
+}
52
+
53
+void StatusScreen::draw_progress(draw_mode_t what) {
54
+  CommandProcessor cmd;
55
+  PolyUI ui(cmd, what);
56
+
57
+  int16_t x, y, h, v;
58
+
59
+  cmd.cmd(COLOR_RGB(accent_color_1));
60
+  cmd.font(font_medium);
61
+
62
+  if (what & BACKGROUND) {
63
+    ui.bounds(POLY(print_time_label), x, y, h, v);
64
+    cmd.text(x, y, h, v, GET_TEXT_F(MSG_ELAPSED_PRINT));
65
+  }
66
+
67
+  if (what & FOREGROUND) {
68
+    const uint32_t elapsed = getProgress_seconds_elapsed();
69
+    const uint8_t hrs = elapsed/3600;
70
+    const uint8_t min = (elapsed/60)%60;
71
+
72
+    char str[10];
73
+    sprintf_P(str, PSTR(" %02d : %02d"), hrs, min);
74
+    ui.bounds(POLY(print_time_hms), x, y, h, v);
75
+    cmd.text(x, y, h, v, str);
76
+
77
+    sprintf_P(str, PSTR("%-3d%%"), getProgress_percent() );
78
+    ui.bounds(POLY(print_time_percent), x, y, h, v);
79
+    cmd.text(x, y, h, v, str);
80
+  }
81
+}
82
+
83
+void StatusScreen::draw_temperature(draw_mode_t what) {
84
+  CommandProcessor cmd;
85
+  PolyUI ui(cmd, what);
86
+
87
+  int16_t x, y, h, v;
88
+
89
+  if (what & BACKGROUND) {
90
+    cmd.cmd(COLOR_RGB(bg_color));
91
+
92
+    cmd.cmd(COLOR_RGB(fluid_rgb));
93
+    cmd.font(font_medium);
94
+
95
+    ui.bounds(POLY(chocolate_label), x, y, h, v);
96
+    cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHOCOLATE));
97
+
98
+    ui.bounds(POLY(h0_label), x, y, h, v);
99
+    cmd.text(x, y, h, v, GET_TEXT_F(MSG_NOZZLE));
100
+
101
+    ui.bounds(POLY(h1_label), x, y, h, v);
102
+    cmd.text(x, y, h, v, GET_TEXT_F(MSG_BODY));
103
+
104
+    #if ENABLED(COCOA_PRESS_EXTRA_HEATER)
105
+      if (has_extra_heater()) {
106
+        ui.bounds(POLY(h2_label), x, y, h, v);
107
+        cmd.text(x, y, h, v, GET_TEXT_F(MSG_EXTERNAL));
108
+      }
109
+    #endif
110
+
111
+    ui.bounds(POLY(h3_label), x, y, h, v);
112
+    cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER));
113
+
114
+    #ifdef TOUCH_UI_USE_UTF8
115
+      load_utf8_bitmaps(cmd); // Restore font bitmap handles
116
+    #endif
117
+  }
118
+
119
+  if (what & FOREGROUND) {
120
+    char str[15];
121
+    cmd.cmd(COLOR_RGB(fluid_rgb));
122
+
123
+    cmd.font(font_large);
124
+
125
+    format_temp(str, getActualTemp_celsius(E0));
126
+    ui.bounds(POLY(h0_temp), x, y, h, v);
127
+    cmd.text(x, y, h, v, str);
128
+
129
+    format_temp(str, getActualTemp_celsius(E1));
130
+    ui.bounds(POLY(h1_temp), x, y, h, v);
131
+    cmd.text(x, y, h, v, str);
132
+
133
+    #if ENABLED(COCOA_PRESS_EXTRA_HEATER)
134
+      if (has_extra_heater()) {
135
+        format_temp(str, getActualTemp_celsius(E2));
136
+        ui.bounds(POLY(h2_temp), x, y, h, v);
137
+        cmd.text(x, y, h, v, str);
138
+      }
139
+    #endif
140
+
141
+    format_temp(str, getActualTemp_celsius(CHAMBER));
142
+    ui.bounds(POLY(h3_temp), x, y, h, v);
143
+    cmd.text(x, y, h, v, str);
144
+  }
145
+}
146
+
147
+void StatusScreen::draw_syringe(draw_mode_t what) {
148
+  #if NUM_SERVOS < 2
149
+    // Note, this requires a new pin 108 to be added to to access ADC9
150
+    // "ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/variant.cpp"
151
+    const int val = analogRead(108);
152
+    const float fill_level = float(val) / 1024;
153
+  #else
154
+    constexpr float fill_level = 1.0f;
155
+  #endif
156
+
157
+  CommandProcessor cmd;
158
+  PolyUI ui(cmd, what);
159
+
160
+  if (what & BACKGROUND) {
161
+    // Paint the shadow for the syringe
162
+    ui.color(shadow_rgb);
163
+    ui.shadow(POLY(syringe_outline), shadow_depth);
164
+  }
165
+
166
+  if (what & FOREGROUND) {
167
+    int16_t x, y, h, v;
168
+
169
+    // Paint the syringe icon
170
+    ui.color(syringe_rgb);
171
+    ui.fill(POLY(syringe_outline));
172
+
173
+    ui.color(fluid_rgb);
174
+    ui.bounds(POLY(syringe_fluid), x, y, h, v);
175
+    cmd.cmd(SAVE_CONTEXT());
176
+    cmd.cmd(SCISSOR_XY(x,y + v * (1.0 - fill_level)));
177
+    cmd.cmd(SCISSOR_SIZE(h,  v *        fill_level));
178
+    ui.fill(POLY(syringe_fluid), false);
179
+    cmd.cmd(RESTORE_CONTEXT());
180
+
181
+    ui.color(stroke_rgb);
182
+    ui.fill(POLY(syringe));
183
+  }
184
+}
185
+
186
+void StatusScreen::draw_buttons(draw_mode_t what) {
187
+  int16_t x, y, h, v;
188
+
189
+  const bool can_print        = isMediaInserted() && !isPrintingFromMedia();
190
+  const bool sdOrHostPrinting = ExtUI::isPrinting();
191
+  const bool sdOrHostPaused   = ExtUI::isPrintingPaused();
192
+
193
+  CommandProcessor cmd;
194
+  PolyUI ui(cmd, what);
195
+
196
+  ui.bounds(POLY(unload_cartridge_btn), x, y, h, v);
197
+
198
+  cmd.font(font_medium).colors(normal_btn);
199
+
200
+  ui.bounds(POLY(unload_cartridge_btn), x, y, h, v);
201
+  cmd.tag(1).button(x, y, h, v, GET_TEXT_F(MSG_UNLOAD_CARTRIDGE));
202
+
203
+  ui.bounds(POLY(load_chocolate_btn), x, y, h, v);
204
+  cmd.tag(2).button(x, y, h, v, GET_TEXT_F(MSG_LOAD_CHOCOLATE));
205
+
206
+  ui.bounds(POLY(preheat_chocolate_btn), x, y, h, v);
207
+  cmd.tag(3).button(x, y, h, v, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE));
208
+
209
+  ui.bounds(POLY(menu_btn), x, y, h, v);
210
+  cmd.tag(4).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_MENU));
211
+
212
+  ui.bounds(POLY(pause_btn), x, y, h, v);
213
+  cmd.tag(sdOrHostPaused ? 6 : 5).enabled(sdOrHostPrinting).button(x, y, h, v, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE));
214
+
215
+  ui.bounds(POLY(stop_btn), x, y, h, v);
216
+  cmd.tag(7).enabled(sdOrHostPrinting).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_STOP));
217
+
218
+  ui.bounds(POLY(extrude_btn), x, y, h, v);
219
+  cmd.tag(8).button(x, y, h, v, GET_TEXT_F(MSG_EXTRUDE));
220
+
221
+  ui.bounds(POLY(print_btn), x, y, h, v);
222
+  cmd.tag(9).colors(action_btn).enabled(can_print).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_PRINT));
223
+}
224
+
225
+void StatusScreen::onRedraw(draw_mode_t what) {
226
+  if (what & BACKGROUND) {
227
+    CommandProcessor cmd;
228
+    cmd.cmd(CLEAR_COLOR_RGB(bg_color))
229
+       .cmd(CLEAR(true,true,true))
230
+       .tag(0);
231
+  }
232
+
233
+  draw_progress(what);
234
+  draw_syringe(what);
235
+  draw_temperature(what);
236
+  draw_buttons(what);
237
+}
238
+
239
+bool StatusScreen::onTouchStart(uint8_t) {
240
+  increment = 0;
241
+  return true;
242
+}
243
+
244
+bool StatusScreen::onTouchEnd(uint8_t tag) {
245
+  switch (tag) {
246
+    case  1: GOTO_SCREEN(UnloadCartridgeScreen); break;
247
+    case  2: GOTO_SCREEN(LoadChocolateScreen); break;
248
+    case  3: GOTO_SCREEN(PreheatMenu); break;
249
+    case  4: GOTO_SCREEN(MainMenu); break;
250
+    case  5:
251
+      sound.play(twinkle, PLAY_ASYNCHRONOUS);
252
+      if (ExtUI::isPrintingFromMedia())
253
+        ExtUI::pausePrint();
254
+      #ifdef ACTION_ON_PAUSE
255
+        else host_action_pause();
256
+      #endif
257
+      GOTO_SCREEN(StatusScreen);
258
+      break;
259
+    case  6:
260
+      sound.play(twinkle, PLAY_ASYNCHRONOUS);
261
+      if (ExtUI::isPrintingFromMedia())
262
+        ExtUI::resumePrint();
263
+      #ifdef ACTION_ON_RESUME
264
+        else host_action_resume();
265
+      #endif
266
+      GOTO_SCREEN(StatusScreen);
267
+      break;
268
+    case  7:
269
+      GOTO_SCREEN(ConfirmAbortPrintDialogBox);
270
+      current_screen.forget();
271
+      PUSH_SCREEN(StatusScreen);
272
+      break;
273
+    case  9: GOTO_SCREEN(FilesScreen); break;
274
+    default: return false;
275
+  }
276
+  // If a passcode is enabled, the LockScreen will prevent the
277
+  // user from proceeding.
278
+  LockScreen::check_passcode();
279
+  return true;
280
+}
281
+
282
+bool StatusScreen::onTouchHeld(uint8_t tag) {
283
+  if (tag == 8 && !ExtUI::isMoving()) {
284
+    increment = 0.05;
285
+    MoveAxisScreen::setManualFeedrate(E0, increment);
286
+    UI_INCREMENT(AxisPosition_mm, E0);
287
+    current_screen.onRefresh();
288
+  }
289
+  return false;
290
+}
291
+
292
+void StatusScreen::setStatusMessage(progmem_str) {
293
+}
294
+
295
+void StatusScreen::setStatusMessage(const char * const) {
296
+}
297
+
298
+void StatusScreen::onIdle() {
299
+  reset_menu_timeout();
300
+  if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
301
+    if (!EventLoop::is_touch_held())
302
+      onRefresh();
303
+    refresh_timer.start();
304
+  }
305
+}
306
+
307
+#endif // TOUCH_UI_FTDI_EVE

+ 54
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h View File

@@ -0,0 +1,54 @@
1
+
2
+/****************************************************************************
3
+ *   This program is free software: you can redistribute it and/or modify   *
4
+ *   it under the terms of the GNU General Public License as published by   *
5
+ *   the Free Software Foundation, either version 3 of the License, or      *
6
+ *   (at your option) any later version.                                    *
7
+ *                                                                          *
8
+ *   This program is distributed in the hope that it will be useful,        *
9
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
10
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
11
+ *   GNU General Public License for more details.                           *
12
+ *                                                                          *
13
+ *   To view a copy of the GNU General Public License, go to the following  *
14
+ *   location: <https://www.gnu.org/licenses/>.                              *
15
+ ****************************************************************************/
16
+
17
+/**
18
+ * This file was auto-generated using "svg2cpp.py"
19
+ *
20
+ * The encoding consists of x,y pairs with the min and max scaled to
21
+ * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the
22
+ * start of a new closed path.
23
+ */
24
+
25
+#pragma once
26
+
27
+constexpr float x_min = 0.000000;
28
+constexpr float x_max = 480.000000;
29
+constexpr float y_min = 0.000000;
30
+constexpr float y_max = 272.000000;
31
+
32
+const PROGMEM uint16_t syringe_outline[] = {0xED96, 0x14F0, 0xE65D, 0x10E9, 0xDED2, 0x0F9C, 0xD74B, 0x110E, 0xD01B, 0x1543, 0xCE80, 0x1836, 0xCE0A, 0x1C3A, 0xCE0F, 0x27AD, 0xCF0A, 0x2BD3, 0xD127, 0x2E5B, 0xD2A1, 0x2FF0, 0xD2A2, 0x9FC9, 0xD407, 0xA97A, 0xD7B9, 0xB10C, 0xD7BF, 0xBB58, 0xD978, 0xC2BE, 0xDD55, 0xC6EB, 0xDD58, 0xD159, 0xDE3B, 0xD3A8, 0xDFCF, 0xD3AF, 0xE0B8, 0xD04C, 0xE0B8, 0xC6EB, 0xE4A7, 0xC299, 0xE652, 0xBAF6, 0xE652, 0xB10C, 0xEA2E, 0xA8EA, 0xEB6C, 0x9E86, 0xEB6C, 0x2F58, 0xEF3C, 0x2B4E, 0xF003, 0x2583, 0xEFFD, 0x1AC2, 0xED96, 0x14F0, 0xED96, 0x14F0};
33
+const PROGMEM uint16_t syringe_fluid[] = {0xDE73, 0x2512, 0xDA0C, 0x261D, 0xD5B8, 0x29A0, 0xD4AE, 0x2D87, 0xD4AE, 0x9F60, 0xD585, 0xA63B, 0xDE44, 0xA9DE, 0xE32A, 0xA942, 0xE7E3, 0xA6A5, 0xE930, 0xA342, 0xE95D, 0x9C1D, 0xE95B, 0x31B8, 0xE955, 0x2B63, 0xE867, 0x2A67, 0xE790, 0x28DE, 0xE342, 0x25CB, 0xDE73, 0x2512};
34
+const PROGMEM uint16_t syringe[] = {0xED91, 0x1502, 0xE658, 0x10FB, 0xDECE, 0x0FAE, 0xD746, 0x1120, 0xD016, 0x1555, 0xCE7B, 0x1848, 0xCE05, 0x1C4D, 0xCE0A, 0x27BF, 0xCF05, 0x2BE5, 0xD122, 0x2E6E, 0xD29C, 0x3002, 0xD29D, 0x9FDB, 0xD402, 0xA98C, 0xD7B4, 0xB11F, 0xD7BA, 0xBB6A, 0xD973, 0xC2D1, 0xDD50, 0xC6FD, 0xDD53, 0xD16C, 0xDE36, 0xD3BA, 0xDFCA, 0xD3C2, 0xE0B3, 0xD05E, 0xE0B3, 0xC6FD, 0xE4A2, 0xC2AB, 0xE64D, 0xBB09, 0xE64D, 0xB11F, 0xEA29, 0xA8FC, 0xEB67, 0x9E98, 0xEB67, 0x2F6B, 0xEF37, 0x2B60, 0xEFFE, 0x2595, 0xEFF8, 0x1AD5, 0xED91, 0x1502, 0xED91, 0x1502, 0xFFFF, 0xD1CF, 0x1A7E, 0xD84F, 0x16DB, 0xDF19, 0x15A9, 0xE5E0, 0x16EA, 0xEC5B, 0x1AA4, 0xEC9D, 0x1D34, 0xEC9D, 0x20CC, 0xE5F1, 0x1D41, 0xDF02, 0x1C12, 0xD812, 0x1D41, 0xD166, 0x20CC, 0xD16C, 0x1B45, 0xD1CF, 0x1A7E, 0xFFFF, 0xE3BD, 0xACFD, 0xDE8E, 0xAF4F, 0xD988, 0xAC0F, 0xD7CC, 0xA8CD, 0xDD1C, 0xAAA9, 0xE287, 0xAA5B, 0xE655, 0xA8BE, 0xE3BD, 0xACFD, 0xFFFF, 0xE802, 0x2DC5, 0xE809, 0x343C, 0xE808, 0x9FC8, 0xE7E3, 0xA296, 0xE70D, 0xA4B1, 0xE2C9, 0xA70E, 0xDE4E, 0xA790, 0xD6A1, 0xA457, 0xD5FF, 0x9F2B, 0xD5FF, 0x2DFD, 0xD6B2, 0x2B72, 0xDA78, 0x2861, 0xDE9D, 0x276F, 0xE300, 0x2824, 0xE70D, 0x2B13, 0xE7FF, 0x2DB6, 0xE800, 0x2DC5, 0xE802, 0x2DC5, 0xFFFF, 0xE2ED, 0xBA8B, 0xE1CC, 0xBF52, 0xDF1C, 0xC165, 0xDC64, 0xBF99, 0xDB1B, 0xBAFF, 0xDB19, 0xB433, 0xDF04, 0xB552, 0xE2EF, 0xB438, 0xE2ED, 0xBA8B, 0xFFFF, 0xEC09, 0x2893, 0xE925, 0x2A08, 0xE57D, 0x261D, 0xE149, 0x246F, 0xDBDE, 0x24A0, 0xD6BC, 0x2795, 0xD484, 0x2A46, 0xD1C0, 0x2853, 0xD166, 0x251E, 0xD80D, 0x2151, 0xDF02, 0x200C, 0xE5F6, 0x2151, 0xEC9D, 0x251E, 0xEC09, 0x2893};
35
+const PROGMEM uint16_t unload_cartridge_btn[] = {0x0AAA, 0x0E1E, 0x57FF, 0x0E1E, 0x57FF, 0x33C3, 0x0AAA, 0x33C3, 0x0AAA, 0x0E1E};
36
+const PROGMEM uint16_t pause_btn[] = {0x47FF, 0xCA58, 0x7FFF, 0xCA58, 0x7FFF, 0xEFFE, 0x47FF, 0xEFFE, 0x47FF, 0xCA58};
37
+const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAA, 0x3D2C, 0x57FF, 0x3D2C, 0x57FF, 0x62D2, 0x0AAA, 0x62D2, 0x0AAA, 0x3D2C};
38
+const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAA, 0x6C3B, 0x57FF, 0x6C3B, 0x57FF, 0x91E0, 0x0AAA, 0x91E0, 0x0AAA, 0x6C3B};
39
+const PROGMEM uint16_t menu_btn[] = {0x0AAA, 0x9B4A, 0x57FF, 0x9B4A, 0x57FF, 0xC0EF, 0x0AAA, 0xC0EF, 0x0AAA, 0x9B4A};
40
+const PROGMEM uint16_t print_btn[] = {0x0AAA, 0xCA58, 0x42AA, 0xCA58, 0x42AA, 0xEFFE, 0x0AAA, 0xEFFE, 0x0AAA, 0xCA58};
41
+const PROGMEM uint16_t stop_btn[] = {0x8554, 0xCA58, 0xBD53, 0xCA58, 0xBD53, 0xEFFE, 0x8554, 0xEFFE, 0x8554, 0xCA58};
42
+const PROGMEM uint16_t print_time_hms[] = {0x62A9, 0xA968, 0x8FFE, 0xA968, 0x8FFE, 0xC0EF, 0x62A9, 0xC0EF, 0x62A9, 0xA968};
43
+const PROGMEM uint16_t print_time_percent[] = {0x8FFE, 0xA968, 0xBD53, 0xA968, 0xBD53, 0xC0EF, 0x8FFE, 0xC0EF, 0x8FFE, 0xA968};
44
+const PROGMEM uint16_t print_time_label[] = {0x62A9, 0x91E0, 0xBD53, 0x91E0, 0xBD53, 0xA986, 0x62A9, 0xA986, 0x62A9, 0x91E0};
45
+const PROGMEM uint16_t h3_temp[] = {0x62A9, 0x75A4, 0x8FFE, 0x75A4, 0x8FFE, 0x8D2C, 0x62A9, 0x8D2C, 0x62A9, 0x75A4};
46
+const PROGMEM uint16_t h3_label[] = {0x62A9, 0x5E1D, 0x8FFE, 0x5E1D, 0x8FFE, 0x75A4, 0x62A9, 0x75A4, 0x62A9, 0x5E1D};
47
+const PROGMEM uint16_t chocolate_label[] = {0x62A9, 0x12D2, 0xBD53, 0x12D2, 0xBD53, 0x2A5A, 0x62A9, 0x2A5A, 0x62A9, 0x12D2};
48
+const PROGMEM uint16_t h0_label[] = {0x62A9, 0x2A5A, 0x8FFE, 0x2A5A, 0x8FFE, 0x41E1, 0x62A9, 0x41E1, 0x62A9, 0x2A5A};
49
+const PROGMEM uint16_t h0_temp[] = {0x62A9, 0x41E1, 0x8FFE, 0x41E1, 0x8FFE, 0x5968, 0x62A9, 0x5968, 0x62A9, 0x41E1};
50
+const PROGMEM uint16_t h1_label[] = {0x8FFE, 0x2A5A, 0xBD53, 0x2A5A, 0xBD53, 0x41E1, 0x8FFE, 0x41E1, 0x8FFE, 0x2A5A};
51
+const PROGMEM uint16_t h1_temp[] = {0x8FFE, 0x41E1, 0xBD53, 0x41E1, 0xBD53, 0x5968, 0x8FFE, 0x5968, 0x8FFE, 0x41E1};
52
+const PROGMEM uint16_t extrude_btn[] = {0xC859, 0xDD2B, 0xF5AE, 0xDD2B, 0xF5AE, 0xEFFE, 0xC859, 0xEFFE, 0xC859, 0xDD2B};
53
+const PROGMEM uint16_t h2_label[] = {0x8FFE, 0x5E1D, 0xBD53, 0x5E1D, 0xBD53, 0x75A4, 0x8FFE, 0x75A4, 0x8FFE, 0x5E1D};
54
+const PROGMEM uint16_t h2_temp[] = {0x8FFE, 0x75A4, 0xBD53, 0x75A4, 0xBD53, 0x8D2C, 0x8FFE, 0x8D2C, 0x8FFE, 0x75A4};

+ 101
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp View File

@@ -0,0 +1,101 @@
1
+/************************************
2
+ * cocoa_press_unload_cartridge.cpp *
3
+ ************************************/
4
+
5
+/****************************************************************************
6
+ *   Written By Mark Pelletier  2017 - Aleph Objects, Inc.                  *
7
+ *   Written By Marcio Teixeira 2018 - Aleph Objects, Inc.                  *
8
+ *   Written By Marcio Teixeira 2020 - Cocoa Press                          *
9
+ *                                                                          *
10
+ *   This program is free software: you can redistribute it and/or modify   *
11
+ *   it under the terms of the GNU General Public License as published by   *
12
+ *   the Free Software Foundation, either version 3 of the License, or      *
13
+ *   (at your option) any later version.                                    *
14
+ *                                                                          *
15
+ *   This program is distributed in the hope that it will be useful,        *
16
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
17
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
18
+ *   GNU General Public License for more details.                           *
19
+ *                                                                          *
20
+ *   To view a copy of the GNU General Public License, go to the following  *
21
+ *   location: <https://www.gnu.org/licenses/>.                              *
22
+ ****************************************************************************/
23
+
24
+#include "../config.h"
25
+
26
+#if ENABLED(TOUCH_UI_FTDI_EVE) && ENABLED(TOUCH_UI_COCOA_PRESS)
27
+
28
+#include "screens.h"
29
+#include "screen_data.h"
30
+
31
+using namespace ExtUI;
32
+using namespace FTDI;
33
+using namespace Theme;
34
+
35
+#define GRID_COLS 2
36
+#define GRID_ROWS 6
37
+
38
+#define TITLE_POS             BTN_POS(1,1), BTN_SIZE(2,1)
39
+#define DESCRIPTION_POS       BTN_POS(1,2), BTN_SIZE(2,3)
40
+#define CARTRIDGE_OUT_BTN_POS BTN_POS(1,5), BTN_SIZE(1,1)
41
+#define CARTRIDGE_IN_BTN_POS  BTN_POS(2,5), BTN_SIZE(1,1)
42
+#define BACK_BTN_POS          BTN_POS(1,6), BTN_SIZE(2,1)
43
+
44
+void UnloadCartridgeScreen::onRedraw(draw_mode_t what) {
45
+  CommandProcessor cmd;
46
+
47
+  if (what & BACKGROUND) {
48
+    cmd.cmd(CLEAR_COLOR_RGB(bg_color))
49
+       .cmd(CLEAR(true,true,true))
50
+       .cmd(COLOR_RGB(bg_text_enabled))
51
+       .tag(0)
52
+       .font(font_large)
53
+       .text(TITLE_POS, GET_TEXT_F(MSG_UNLOAD_CARTRIDGE));
54
+       draw_text_box(cmd, DESCRIPTION_POS, F(
55
+        "Press and hold the buttons below to help "
56
+        "you unlock the cartridge. After unlocking, "
57
+        "press and hold the Cartridge Out button "
58
+        "until the cartridge is sticking out of the "
59
+        "extruder enough to grip and remove. After "
60
+        "removing the cartridge, continue holding the "
61
+        "Cartridge Out button until the plunger adapter is "
62
+        "visible at the bottom of the extruder."
63
+       ),
64
+       OPT_CENTERY, font_medium);
65
+  }
66
+
67
+  if (what & FOREGROUND) {
68
+    cmd.font(font_medium)
69
+       .colors(normal_btn)
70
+       .tag(2).button(CARTRIDGE_OUT_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_OUT))
71
+       .tag(3).button(CARTRIDGE_IN_BTN_POS,  GET_TEXT_F(MSG_CARTRIDGE_IN))
72
+              .colors(action_btn)
73
+       .tag(1).button(BACK_BTN_POS,    GET_TEXT_F(MSG_BACK));
74
+  }
75
+}
76
+
77
+bool UnloadCartridgeScreen::onTouchEnd(uint8_t tag) {
78
+  using namespace ExtUI;
79
+  switch (tag) {
80
+    case 1: GOTO_PREVIOUS(); break;
81
+  }
82
+  return true;
83
+}
84
+
85
+bool UnloadCartridgeScreen::onTouchHeld(uint8_t tag) {
86
+  if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate
87
+  constexpr float increment = 0.25;
88
+  MoveAxisScreen::setManualFeedrate(E0, increment);
89
+  #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis);
90
+  #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis);
91
+  switch (tag) {
92
+    case 2: UI_DECREMENT_AXIS(E0); break;
93
+    case 3: UI_INCREMENT_AXIS(E0); break;
94
+    default: return false;
95
+  }
96
+  #undef UI_DECREMENT_AXIS
97
+  #undef UI_INCREMENT_AXIS
98
+  return false;
99
+}
100
+
101
+#endif // TOUCH_UI_FTDI_EVE

+ 10
- 7
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp View File

@@ -69,20 +69,23 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
69 69
   if (what & FOREGROUND) {
70 70
     CommandProcessor cmd;
71 71
     cmd.font(font_large)
72
+       .cmd(COLOR_RGB(bg_text_enabled))
72 73
        .text(TITLE_POS, GET_TEXT_F(MSG_LEVELING))
74
+    #if ENABLED(BLTOUCH)
75
+       .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
76
+    #endif
73 77
        .font(font_medium).colors(normal_btn)
74 78
     #if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
75 79
        .tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
76 80
     #endif
77 81
        .tag(3).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED))
78 82
        .enabled(ENABLED(HAS_MESH))
79
-       .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH));
83
+       .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH))
80 84
     #if ENABLED(BLTOUCH)
81
-      cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
82
-         .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
83
-         .tag(6).button(BLTOUCH_TEST_POS,  GET_TEXT_F(MSG_BLTOUCH_SELFTEST));
85
+       .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
86
+       .tag(6).button(BLTOUCH_TEST_POS,  GET_TEXT_F(MSG_BLTOUCH_SELFTEST))
84 87
     #endif
85
-    cmd.colors(action_btn)
88
+       .colors(action_btn)
86 89
        .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
87 90
   }
88 91
 }
@@ -97,13 +100,13 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
97 100
     #ifndef BED_LEVELING_COMMANDS
98 101
       #define BED_LEVELING_COMMANDS "G29"
99 102
     #endif
100
-    #if HAS_MESH
103
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
101 104
       BedMeshScreen::startMeshProbe();
102 105
     #else
103 106
       SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS));
104 107
     #endif
105 108
     break;
106
-    #if HAS_MESH
109
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
107 110
     case 4: GOTO_SCREEN(BedMeshScreen); break;
108 111
     #endif
109 112
     #if ENABLED(BLTOUCH)

+ 14
- 24
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp View File

@@ -23,7 +23,7 @@
23 23
 
24 24
 #include "../config.h"
25 25
 
26
-#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO)
26
+#if ENABLED(TOUCH_UI_FTDI_EVE) && NONE(TOUCH_UI_LULZBOT_BIO,TOUCH_UI_COCOA_PRESS)
27 27
 
28 28
 #include "screens.h"
29 29
 
@@ -69,24 +69,20 @@ void MainMenu::onRedraw(draw_mode_t what) {
69 69
     CommandProcessor cmd;
70 70
     cmd.colors(normal_btn)
71 71
        .font(Theme::font_medium)
72
-       .tag(2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME))
73
-       .enabled(
74
-           #if ANY(NOZZLE_CLEAN_FEATURE, TOUCH_UI_COCOA_PRESS)
75
-             1
76
-           #endif
77
-         )
78
-       .tag(3).button( CLEAN_NOZZLE_POS,     GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_PREHEAT_1, MSG_CLEAN_NOZZLE)))
79
-       .tag(4).button( MOVE_AXIS_POS,        GET_TEXT_F(MSG_MOVE_AXIS))
80
-       .tag(5).button( DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
81
-       .tag(6).button( TEMPERATURE_POS,      GET_TEXT_F(MSG_TEMPERATURE))
72
+       .tag( 2).button( AUTO_HOME_POS,       GET_TEXT_F(MSG_AUTO_HOME))
73
+       .enabled(ENABLED(NOZZLE_CLEAN_FEATURE))
74
+       .tag( 3).button( CLEAN_NOZZLE_POS,    GET_TEXT_F(MSG_CLEAN_NOZZLE))
75
+       .tag( 4).button( MOVE_AXIS_POS,       GET_TEXT_F(MSG_MOVE_AXIS))
76
+       .tag( 5).button( DISABLE_STEPPERS_POS,GET_TEXT_F(MSG_DISABLE_STEPPERS))
77
+       .tag( 6).button( TEMPERATURE_POS,     GET_TEXT_F(MSG_TEMPERATURE))
82 78
        .enabled(IF_DISABLED(TOUCH_UI_LULZBOT_BIO, 1))
83
-       .tag(7).button( FILAMENTCHANGE_POS,   GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_CASE_LIGHT, MSG_FILAMENTCHANGE))
84
-       .tag(8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
79
+       .tag( 7).button( FILAMENTCHANGE_POS,  GET_TEXT_F(MSG_FILAMENTCHANGE))
80
+       .tag( 8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
85 81
        .enabled(TERN_(HAS_LEVELING, 1))
86
-       .tag(9).button( LEVELING_POS, GET_TEXT_F(MSG_LEVELING))
87
-       .tag(10).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU))
82
+       .tag( 9).button( LEVELING_POS,        GET_TEXT_F(MSG_LEVELING))
83
+       .tag(10).button( ABOUT_PRINTER_POS,   GET_TEXT_F(MSG_INFO_MENU))
88 84
        .colors(action_btn)
89
-       .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK));
85
+       .tag(1).button( BACK_POS,             GET_TEXT_F(MSG_BACK));
90 86
   }
91 87
 }
92 88
 
@@ -96,22 +92,16 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
96 92
   switch (tag) {
97 93
     case 1:  SaveSettingsDialogBox::promptToSaveSettings();           break;
98 94
     case 2:  SpinnerDialogBox::enqueueAndWait_P(F("G28"));            break;
99
-    #if ENABLED(TOUCH_UI_COCOA_PRESS)
100
-    case 3:  GOTO_SCREEN(PreheatMenu);                                break;
101
-    #elif ENABLED(NOZZLE_CLEAN_FEATURE)
95
+    #if ENABLED(NOZZLE_CLEAN_FEATURE)
102 96
     case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
103 97
     #endif
104 98
     case 4:  GOTO_SCREEN(MoveAxisScreen);                             break;
105 99
     case 5:  injectCommands_P(PSTR("M84"));                           break;
106 100
     case 6:  GOTO_SCREEN(TemperatureScreen);                          break;
107
-    #if BOTH(TOUCH_UI_COCOA_PRESS, CASE_LIGHT_ENABLE)
108
-    case 7:  GOTO_SCREEN(CaseLightScreen);                            break;
109
-    #else
110 101
     case 7:  GOTO_SCREEN(ChangeFilamentScreen);                       break;
111
-    #endif
112 102
     case 8:  GOTO_SCREEN(AdvancedSettingsMenu);                       break;
113 103
     #ifdef HAS_LEVELING
114
-    case 9: GOTO_SCREEN(LevelingMenu);                                break;
104
+    case 9:  GOTO_SCREEN(LevelingMenu);                               break;
115 105
     #endif
116 106
     case 10: GOTO_SCREEN(AboutScreen);                                break;
117 107
     default:

+ 5
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp View File

@@ -30,7 +30,7 @@
30 30
 using namespace FTDI;
31 31
 using namespace ExtUI;
32 32
 
33
-void MoveAxisScreen::onEntry() {
33
+void BaseMoveAxisScreen::onEntry() {
34 34
   // Since Marlin keeps only one absolute position for all the extruders,
35 35
   // we have to keep track of the relative motion of individual extruders
36 36
   // ourselves. The relative distances are reset to zero whenever this
@@ -68,7 +68,7 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) {
68 68
   w.increments();
69 69
 }
70 70
 
71
-bool MoveAxisScreen::onTouchHeld(uint8_t tag) {
71
+bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) {
72 72
   #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis);
73 73
   #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis);
74 74
   const float increment = getIncrement();
@@ -106,7 +106,7 @@ bool MoveAxisScreen::onTouchHeld(uint8_t tag) {
106 106
   return true;
107 107
 }
108 108
 
109
-float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {
109
+float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {
110 110
   // Compute feedrate so that the tool lags the adjuster when it is
111 111
   // being held down, this allows enough margin for the planner to
112 112
   // connect segments and even out the motion.
@@ -114,11 +114,11 @@ float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {
114 114
   return min(max_manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f));
115 115
 }
116 116
 
117
-void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) {
117
+void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) {
118 118
   ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm));
119 119
 }
120 120
 
121
-void MoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) {
121
+void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) {
122 122
   ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm));
123 123
 }
124 124
 

+ 4
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp View File

@@ -115,6 +115,10 @@ SCREEN_TABLE {
115 115
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
116 116
   DECL_SCREEN(PreheatMenu),
117 117
   DECL_SCREEN(PreheatTimerScreen),
118
+  DECL_SCREEN(UnloadCartridgeScreen),
119
+  DECL_SCREEN(LoadChocolateScreen),
120
+  DECL_SCREEN(MoveXYZScreen),
121
+  DECL_SCREEN(MoveEScreen),
118 122
 #endif
119 123
 #if ENABLED(TOUCH_UI_DEVELOPER_MENU)
120 124
   DECL_SCREEN(DeveloperMenu),

+ 63
- 26
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h View File

@@ -98,6 +98,10 @@ enum {
98 98
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
99 99
   PREHEAT_MENU_CACHE,
100 100
   PREHEAT_TIMER_SCREEN_CACHE,
101
+  UNLOAD_CARTRIDGE_SCREEN_CACHE,
102
+  LOAD_CHOCOLATE_SCREEN_CACHE,
103
+  MOVE_XYZ_SCREEN_CACHE,
104
+  MOVE_E_SCREEN_CACHE,
101 105
 #endif
102 106
 #if ENABLED(SDSUPPORT)
103 107
   FILES_SCREEN_CACHE,
@@ -112,7 +116,7 @@ enum {
112 116
 // To save MCU RAM, the status message is "baked" in to the status screen
113 117
 // cache, so we reserve a large chunk of memory for the DL cache
114 118
 
115
-#define STATUS_SCREEN_DL_SIZE        2048
119
+#define STATUS_SCREEN_DL_SIZE        4096
116 120
 #define ALERT_BOX_DL_SIZE            3072
117 121
 #define SPINNER_DL_SIZE              3072
118 122
 #define FILE_SCREEN_DL_SIZE          4160
@@ -280,6 +284,7 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
280 284
       static bool  jog_xy;
281 285
       static bool  fine_motion;
282 286
 
287
+      static void draw_progress(draw_mode_t what);
283 288
       static void draw_temperature(draw_mode_t what);
284 289
       static void draw_syringe(draw_mode_t what);
285 290
       static void draw_arrows(draw_mode_t what);
@@ -335,29 +340,6 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
335 340
   };
336 341
 #endif
337 342
 
338
-#if ENABLED(TOUCH_UI_COCOA_PRESS)
339
-  class PreheatMenu : public BaseScreen, public CachedScreen<PREHEAT_MENU_CACHE> {
340
-    public:
341
-      static void onRedraw(draw_mode_t);
342
-      static bool onTouchEnd(uint8_t tag);
343
-  };
344
-
345
-  class PreheatTimerScreen : public BaseScreen, public CachedScreen<PREHEAT_TIMER_SCREEN_CACHE> {
346
-    private:
347
-      static uint16_t secondsRemaining();
348
-
349
-      static void draw_message(draw_mode_t);
350
-      static void draw_time_remaining(draw_mode_t);
351
-      static void draw_interaction_buttons(draw_mode_t);
352
-    public:
353
-      static void onRedraw(draw_mode_t);
354
-
355
-      static void onEntry();
356
-      static void onIdle();
357
-      static bool onTouchEnd(uint8_t tag);
358
-  };
359
-#endif
360
-
361 343
 class MainMenu : public BaseScreen, public CachedScreen<MENU_SCREEN_CACHE> {
362 344
   public:
363 345
     static void onRedraw(draw_mode_t);
@@ -467,7 +449,7 @@ class BaseNumericAdjustmentScreen : public BaseScreen {
467 449
     static bool onTouchEnd(uint8_t tag);
468 450
 };
469 451
 
470
-class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen<MOVE_AXIS_SCREEN_CACHE> {
452
+class BaseMoveAxisScreen : public BaseNumericAdjustmentScreen {
471 453
   private:
472 454
     static float getManualFeedrate(uint8_t axis, float increment_mm);
473 455
   public:
@@ -475,8 +457,12 @@ class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen<M
475 457
     static void setManualFeedrate(ExtUI::extruder_t, float increment_mm);
476 458
 
477 459
     static void onEntry();
478
-    static void onRedraw(draw_mode_t);
479 460
     static bool onTouchHeld(uint8_t tag);
461
+};
462
+
463
+class MoveAxisScreen : public BaseMoveAxisScreen, public CachedScreen<MOVE_AXIS_SCREEN_CACHE> {
464
+  public:
465
+    static void onRedraw(draw_mode_t);
480 466
     static void onIdle();
481 467
 };
482 468
 
@@ -852,3 +838,54 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen {
852 838
       static bool onTouchEnd(uint8_t tag);
853 839
   };
854 840
 #endif
841
+
842
+#if ENABLED(TOUCH_UI_COCOA_PRESS)
843
+  class PreheatMenu : public BaseScreen, public CachedScreen<PREHEAT_MENU_CACHE> {
844
+    public:
845
+      static void onRedraw(draw_mode_t);
846
+      static bool onTouchEnd(uint8_t tag);
847
+  };
848
+
849
+  class PreheatTimerScreen : public BaseScreen, public CachedScreen<PREHEAT_TIMER_SCREEN_CACHE> {
850
+    private:
851
+      static uint16_t secondsRemaining();
852
+
853
+      static void draw_message(draw_mode_t);
854
+      static void draw_time_remaining(draw_mode_t);
855
+      static void draw_interaction_buttons(draw_mode_t);
856
+      static void draw_adjuster(draw_mode_t, uint8_t tag, progmem_str label, float value, int16_t x, int16_t y, int16_t w, int16_t h);
857
+    public:
858
+      static void onRedraw(draw_mode_t);
859
+
860
+      static void onEntry();
861
+      static void onIdle();
862
+      static bool onTouchHeld(uint8_t tag);
863
+      static bool onTouchEnd(uint8_t tag);
864
+  };
865
+
866
+  class UnloadCartridgeScreen : public BaseScreen, public CachedScreen<UNLOAD_CARTRIDGE_SCREEN_CACHE> {
867
+    public:
868
+      static void onRedraw(draw_mode_t);
869
+      static bool onTouchEnd(uint8_t tag);
870
+      static bool onTouchHeld(uint8_t tag);
871
+  };
872
+
873
+  class LoadChocolateScreen : public BaseScreen, public CachedScreen<LOAD_CHOCOLATE_SCREEN_CACHE> {
874
+    public:
875
+      static void onRedraw(draw_mode_t);
876
+      static bool onTouchEnd(uint8_t tag);
877
+      static bool onTouchHeld(uint8_t tag);
878
+  };
879
+
880
+  class MoveXYZScreen : public BaseMoveAxisScreen, public CachedScreen<MOVE_XYZ_SCREEN_CACHE> {
881
+    public:
882
+      static void onRedraw(draw_mode_t);
883
+      static void onIdle();
884
+  };
885
+
886
+  class MoveEScreen : public BaseMoveAxisScreen, public CachedScreen<MOVE_E_SCREEN_CACHE> {
887
+    public:
888
+      static void onRedraw(draw_mode_t);
889
+      static void onIdle();
890
+  };
891
+#endif

+ 13
- 6
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp View File

@@ -33,7 +33,7 @@ using namespace ExtUI;
33 33
 void TemperatureScreen::onRedraw(draw_mode_t what) {
34 34
   widgets_t w(what);
35 35
   #if TOUCH_UI_LCD_TEMP_SCALING == 10
36
-    w.precision(1)
36
+    w.precision(1, DEFAULT_MIDRANGE)
37 37
   #else
38 38
     w.precision(0, getTargetTemp_celsius(E0) == 0 ? DEFAULT_HIGHEST : DEFAULT_MIDRANGE)
39 39
   #endif
@@ -41,7 +41,14 @@ void TemperatureScreen::onRedraw(draw_mode_t what) {
41 41
   w.heading(GET_TEXT_F(MSG_TEMPERATURE));
42 42
   w.button(30, GET_TEXT_F(MSG_COOLDOWN));
43 43
   #ifndef NO_TOOLHEAD_HEATER_GCODE
44
-    #if HOTENDS == 1
44
+    #ifdef TOUCH_UI_COCOA_PRESS
45
+      w.adjuster(   2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0));
46
+      w.adjuster(   4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1));
47
+      #if ENABLED(COCOA_PRESS_EXTRA_HEATER)
48
+        if (has_extra_heater())
49
+          w.adjuster(6, GET_TEXT_F(MSG_EXTERNAL), getTargetTemp_celsius(E2));
50
+      #endif
51
+    #elif HOTENDS == 1
45 52
       w.adjuster(   2, GET_TEXT_F(MSG_NOZZLE),   getTargetTemp_celsius(E0));
46 53
     #else
47 54
       w.adjuster(   2, F(LCD_STR_E0), getTargetTemp_celsius(E0));
@@ -95,12 +102,12 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) {
95 102
       case 11: UI_INCREMENT(TargetFan_percent, FAN0); break;
96 103
     #endif
97 104
     case 30:
98
-      #define _HOTEND_OFF(N) setTargetTemp_celsius(0,E##N);
105
+      #define _HOTEND_OFF(N) setTargetTemp_celsius(0, E##N);
99 106
       REPEAT(HOTENDS, _HOTEND_OFF);
100
-      TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0,BED));
101
-      TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0,CHAMBER));
107
+      TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0, BED));
108
+      TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0, CHAMBER));
102 109
       #if HAS_FAN
103
-        setTargetFan_percent(0,FAN0);
110
+        setTargetFan_percent(0, FAN0);
104 111
       #endif
105 112
       break;
106 113
     default:

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp View File

@@ -76,7 +76,7 @@ void TuneMenu::onRedraw(draw_mode_t what) {
76 76
        .tag(3).button( FIL_CHANGE_POS,  GET_TEXT_F(MSG_FILAMENTCHANGE))
77 77
        .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR))
78 78
        .tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT))
79
-       .enabled(EITHER(HAS_BED_PROBE, BABYSTEPPING))
79
+       .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE) || ENABLED(BABYSTEPPING))
80 80
        .tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET)))
81 81
        .tag(5).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED))
82 82
        .enabled(sdOrHostPrinting)
@@ -103,7 +103,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
103 103
     case  4:
104 104
       #if ENABLED(BABYSTEPPING)
105 105
         GOTO_SCREEN(NudgeNozzleScreen);
106
-      #elif HAS_BED_PROBE
106
+      #elif BOTH(HAS_LEVELING, HAS_BED_PROBE)
107 107
         GOTO_SCREEN(ZOffsetScreen);
108 108
       #endif
109 109
       break;

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../config.h"
24 24
 
25
-#if BOTH(TOUCH_UI_FTDI_EVE, HAS_BED_PROBE)
25
+#if ENABLED(TOUCH_UI_FTDI_EVE) && BOTH(HAS_LEVELING, HAS_BED_PROBE)
26 26
 
27 27
 #include "screens.h"
28 28
 

Loading…
Cancel
Save