Quellcode durchsuchen

New Touch UI buttons (#19465)

Marcio T vor 4 Jahren
Ursprung
Commit
362145f608
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 25
- 18
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp Datei anzeigen

@@ -35,27 +35,29 @@ using namespace ExtUI;
35 35
 using namespace Theme;
36 36
 
37 37
 #ifdef TOUCH_UI_PORTRAIT
38
-  #define GRID_ROWS 9
38
+  #define GRID_ROWS 10
39 39
   #define GRID_COLS 2
40 40
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
41 41
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
42 42
   #define LEVEL_AXIS_POS     BTN_POS(1,3), BTN_SIZE(2,1)
43
-  #define SHOW_MESH_POS      BTN_POS(1,4), BTN_SIZE(2,1)
44
-  #define BLTOUCH_TITLE_POS  BTN_POS(1,6), BTN_SIZE(2,1)
45
-  #define BLTOUCH_RESET_POS  BTN_POS(1,7), BTN_SIZE(1,1)
46
-  #define BLTOUCH_TEST_POS   BTN_POS(2,7), BTN_SIZE(1,1)
47
-  #define BACK_POS           BTN_POS(1,9), BTN_SIZE(2,1)
43
+  #define Z_AUTO_ALIGN_POS   BTN_POS(1,4), BTN_SIZE(2,1)
44
+  #define SHOW_MESH_POS      BTN_POS(1,5), BTN_SIZE(2,1)
45
+  #define BLTOUCH_TITLE_POS  BTN_POS(1,7), BTN_SIZE(2,1)
46
+  #define BLTOUCH_RESET_POS  BTN_POS(1,8), BTN_SIZE(1,1)
47
+  #define BLTOUCH_TEST_POS   BTN_POS(2,8), BTN_SIZE(1,1)
48
+  #define BACK_POS           BTN_POS(1,10), BTN_SIZE(2,1)
48 49
 #else
49
-  #define GRID_ROWS 7
50
+  #define GRID_ROWS 8
50 51
   #define GRID_COLS 2
51 52
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
52 53
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
53 54
   #define LEVEL_AXIS_POS     BTN_POS(1,3), BTN_SIZE(2,1)
54
-  #define SHOW_MESH_POS      BTN_POS(1,4), BTN_SIZE(2,1)
55
-  #define BLTOUCH_TITLE_POS  BTN_POS(1,5), BTN_SIZE(2,1)
56
-  #define BLTOUCH_RESET_POS  BTN_POS(1,6), BTN_SIZE(1,1)
57
-  #define BLTOUCH_TEST_POS   BTN_POS(2,6), BTN_SIZE(1,1)
58
-  #define BACK_POS           BTN_POS(1,7), BTN_SIZE(2,1)
55
+  #define Z_AUTO_ALIGN_POS   BTN_POS(1,4), BTN_SIZE(2,1)
56
+  #define SHOW_MESH_POS      BTN_POS(1,5), BTN_SIZE(2,1)
57
+  #define BLTOUCH_TITLE_POS  BTN_POS(1,6), BTN_SIZE(2,1)
58
+  #define BLTOUCH_RESET_POS  BTN_POS(1,7), BTN_SIZE(1,1)
59
+  #define BLTOUCH_TEST_POS   BTN_POS(2,7), BTN_SIZE(1,1)
60
+  #define BACK_POS           BTN_POS(1,8), BTN_SIZE(2,1)
59 61
 #endif
60 62
 
61 63
 void LevelingMenu::onRedraw(draw_mode_t what) {
@@ -78,12 +80,14 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
78 80
          #endif
79 81
         )
80 82
        .tag(3).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
83
+       .enabled(ENABLED(Z_STEPPER_AUTO_ALIGN))
84
+       .tag(4).button(Z_AUTO_ALIGN_POS, GET_TEXT_F(MSG_AUTO_Z_ALIGN))
81 85
        .enabled(ENABLED(HAS_MESH))
82
-       .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH));
86
+       .tag(5).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH));
83 87
     #if ENABLED(BLTOUCH)
84 88
       cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
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));
89
+         .tag(6).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
90
+         .tag(7).button(BLTOUCH_TEST_POS,  GET_TEXT_F(MSG_BLTOUCH_SELFTEST));
87 91
     #endif
