Browse Source

🎨 E3V2 corner leveling => tramming (#23375)

Lefteris Garyfalakis 2 years ago
parent
commit
16a1a55cea
No account linked to committer's email address

+ 23
- 25
Marlin/src/lcd/e3v2/enhanced/dwin.cpp View File

216
 
216
 
217
 // New menu system pointers
217
 // New menu system pointers
218
 MenuClass *PrepareMenu = nullptr;
218
 MenuClass *PrepareMenu = nullptr;
219
-MenuClass *LevBedMenu = nullptr;
219
+MenuClass *TrammingMenu = nullptr;
220
 MenuClass *MoveMenu = nullptr;
220
 MenuClass *MoveMenu = nullptr;
221
 MenuClass *ControlMenu = nullptr;
221
 MenuClass *ControlMenu = nullptr;
222
 MenuClass *AdvancedSettings = nullptr;
222
 MenuClass *AdvancedSettings = nullptr;
1703
 void DWIN_StartHoming() {
1703
 void DWIN_StartHoming() {
1704
   HMI_flag.home_flag = true;
1704
   HMI_flag.home_flag = true;
1705
   HMI_SaveProcessID(Homing);
1705
   HMI_SaveProcessID(Homing);
1706
-  Title.ShowCaption(F("Axis Homing"));
1707
-  DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done."));
1706
+  Title.ShowCaption(GET_TEXT_F(MSG_LEVEL_BED_HOMING));
1707
+  DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), F("Please wait until done."));
1708
 }
1708
 }
1709
 
1709
 
1710
 void DWIN_CompletedHoming() {
1710
 void DWIN_CompletedHoming() {
1719
 void DWIN_MeshLevelingStart() {
1719
 void DWIN_MeshLevelingStart() {
1720
   #if HAS_ONESTEP_LEVELING
1720
   #if HAS_ONESTEP_LEVELING
1721
     HMI_SaveProcessID(Leveling);
1721
     HMI_SaveProcessID(Leveling);
1722
-    Title.ShowCaption(F("Bed Leveling"));
1722
+    Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING));
1723
     DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done."));
1723
     DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done."));
1724
   #elif ENABLED(MESH_BED_LEVELING)
1724
   #elif ENABLED(MESH_BED_LEVELING)
1725
     Draw_ManualMesh_Menu();
1725
     Draw_ManualMesh_Menu();
2403
 void ApplyFlow() { planner.refresh_e_factor(0); }
2403
 void ApplyFlow() { planner.refresh_e_factor(0); }
2404
 void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); }
2404
 void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); }
2405
 
2405
 
2406
-// Leveling Bed Corners
2407
-void LevBed(uint8_t point) {
2406
+// Bed Tramming
2407
+void Tram(uint8_t point) {
2408
   char cmd[100] = "";
2408
   char cmd[100] = "";
2409
   #if HAS_ONESTEP_LEVELING
2409
   #if HAS_ONESTEP_LEVELING
2410
     static bool inLev = false;
2410
     static bool inLev = false;
2411
     if (inLev) return;
2411
     if (inLev) return;
2412
     char str_1[6] = "", str_2[6] = "", str_3[6] = "";
2412
     char str_1[6] = "", str_2[6] = "", str_3[6] = "";
2413
-    #define fmt "X:%s, Y:%s, Z:%s"
2414
     float xpos = 0, ypos = 0, zval = 0;
2413
     float xpos = 0, ypos = 0, zval = 0;
2415
     float margin = PROBING_MARGIN;
2414
     float margin = PROBING_MARGIN;
2416
   #else
2415
   #else
2417
-    #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"
2418
     int16_t xpos = 0, ypos = 0;
2416
     int16_t xpos = 0, ypos = 0;
2419
     int16_t margin = 30;
2417
     int16_t margin = 30;
2420
   #endif
2418
   #endif
2449
     planner.synchronize();
2447
     planner.synchronize();
2450
     inLev = true;
2448
     inLev = true;
2451
     zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
2449
     zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW);
2452
-    sprintf_P(cmd, PSTR(fmt),
2450
+    sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"),
2453
       dtostrf(xpos, 1, 1, str_1),
2451
       dtostrf(xpos, 1, 1, str_1),
2454
       dtostrf(ypos, 1, 1, str_2),
2452
       dtostrf(ypos, 1, 1, str_2),
2455
       dtostrf(zval, 1, 2, str_3)
2453
       dtostrf(zval, 1, 2, str_3)
2458
     inLev = false;
2456
     inLev = false;
2459
   #else
2457
   #else
2460
     planner.synchronize();
2458
     planner.synchronize();
2461
-    sprintf_P(cmd, PSTR(fmt), xpos, ypos);
2459
+    sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos);
2462
     queue.inject(cmd);
2460
     queue.inject(cmd);
2463
   #endif
2461
   #endif
2464
 }
