Browse Source

FTDI EVE custom user menus (#20518)

LinFor 3 years ago
parent
commit
82540be931
No account linked to committer's email address

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

@@ -0,0 +1,215 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../config.h"
24
+
25
+#if BOTH(TOUCH_UI_FTDI_EVE, CUSTOM_USER_MENUS) && NONE(TOUCH_UI_LULZBOT_BIO, 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 _ITEM_TAG(N) (10+N)
34
+#define _USER_DESC(N) USER_DESC_##N
35
+#define _USER_GCODE(N) USER_GCODE_##N
36
+#define _USER_ITEM(N) .tag(_ITEM_TAG(N)).button(USER_ITEM_POS(N), _USER_DESC(N))
37
+#define _USER_ACTION(N) case _ITEM_TAG(N): injectCommands_P(PSTR(_USER_GCODE(N))); TERN_(USER_SCRIPT_RETURN, GOTO_SCREEN(StatusScreen)); break;
38
+
39
+#define _HAS_1(N) (defined(USER_DESC_##N) && defined(USER_GCODE_##N))
40
+#define HAS_USER_ITEM(V...) DO(HAS,||,V)
41
+
42
+void CustomUserMenus::onRedraw(draw_mode_t what) {
43
+  if (what & BACKGROUND) {
44
+    CommandProcessor cmd;
45
+    cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
46
+       .cmd(CLEAR(true, true, true));
47
+  }
48
+
49
+  #if HAS_USER_ITEM(16, 17, 18, 19, 20)
50
+    #define _MORE_THAN_FIFTEEN 1
51
+  #else
52
+    #define _MORE_THAN_FIFTEEN 0
53
+  #endif
54
+  #if _MORE_THAN_FIFTEEN || HAS_USER_ITEM(11, 12, 13, 14, 15)
55
+    #define _MORE_THAN_TEN 1
56
+  #else
57
+    #define _MORE_THAN_TEN 0
58
+  #endif
59
+
60
+  #ifdef TOUCH_UI_PORTRAIT
61
+    #define GRID_ROWS 11
62
+    #define GRID_COLS (1 + _MORE_THAN_TEN)
63
+    #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1)
64
+    #define BACK_POS         BTN_POS(1,11), BTN_SIZE(1,1)
65
+  #else
66
+    #if _MORE_THAN_TEN || HAS_USER_ITEM(6, 7, 8, 9, 10)
67
+      #define _MORE_THAN_FIVE 1
68
+    #else
69
+      #define _MORE_THAN_FIVE 0
70
+    #endif
71
+    #define GRID_ROWS 6
72
+    #define GRID_COLS (1 + _MORE_THAN_FIVE + _MORE_THAN_TEN + _MORE_THAN_FIFTEEN)
73
+    #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/5)), ((N-1) % 5 + 1)), BTN_SIZE(1,1)
74
+    #define BACK_POS         BTN_POS(1,6), BTN_SIZE(GRID_COLS,1)
75
+  #endif
76
+
77
+  if (what & FOREGROUND) {
78
+    CommandProcessor cmd;
79
+    cmd.colors(normal_btn)
80
+       .font(Theme::font_medium)
81
+       #if HAS_USER_ITEM(1)
82
+        _USER_ITEM(1)
83
+       #endif
84
+       #if HAS_USER_ITEM(2)
85
+        _USER_ITEM(2)
86
+       #endif
87
+       #if HAS_USER_ITEM(3)
88
+        _USER_ITEM(3)
89
+       #endif
90
+       #if HAS_USER_ITEM(4)
91
+        _USER_ITEM(4)
92
+       #endif
93
+       #if HAS_USER_ITEM(5)
94
+        _USER_ITEM(5)
95
+       #endif
96
+       #if HAS_USER_ITEM(6)
97
+        _USER_ITEM(6)
98
+       #endif
99
+       #if HAS_USER_ITEM(7)
100
+        _USER_ITEM(7)
101
+       #endif
102
+       #if HAS_USER_ITEM(8)
103
+        _USER_ITEM(8)
104
+       #endif
105
+       #if HAS_USER_ITEM(9)
106
+        _USER_ITEM(9)
107
+       #endif
108
+       #if HAS_USER_ITEM(10)
109
+        _USER_ITEM(10)
110
+       #endif
111
+       #if HAS_USER_ITEM(11)
112
+        _USER_ITEM(11)
113
+       #endif
114
+       #if HAS_USER_ITEM(12)
115
+        _USER_ITEM(12)
116
+       #endif
117
+       #if HAS_USER_ITEM(13)
118
+        _USER_ITEM(13)
119
+       #endif
120
+       #if HAS_USER_ITEM(14)
121
+        _USER_ITEM(14)
122
+       #endif
123
+       #if HAS_USER_ITEM(15)
124
+        _USER_ITEM(15)
125
+       #endif
126
+       #if HAS_USER_ITEM(16)
127
+        _USER_ITEM(16)
128
+       #endif
129
+       #if HAS_USER_ITEM(17)
130
+        _USER_ITEM(17)
131
+       #endif
132
+       #if HAS_USER_ITEM(18)
133
+        _USER_ITEM(18)
134
+       #endif
135
+       #if HAS_USER_ITEM(19)
136
+        _USER_ITEM(19)
137
+       #endif
138
+       #if HAS_USER_ITEM(20)
139
+        _USER_ITEM(20)
140
+       #endif
141
+      .colors(action_btn)
142
+      .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
143
+  }
144
+}
145
+
146
+bool CustomUserMenus::onTouchEnd(uint8_t tag) {
147
+  switch (tag) {
148
+    #if HAS_USER_ITEM(1)
149
+      _USER_ACTION(1)
150
+    #endif
151
+    #if HAS_USER_ITEM(2)
152
+      _USER_ACTION(2)
153
+    #endif
154
+    #if HAS_USER_ITEM(3)
155
+      _USER_ACTION(3)
156
+    #endif
157
+    #if HAS_USER_ITEM(4)
158
+      _USER_ACTION(4)
159
+    #endif
160
+    #if HAS_USER_ITEM(5)
161
+      _USER_ACTION(5)
162
+    #endif
163
+    #if HAS_USER_ITEM(6)
164
+      _USER_ACTION(6)
165
+    #endif
166
+    #if HAS_USER_ITEM(7)
167
+      _USER_ACTION(7)
168
+    #endif
169
+    #if HAS_USER_ITEM(8)
170
+      _USER_ACTION(8)
171
+    #endif
172
+    #if HAS_USER_ITEM(9)
173
+      _USER_ACTION(9)
174
+    #endif
175
+    #if HAS_USER_ITEM(10)
176
+      _USER_ACTION(10)
177
+    #endif
178
+    #if HAS_USER_ITEM(11)
179
+      _USER_ACTION(11)
180
+    #endif
181
+    #if HAS_USER_ITEM(12)
182
+      _USER_ACTION(12)
183
+    #endif
184
+    #if HAS_USER_ITEM(13)
185
+      _USER_ACTION(13)
186
+    #endif
187
+    #if HAS_USER_ITEM(14)
188
+      _USER_ACTION(14)
189
+    #endif
190
+    #if HAS_USER_ITEM(15)
191
+      _USER_ACTION(15)
192
+    #endif
193
+    #if HAS_USER_ITEM(16)
194
+      _USER_ACTION(16)
195
+    #endif
196
+    #if HAS_USER_ITEM(17)
197
+      _USER_ACTION(17)
198
+    #endif
199
+    #if HAS_USER_ITEM(18)
200
+      _USER_ACTION(18)
201
+    #endif
202
+    #if HAS_USER_ITEM(19)
203
+      _USER_ACTION(19)
204
+    #endif
205
+    #if HAS_USER_ITEM(20)
206
+      _USER_ACTION(20)
207
+    #endif
208
+
209
+    case 1: GOTO_PREVIOUS(); break;
210
+    default: return false;
211
+  }
212
+  return true;
213
+}
214
+
215
+#endif // TOUCH_UI_FTDI_EVE && CUSTOM_USER_MENUS && !TOUCH_UI_LULZBOT_BIO && !TOUCH_UI_COCOA_PRESS

+ 52
- 12
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp View File

@@ -1,3 +1,25 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
1 23
 /*****************
2 24
  * main_menu.cpp *
3 25
  *****************/
@@ -42,7 +64,12 @@ void MainMenu::onRedraw(draw_mode_t what) {
42 64
     #define GRID_COLS 2
43 65
     #define ABOUT_PRINTER_POS     BTN_POS(1,1), BTN_SIZE(2,1)
44 66
     #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1)
45
-    #define FILAMENTCHANGE_POS    BTN_POS(1,3), BTN_SIZE(2,1)
67
+    #if ENABLED(CUSTOM_USER_MENUS)
68
+      #define FILAMENTCHANGE_POS  BTN_POS(1,3), BTN_SIZE(1,1)
69
+      #define CUSTOM_USER_MENUS_POS BTN_POS(2,3), BTN_SIZE(1,1)
70
+    #else
71
+      #define FILAMENTCHANGE_POS  BTN_POS(1,3), BTN_SIZE(2,1)
72
+    #endif
46 73
     #define TEMPERATURE_POS       BTN_POS(1,4), BTN_SIZE(2,1)
47 74
     #define DISABLE_STEPPERS_POS  BTN_POS(1,5), BTN_SIZE(2,1)
48 75
     #define MOVE_AXIS_POS         BTN_POS(1,6), BTN_SIZE(1,1)
@@ -52,17 +79,23 @@ void MainMenu::onRedraw(draw_mode_t what) {
52 79
     #define BACK_POS              BTN_POS(1,8), BTN_SIZE(2,1)
53 80
   #else
54 81
     #define GRID_ROWS 5
55
-    #define GRID_COLS 2
56
-    #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(1,1)
57
-    #define ABOUT_PRINTER_POS     BTN_POS(2,1), BTN_SIZE(1,1)
58
-    #define AUTO_HOME_POS         BTN_POS(1,2), BTN_SIZE(1,1)
59
-    #define CLEAN_NOZZLE_POS      BTN_POS(2,2), BTN_SIZE(1,1)
60
-    #define MOVE_AXIS_POS         BTN_POS(1,3), BTN_SIZE(1,1)
61
-    #define DISABLE_STEPPERS_POS  BTN_POS(2,3), BTN_SIZE(1,1)
62
-    #define TEMPERATURE_POS       BTN_POS(1,4), BTN_SIZE(1,1)
63
-    #define FILAMENTCHANGE_POS    BTN_POS(2,4), BTN_SIZE(1,1)
64
-    #define LEVELING_POS          BTN_POS(1,5), BTN_SIZE(1,1)
65
-    #define BACK_POS              BTN_POS(2,5), BTN_SIZE(1,1)
82
+    #define GRID_COLS 6
83
+    #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(3,1)
84
+    #define ABOUT_PRINTER_POS     BTN_POS(4,1), BTN_SIZE(3,1)
85
+    #define AUTO_HOME_POS         BTN_POS(1,2), BTN_SIZE(3,1)
86
+    #define CLEAN_NOZZLE_POS      BTN_POS(4,2), BTN_SIZE(3,1)
87
+    #define MOVE_AXIS_POS         BTN_POS(1,3), BTN_SIZE(3,1)
88
+    #define DISABLE_STEPPERS_POS  BTN_POS(4,3), BTN_SIZE(3,1)
89
+    #if ENABLED(CUSTOM_USER_MENUS)
90
+      #define TEMPERATURE_POS     BTN_POS(1,4), BTN_SIZE(2,1)
91
+      #define FILAMENTCHANGE_POS  BTN_POS(3,4), BTN_SIZE(2,1)
92
+      #define CUSTOM_USER_MENUS_POS BTN_POS(5,4), BTN_SIZE(2,1)
93
+    #else
94
+      #define TEMPERATURE_POS     BTN_POS(1,4), BTN_SIZE(3,1)
95
+      #define FILAMENTCHANGE_POS  BTN_POS(4,4), BTN_SIZE(3,1)
96
+    #endif
97
+    #define LEVELING_POS          BTN_POS(1,5), BTN_SIZE(3,1)
98
+    #define BACK_POS              BTN_POS(4,5), BTN_SIZE(3,1)
66 99
   #endif
67 100
 
68 101
   if (what & FOREGROUND) {
@@ -81,6 +114,9 @@ void MainMenu::onRedraw(draw_mode_t what) {
81 114
        .enabled(TERN_(HAS_LEVELING, 1))
82 115
        .tag( 9).button(LEVELING_POS,        GET_TEXT_F(MSG_LEVELING))
83 116
        .tag(10).button(ABOUT_PRINTER_POS,   GET_TEXT_F(MSG_INFO_MENU))
117
+       #if ENABLED(CUSTOM_USER_MENUS)
118
+        .tag(11).button(CUSTOM_USER_MENUS_POS, GET_TEXT_F(MSG_USER_MENU))
119
+       #endif
84 120
        .colors(action_btn)
85 121
        .tag(1).button(BACK_POS,             GET_TEXT_F(MSG_BACK));
86 122
   }
@@ -104,6 +140,10 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
104 140
     case 9:  GOTO_SCREEN(LevelingMenu);                               break;
105 141
     #endif
106 142
     case 10: GOTO_SCREEN(AboutScreen);                                break;
143
+    #if ENABLED(CUSTOM_USER_MENUS)
144
+      case 11: GOTO_SCREEN(CustomUserMenus);                          break;
145
+    #endif
146
+
107 147
     default:
108 148
       return false;
109 149
   }

+ 93
- 68
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp View File

@@ -1,3 +1,25 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
1 23
 /***************
2 24
  * screens.cpp *
3 25
  ***************/
@@ -45,88 +67,91 @@ SCREEN_TABLE {
45 67
   DECL_SCREEN(SaveSettingsDialogBox),
46 68
   DECL_SCREEN(ConfirmStartPrintDialogBox),
47 69
   DECL_SCREEN(ConfirmAbortPrintDialogBox),
48
-#if ENABLED(CALIBRATION_GCODE)
49
-  DECL_SCREEN(ConfirmAutoCalibrationDialogBox),
50
-#endif
70
+  #if ENABLED(CALIBRATION_GCODE)
71
+    DECL_SCREEN(ConfirmAutoCalibrationDialogBox),
72
+  #endif
73
+  #if ENABLED(CUSTOM_USER_MENUS)
74
+    DECL_SCREEN(CustomUserMenus),
75
+  #endif
51 76
   DECL_SCREEN(SpinnerDialogBox),
52 77
   DECL_SCREEN(AboutScreen),
53
-#if ENABLED(PRINTCOUNTER)
54
-  DECL_SCREEN(StatisticsScreen),
55
-#endif
56
-#if ENABLED(BABYSTEPPING)
57
-  DECL_SCREEN(NudgeNozzleScreen),
58
-#endif
78
+  #if ENABLED(PRINTCOUNTER)
79
+    DECL_SCREEN(StatisticsScreen),
80
+  #endif
81
+  #if ENABLED(BABYSTEPPING)
82
+    DECL_SCREEN(NudgeNozzleScreen),
83
+  #endif
59 84
   DECL_SCREEN(MoveAxisScreen),
60 85
   DECL_SCREEN(StepsScreen),
61
-#if HAS_TRINAMIC_CONFIG
62
-  DECL_SCREEN(StepperCurrentScreen),
63
-  DECL_SCREEN(StepperBumpSensitivityScreen),
64
-#endif
65
-#if HAS_LEVELING
66
-  DECL_SCREEN(LevelingMenu),
67
-  #if HAS_BED_PROBE
68
-    DECL_SCREEN(ZOffsetScreen),
69
-  #endif
70
-  #if HAS_MESH
71
-    DECL_SCREEN(BedMeshScreen),
72
-  #endif
73
-#endif
74
-#if HAS_MULTI_HOTEND
75
-  DECL_SCREEN(NozzleOffsetScreen),
76
-#endif
77
-#if ENABLED(BACKLASH_GCODE)
78
-  DECL_SCREEN(BacklashCompensationScreen),
79
-#endif
86
+  #if HAS_TRINAMIC_CONFIG
87
+    DECL_SCREEN(StepperCurrentScreen),
88
+    DECL_SCREEN(StepperBumpSensitivityScreen),
89
+  #endif
90
+  #if HAS_LEVELING
91
+    DECL_SCREEN(LevelingMenu),
92
+    #if HAS_BED_PROBE
93
+      DECL_SCREEN(ZOffsetScreen),
94
+    #endif
95
+    #if HAS_MESH
96
+      DECL_SCREEN(BedMeshScreen),
97
+    #endif
98
+  #endif
99
+  #if HAS_MULTI_HOTEND
100
+    DECL_SCREEN(NozzleOffsetScreen),
101
+  #endif
102
+  #if ENABLED(BACKLASH_GCODE)
103
+    DECL_SCREEN(BacklashCompensationScreen),
104
+  #endif
80 105
   DECL_SCREEN(FeedratePercentScreen),
81 106
   DECL_SCREEN(MaxVelocityScreen),
82 107
   DECL_SCREEN(MaxAccelerationScreen),
83 108
   DECL_SCREEN(DefaultAccelerationScreen),
84
-#if HAS_JUNCTION_DEVIATION
85
-  DECL_SCREEN(JunctionDeviationScreen),
86
-#else
87
-  DECL_SCREEN(JerkScreen),
88
-#endif
89
-#if ENABLED(CASE_LIGHT_ENABLE)
90
-  DECL_SCREEN(CaseLightScreen),
91
-#endif
92
-#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
93
-  DECL_SCREEN(FilamentMenu),
94
-#endif
95
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
96
-  DECL_SCREEN(FilamentRunoutScreen),
97
-#endif
98
-#if ENABLED(LIN_ADVANCE)
99
-  DECL_SCREEN(LinearAdvanceScreen),
100
-#endif
109
+  #if HAS_JUNCTION_DEVIATION
110
+    DECL_SCREEN(JunctionDeviationScreen),
111
+  #else
112
+    DECL_SCREEN(JerkScreen),
113
+  #endif
114
+  #if ENABLED(CASE_LIGHT_ENABLE)
115
+    DECL_SCREEN(CaseLightScreen),
116
+  #endif
117
+  #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
118
+    DECL_SCREEN(FilamentMenu),
119
+  #endif
120
+  #if ENABLED(FILAMENT_RUNOUT_SENSOR)
121
+    DECL_SCREEN(FilamentRunoutScreen),
122
+  #endif
123
+  #if ENABLED(LIN_ADVANCE)
124
+    DECL_SCREEN(LinearAdvanceScreen),
125
+  #endif
101 126
   DECL_SCREEN(TemperatureScreen),
102 127
   DECL_SCREEN(ChangeFilamentScreen),
103 128
   DECL_SCREEN(InterfaceSettingsScreen),
104 129
   DECL_SCREEN(InterfaceSoundsScreen),
105 130
   DECL_SCREEN(LockScreen),
106
-#if ENABLED(SDSUPPORT)
107
-  DECL_SCREEN(FilesScreen),
108
-#endif
131
+  #if ENABLED(SDSUPPORT)
132
+    DECL_SCREEN(FilesScreen),
133
+  #endif
109 134
   DECL_SCREEN(EndstopStatesScreen),
110
-#if ENABLED(TOUCH_UI_LULZBOT_BIO)
111
-  DECL_SCREEN(BioPrintingDialogBox),
112
-  DECL_SCREEN(BioConfirmHomeXYZ),
113
-  DECL_SCREEN(BioConfirmHomeE),
114
-#endif
115
-#if ENABLED(TOUCH_UI_COCOA_PRESS)
116
-  DECL_SCREEN(PreheatMenu),
117
-  DECL_SCREEN(PreheatTimerScreen),
118
-  DECL_SCREEN(UnloadCartridgeScreen),
119
-  DECL_SCREEN(LoadChocolateScreen),
120
-  DECL_SCREEN(MoveXYZScreen),
121
-  DECL_SCREEN(MoveEScreen),
122
-#endif
123
-#if ENABLED(TOUCH_UI_DEVELOPER_MENU)
124
-  DECL_SCREEN(DeveloperMenu),
125
-  DECL_SCREEN(ConfirmEraseFlashDialogBox),
126
-  DECL_SCREEN(WidgetsScreen),
127
-  DECL_SCREEN(TouchRegistersScreen),
128
-  DECL_SCREEN(StressTestScreen),
129
-#endif
135
+  #if ENABLED(TOUCH_UI_LULZBOT_BIO)
136
+    DECL_SCREEN(BioPrintingDialogBox),
137
+    DECL_SCREEN(BioConfirmHomeXYZ),
138
+    DECL_SCREEN(BioConfirmHomeE),
139
+  #endif
140
+  #if ENABLED(TOUCH_UI_COCOA_PRESS)
141
+    DECL_SCREEN(PreheatMenu),
142
+    DECL_SCREEN(PreheatTimerScreen),
143
+    DECL_SCREEN(UnloadCartridgeScreen),
144
+    DECL_SCREEN(LoadChocolateScreen),
145
+    DECL_SCREEN(MoveXYZScreen),
146
+    DECL_SCREEN(MoveEScreen),
147
+  #endif
148
+  #if ENABLED(TOUCH_UI_DEVELOPER_MENU)
149
+    DECL_SCREEN(DeveloperMenu),
150
+    DECL_SCREEN(ConfirmEraseFlashDialogBox),
151
+    DECL_SCREEN(WidgetsScreen),
152
+    DECL_SCREEN(TouchRegistersScreen),
153
+    DECL_SCREEN(StressTestScreen),
154
+  #endif
130 155
   DECL_SCREEN(MediaPlayerScreen),
131 156
   DECL_SCREEN(DisplayTuningScreen)
132 157
 };

+ 124
- 81
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h View File

@@ -1,3 +1,25 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
1 23
 /*************
2 24
  * screens.h *
3 25
  *************/
@@ -53,59 +75,62 @@ enum {
53 75
   MAX_VELOCITY_SCREEN_CACHE,
54 76
   MAX_ACCELERATION_SCREEN_CACHE,
55 77
   DEFAULT_ACCELERATION_SCREEN_CACHE,
56
-#if HAS_LEVELING
57
-  LEVELING_SCREEN_CACHE,
58
-  #if HAS_BED_PROBE
59
-    ZOFFSET_SCREEN_CACHE,
78
+  #if HAS_LEVELING
79
+    LEVELING_SCREEN_CACHE,
80
+    #if HAS_BED_PROBE
81
+      ZOFFSET_SCREEN_CACHE,
82
+    #endif
83
+    #if HAS_MESH
84
+      BED_MESH_SCREEN_CACHE,
85
+    #endif
60 86
   #endif
61
-  #if HAS_MESH
62
-    BED_MESH_SCREEN_CACHE,
87
+  #if ENABLED(BABYSTEPPING)
88
+    ADJUST_OFFSETS_SCREEN_CACHE,
89
+  #endif
90
+  #if HAS_TRINAMIC_CONFIG
91
+    STEPPER_CURRENT_SCREEN_CACHE,
92
+    STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE,
93
+  #endif
94
+  #if HAS_MULTI_HOTEND
95
+    NOZZLE_OFFSET_SCREEN_CACHE,
96
+  #endif
97
+  #if ENABLED(BACKLASH_GCODE)
98
+    BACKLASH_COMPENSATION_SCREEN_CACHE,
99
+  #endif
100
+  #if HAS_JUNCTION_DEVIATION
101
+    JUNC_DEV_SCREEN_CACHE,
102
+  #else
103
+    JERK_SCREEN_CACHE,
104
+  #endif
105
+  #if ENABLED(CASE_LIGHT_ENABLE)
106
+    CASE_LIGHT_SCREEN_CACHE,
107
+  #endif
108
+  #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
109
+    FILAMENT_MENU_CACHE,
110
+  #endif
111
+  #if ENABLED(LIN_ADVANCE)
112
+    LINEAR_ADVANCE_SCREEN_CACHE,
113
+  #endif
114
+  #if ENABLED(FILAMENT_RUNOUT_SENSOR)
115
+    FILAMENT_RUNOUT_SCREEN_CACHE,
116
+  #endif
117
+  #if ENABLED(TOUCH_UI_LULZBOT_BIO)
118
+    PRINTING_SCREEN_CACHE,
119
+  #endif
120
+  #if ENABLED(TOUCH_UI_COCOA_PRESS)
121
+    PREHEAT_MENU_CACHE,
122
+    PREHEAT_TIMER_SCREEN_CACHE,
123
+    UNLOAD_CARTRIDGE_SCREEN_CACHE,
124
+    LOAD_CHOCOLATE_SCREEN_CACHE,
125
+    MOVE_XYZ_SCREEN_CACHE,
126
+    MOVE_E_SCREEN_CACHE,
127
+  #endif
128
+  #if ENABLED(SDSUPPORT)
129
+    FILES_SCREEN_CACHE,
130
+  #endif
131
+  #if ENABLED(CUSTOM_USER_MENUS)
132
+    CUSTOM_USER_MENUS_SCREEN_CACHE,
63 133
   #endif
64
-#endif
65
-#if ENABLED(BABYSTEPPING)
66
-  ADJUST_OFFSETS_SCREEN_CACHE,
67
-#endif
68
-#if HAS_TRINAMIC_CONFIG
69
-  STEPPER_CURRENT_SCREEN_CACHE,
70
-  STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE,
71
-#endif
72
-#if HAS_MULTI_HOTEND
73
-  NOZZLE_OFFSET_SCREEN_CACHE,
74
-#endif
75
-#if ENABLED(BACKLASH_GCODE)
76
-  BACKLASH_COMPENSATION_SCREEN_CACHE,
77
-#endif
78
-#if HAS_JUNCTION_DEVIATION
79
-  JUNC_DEV_SCREEN_CACHE,
80
-#else
81
-  JERK_SCREEN_CACHE,
82
-#endif
83
-#if ENABLED(CASE_LIGHT_ENABLE)
84
-  CASE_LIGHT_SCREEN_CACHE,
85
-#endif
86
-#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
87
-  FILAMENT_MENU_CACHE,
88
-#endif
89
-#if ENABLED(LIN_ADVANCE)
90
-  LINEAR_ADVANCE_SCREEN_CACHE,
91
-#endif
92
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
93
-  FILAMENT_RUNOUT_SCREEN_CACHE,
94
-#endif
95
-#if ENABLED(TOUCH_UI_LULZBOT_BIO)
96
-  PRINTING_SCREEN_CACHE,
97
-#endif
98
-#if ENABLED(TOUCH_UI_COCOA_PRESS)
99
-  PREHEAT_MENU_CACHE,
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,
105
-#endif
106
-#if ENABLED(SDSUPPORT)
107
-  FILES_SCREEN_CACHE,
108
-#endif
109 134
   CHANGE_FILAMENT_SCREEN_CACHE,
110 135
   INTERFACE_SETTINGS_SCREEN_CACHE,
111 136
   INTERFACE_SOUNDS_SCREEN_CACHE,
@@ -247,6 +272,14 @@ class ConfirmUserRequestAlertBox : public AlertDialogBox {
247 272
     static void show(const char*);
248 273
 };
249 274
 
275
+#if ENABLED(CUSTOM_USER_MENUS)
276
+  class CustomUserMenus : public BaseScreen, public CachedScreen<CUSTOM_USER_MENUS_SCREEN_CACHE> {
277
+    public:
278
+      static void onRedraw(draw_mode_t);
279
+      static bool onTouchEnd(uint8_t tag);
280
+  };
281
+#endif
282
+
250 283
 class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen<SPINNER_CACHE,SPINNER_DL_SIZE> {
251 284
   public:
252 285
     static void onRedraw(draw_mode_t);
@@ -496,6 +529,7 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen<STEP
496 529
 #endif
497 530
 
498 531
 #if HAS_LEVELING
532
+
499 533
   class LevelingMenu : public BaseScreen, public CachedScreen<LEVELING_SCREEN_CACHE> {
500 534
     public:
501 535
       static void onRedraw(draw_mode_t);
@@ -511,35 +545,38 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen<STEP
511 545
   #endif
512 546
 
513 547
   #if HAS_MESH
514
-  class BedMeshScreen : public BaseScreen, public CachedScreen<BED_MESH_SCREEN_CACHE> {
515
-    private:
516
-      enum MeshOpts {
517
-        USE_POINTS    = 0x01,
518
-        USE_COLORS    = 0x02,
519
-        USE_TAGS      = 0x04,
520
-        USE_HIGHLIGHT = 0x08,
521
-        USE_AUTOSCALE = 0x10
522
-      };
523
-
524
-      static uint8_t pointToTag(uint8_t x, uint8_t y);
525
-      static bool tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y);
526
-      static float getHightlightedValue();
527
-      static void drawHighlightedPointValue();
528
-      static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1);
529
-      static bool isMeshComplete(ExtUI::bed_mesh_t data);
530 548
 
531
-    public:
532
-      static void onMeshUpdate(const int8_t x, const int8_t y, const float val);
533
-      static void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t);
534
-      static void onEntry();
535
-      static void onRedraw(draw_mode_t);
536
-      static bool onTouchStart(uint8_t tag);
537
-      static bool onTouchEnd(uint8_t tag);
549
+    class BedMeshScreen : public BaseScreen, public CachedScreen<BED_MESH_SCREEN_CACHE> {
550
+      private:
551
+        enum MeshOpts {
552
+          USE_POINTS    = 0x01,
553
+          USE_COLORS    = 0x02,
554
+          USE_TAGS      = 0x04,
555
+          USE_HIGHLIGHT = 0x08,
556
+          USE_AUTOSCALE = 0x10
557
+        };
558
+
559
+        static uint8_t pointToTag(uint8_t x, uint8_t y);
560
+        static bool tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y);
561
+        static float getHightlightedValue();
562
+        static void drawHighlightedPointValue();
563
+        static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1);
564
+        static bool isMeshComplete(ExtUI::bed_mesh_t data);
538 565
 
539
-      static void startMeshProbe();
540
-  };
541
-  #endif
542
-#endif
566
+      public:
567
+        static void onMeshUpdate(const int8_t x, const int8_t y, const float val);
568
+        static void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t);
569
+        static void onEntry();
570
+        static void onRedraw(draw_mode_t);
571
+        static bool onTouchStart(uint8_t tag);
572
+        static bool onTouchEnd(uint8_t tag);
573
+
574
+        static void startMeshProbe();
575
+    };
576
+
577
+  #endif // HAS_MESH
578
+
579
+#endif // HAS_LEVELING
543 580
 