88 92
     cmd.colors(action_btn)
89 93
        .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
@@ -103,12 +107,15 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
103 107
     #ifdef AXIS_LEVELING_COMMANDS
104 108
     case 3: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
105 109
     #endif
110
+    #if ENABLED(Z_STEPPER_AUTO_ALIGN)
111
+    case 4: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
112
+    #endif
106 113
     #if HAS_MESH
107
-    case 4: GOTO_SCREEN(BedMeshScreen); break;
114
+    case 5: GOTO_SCREEN(BedMeshScreen); break;
108 115
     #endif
109 116
     #if ENABLED(BLTOUCH)
110
-    case 5: injectCommands_P(PSTR("M280 P0 S60")); break;
111
-    case 6: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
117
+    case 6: injectCommands_P(PSTR("M280 P0 S60")); break;
118
+    case 7: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
112 119
     #endif
113 120
     default: return false;
114 121
   }

+ 11
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp Datei anzeigen

@@ -37,7 +37,7 @@ void TuneMenu::onRedraw(draw_mode_t what) {
37 37
   }
38 38
 
39 39
   #ifdef TOUCH_UI_PORTRAIT
40
-    #define GRID_ROWS 8
40
+    #define GRID_ROWS 9
41 41
     #define GRID_COLS 2
42 42
     #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1)
43 43
     #define FIL_CHANGE_POS  BTN_POS(1,2), BTN_SIZE(2,1)
@@ -46,9 +46,10 @@ void TuneMenu::onRedraw(draw_mode_t what) {
46 46
     #define SPEED_POS       BTN_POS(1,5), BTN_SIZE(2,1)
47 47
     #define PAUSE_POS       BTN_POS(1,6), BTN_SIZE(2,1)
48 48
     #define STOP_POS        BTN_POS(1,7), BTN_SIZE(2,1)
49
-    #define BACK_POS        BTN_POS(1,8), BTN_SIZE(2,1)
49
+    #define CASE_LIGHT_POS  BTN_POS(1,8), BTN_SIZE(2,1)
50
+    #define BACK_POS        BTN_POS(1,9), BTN_SIZE(2,1)
50 51
   #else
51
-    #define GRID_ROWS 4
52
+    #define GRID_ROWS 5
52 53
     #define GRID_COLS 2
53 54
     #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(1,1)
54 55
     #define NUDGE_NOZ_POS   BTN_POS(2,1), BTN_SIZE(1,1)
@@ -57,7 +58,8 @@ void TuneMenu::onRedraw(draw_mode_t what) {
57 58
     #define PAUSE_POS       BTN_POS(1,3), BTN_SIZE(1,1)
58 59
     #define STOP_POS        BTN_POS(2,3), BTN_SIZE(1,1)
59 60
     #define FILAMENT_POS    BTN_POS(1,4), BTN_SIZE(1,1)
60
-    #define BACK_POS        BTN_POS(2,4), BTN_SIZE(1,1)
61
+    #define CASE_LIGHT_POS  BTN_POS(2,4), BTN_SIZE(1,1)
62
+    #define BACK_POS        BTN_POS(1,5), BTN_SIZE(2,1)
61 63
   #endif
62 64
 
63 65
   if (what & FOREGROUND) {
@@ -79,6 +81,8 @@ void TuneMenu::onRedraw(draw_mode_t what) {
79 81
        .button( PAUSE_POS, isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT))
80 82
        .enabled(TERN0(SDSUPPORT, isPrintingFromMedia()))
81 83
        .tag(8).button( STOP_POS, GET_TEXT_F(MSG_STOP_PRINT))
84
+       .enabled(ENABLED(CASE_LIGHT_ENABLE))
85
+       .tag(10).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT))
82 86
        .tag(1).colors(action_btn)
83 87
              .button( BACK_POS, GET_TEXT_F(MSG_BACK));
84 88
   }
@@ -111,6 +115,9 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
111 115
     #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
112 116
     case 9:  GOTO_SCREEN(FilamentMenu); break;
113 117
     #endif
118
+    #if ENABLED(CASE_LIGHT_ENABLE)
119
+    case 10: GOTO_SCREEN(CaseLightScreen); break;
120
+    #endif
114 121
     default:
115 122
       return false;
116 123
   }

Laden…
Abbrechen
Speichern