2462
 }
2465
 
2463
 
2466
-void LevBedFL() { LevBed(0); }
2467
-void LevBedFR() { LevBed(1); }
2468
-void LevBedBR() { LevBed(2); }
2469
-void LevBedBL() { LevBed(3); }
2470
-void LevBedC () { LevBed(4); }
2464
+void TramFL() { Tram(0); }
2465
+void TramFR() { Tram(1); }
2466
+void TramBR() { Tram(2); }
2467
+void TramBL() { Tram(3); }
2468
+void TramC () { Tram(4); }
2471
 
2469
 
2472
 #if ENABLED(MESH_BED_LEVELING)
2470
 #if ENABLED(MESH_BED_LEVELING)
2473
 
2471
 
3184
       ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu);
3182
       ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu);
3185
     #endif
3183
     #endif
3186
     ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Goto_Move_Menu);
3184
     ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Goto_Move_Menu);
3187
-    ADDMENUITEM(ICON_LevBed, GET_TEXT_F(MSG_BED_LEVELING), onDrawSubMenu, Draw_LevBedCorners_Menu);
3185
+    ADDMENUITEM(ICON_Tram, GET_TEXT_F(MSG_BED_TRAMMING), onDrawSubMenu, Draw_Tramming_Menu);
3188
     ADDMENUITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors);
3186
     ADDMENUITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors);
3189
     #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
3187
     #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
3190
       ADDMENUITEM(ICON_Homing, GET_TEXT_F(MSG_HOMING), onDrawSubMenu, Draw_Homing_Menu);
3188
       ADDMENUITEM(ICON_Homing, GET_TEXT_F(MSG_HOMING), onDrawSubMenu, Draw_Homing_Menu);
3218
   CurrentMenu->draw();
3216
   CurrentMenu->draw();
3219
 }
3217
 }
3220
 
3218
 
3221
-void Draw_LevBedCorners_Menu() {
3219
+void Draw_Tramming_Menu() {
3222
   DWINUI::ClearMenuArea();
3220
   DWINUI::ClearMenuArea();
3223
   checkkey = Menu;
3221
   checkkey = Menu;
3224
-  if (!LevBedMenu) LevBedMenu = new MenuClass();
3225
-  if (CurrentMenu != LevBedMenu) {
3226
-    CurrentMenu = LevBedMenu;
3222
+  if (!TrammingMenu) TrammingMenu = new MenuClass();
3223
+  if (CurrentMenu != TrammingMenu) {
3224
+    CurrentMenu = TrammingMenu;
3227
     SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG
3225
     SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG
3228
     DWINUI::MenuItemsPrepare(6);
3226
     DWINUI::MenuItemsPrepare(6);
3229
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3227
     ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu);
3230
-    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL);
3231
-    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, LevBedFR);
3232
-    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, LevBedBR);
3233
-    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, LevBedBL);
3234
-    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, LevBedC );
3228
+    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, TramFL);
3229
+    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, TramFR);
3230
+    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, TramBR);
3231
+    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, TramBL);
3232
+    ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC );
3235
   }
3233
   }
3236
   CurrentMenu->draw();
3234
   CurrentMenu->draw();
3237
 }
3235
 }

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/dwin.h View File

211
 void Draw_AdvancedSettings_Menu();
211
 void Draw_AdvancedSettings_Menu();
212
 void Draw_Prepare_Menu();
212
 void Draw_Prepare_Menu();
213
 void Draw_Move_Menu();
213
 void Draw_Move_Menu();
214
-void Draw_LevBedCorners_Menu();
214
+void Draw_Tramming_Menu();
215
 #if HAS_HOME_OFFSET
215
 #if HAS_HOME_OFFSET
216
   void Draw_HomeOffset_Menu();
216
   void Draw_HomeOffset_Menu();
217
 #endif
217
 #endif

+ 1
- 1
Marlin/src/lcd/e3v2/enhanced/dwinui.h View File

52
 #define ICON_HomeX                ICON_MoveX
52
 #define ICON_HomeX                ICON_MoveX
53
 #define ICON_HomeY                ICON_MoveY
53
 #define ICON_HomeY                ICON_MoveY
54
 #define ICON_HomeZ                ICON_MoveZ
54
 #define ICON_HomeZ                ICON_MoveZ
55
-#define ICON_LevBed               ICON_SetEndTemp
55
+#define ICON_Tram                 ICON_SetEndTemp
56
 #define ICON_Lock                 ICON_Cool
56
 #define ICON_Lock                 ICON_Cool
57
 #define ICON_ManualMesh           ICON_HotendTemp
57
 #define ICON_ManualMesh           ICON_HotendTemp
58
 #define ICON_MeshNext             ICON_Axis
58
 #define ICON_MeshNext             ICON_Axis

Loading…
Cancel
Save