544 581
 #if ENABLED(BABYSTEPPING)
545 582
   class NudgeNozzleScreen : public BaseNumericAdjustmentScreen, public CachedScreen<ADJUST_OFFSETS_SCREEN_CACHE> {
@@ -727,6 +764,7 @@ class LockScreen : public BaseScreen, public CachedScreen<LOCK_SCREEN_CACHE> {
727 764
 };
728 765
 
729 766
 #if ENABLED(SDSUPPORT)
767
+
730 768
   class FilesScreen : public BaseScreen, public CachedScreen<FILES_SCREEN_CACHE, FILE_SCREEN_DL_SIZE> {
731 769
     private:
732 770
       #ifdef TOUCH_UI_PORTRAIT
@@ -761,7 +799,8 @@ class LockScreen : public BaseScreen, public CachedScreen<LOCK_SCREEN_CACHE> {
761 799
       static bool onTouchEnd(uint8_t tag);
762 800
       static void onIdle();
763 801
   };
764
-#endif
802
+
803
+#endif // SDSUPPORT
765 804
 
766 805
 class EndstopStatesScreen : public BaseScreen, public UncachedScreen {
767 806
   public:
@@ -779,6 +818,7 @@ class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScr
779 818
 };
780 819
 
781 820
 #if ENABLED(TOUCH_UI_DEVELOPER_MENU)
821
+
782 822
   class DeveloperMenu : public BaseScreen, public UncachedScreen {
783 823
     public:
784 824
       static void onRedraw(draw_mode_t);
@@ -815,7 +855,8 @@ class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScr
815 855
       static bool onTouchEnd(uint8_t tag);
816 856
       static void onIdle();
817 857
   };
818
-#endif
858
+
859
+#endif // TOUCH_UI_DEVELOPER_MENU
819 860
 
820 861
 class MediaPlayerScreen : public BaseScreen, public UncachedScreen {
821 862
   private:
@@ -840,6 +881,7 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen {
840 881
 #endif
841 882
 
842 883
 #if ENABLED(TOUCH_UI_COCOA_PRESS)
884
+
843 885
   class PreheatMenu : public BaseScreen, public CachedScreen<PREHEAT_MENU_CACHE> {
844 886
     public:
845 887
       static void onRedraw(draw_mode_t);
@@ -888,4 +930,5 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen {
888 930
       static void onRedraw(draw_mode_t);
889 931
       static void onIdle();
890 932
   };
891
-#endif
933
+
934
+#endif // TOUCH_UI_COCOA_PRESS

Loading…
Cancel
Save