瀏覽代碼

New Touch UI buttons (#19465)

Marcio T 4 年之前
父節點
當前提交
362145f608
No account linked to committer's email address

+ 25
- 18
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp 查看文件

35
 using namespace Theme;
35
 using namespace Theme;
36
 
36
 
37
 #ifdef TOUCH_UI_PORTRAIT
37
 #ifdef TOUCH_UI_PORTRAIT
38
-  #define GRID_ROWS 9
38
+  #define GRID_ROWS 10
39
   #define GRID_COLS 2
39
   #define GRID_COLS 2
40
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
40
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
41
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
41
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
42
   #define LEVEL_AXIS_POS     BTN_POS(1,3), BTN_SIZE(2,1)
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
 #else
49
 #else
49
-  #define GRID_ROWS 7
50
+  #define GRID_ROWS 8
50
   #define GRID_COLS 2
51
   #define GRID_COLS 2
51
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
52
   #define TITLE_POS          BTN_POS(1,1), BTN_SIZE(2,1)
52
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
53
   #define LEVEL_BED_POS      BTN_POS(1,2), BTN_SIZE(2,1)
53
   #define LEVEL_AXIS_POS     BTN_POS(1,3), BTN_SIZE(2,1)
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
 #endif
61
 #endif
60
 
62
 
61
 void LevelingMenu::onRedraw(draw_mode_t what) {
63
 void LevelingMenu::onRedraw(draw_mode_t what) {
78
          #endif
80
          #endif
79
         )
81
         )
80
        .tag(3).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
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
        .enabled(ENABLED(HAS_MESH))
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
     #if ENABLED(BLTOUCH)
87
     #if ENABLED(BLTOUCH)
84
       cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
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
     #endif
91
     #endif
88
     cmd.colors(action_btn)
92
     cmd.colors(action_btn)
89
        .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
93
        .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
103
     #ifdef AXIS_LEVELING_COMMANDS
107
     #ifdef AXIS_LEVELING_COMMANDS
104
     case 3: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
108
     case 3: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
105
     #endif
109
     #endif
110
+    #if ENABLED(Z_STEPPER_AUTO_ALIGN)
111
+    case 4: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
112
+    #endif
106
     #if HAS_MESH
113
     #if HAS_MESH
107
-    case 4: GOTO_SCREEN(BedMeshScreen); break;
114
+    case 5: GOTO_SCREEN(BedMeshScreen); break;
108
     #endif
115
     #endif
109
     #if ENABLED(BLTOUCH)
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
     #endif
119
     #endif
113
     default: return false;
120
     default: return false;
114
   }
121
   }

+ 11
- 4
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp 查看文件

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

Loading…
取消
儲存