Просмотр исходного кода

🔧 Define MarlinUI axis moves with lists (#26344)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
ellensp 1 год назад
Родитель
Сommit
36e66bdd9f

+ 5 - 5
Marlin/Configuration.h

@@ -950,7 +950,7 @@
   // Distance between bed and nozzle Z home position
   #define DELTA_HEIGHT 250.00             // (mm) Get this value from G33 auto calibrate
 
-  #define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
+  #define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate
 
   // Horizontal distance bridged by diagonal push rods when effector is centered.
   #define DELTA_RADIUS 124.0              // (mm) Get this value from G33 auto calibrate
@@ -958,11 +958,11 @@
   // Trim adjustments for individual towers
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
   // measured in degrees anticlockwise looking from above the printer
-  #define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
+  #define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate
 
-  // Delta radius and diagonal rod adjustments (mm)
-  //#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 }
-  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 }
+  // Delta radius and diagonal rod adjustments
+  //#define DELTA_RADIUS_TRIM_TOWER       { 0.0, 0.0, 0.0 } // (mm)
+  //#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } // (mm)
 #endif
 
 // @section scara

+ 14 - 2
Marlin/Configuration_adv.h

@@ -1518,8 +1518,20 @@
     //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
   #endif
 
-  // Add 50/100mm moves to MarlinUI even with a smaller bed
-  //#define LARGE_MOVE_ITEMS
+  /**
+   * MarlinUI "Move Axis" menu distances. Comma-separated list.
+   * Values are displayed as-defined, so always use plain numbers here.
+   * Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH
+   * will be shown in the move submenus.
+   */
+  #define MANUAL_MOVE_DISTANCE_MM                    10, 1.0, 0.1  // (mm)
+  //#define MANUAL_MOVE_DISTANCE_MM         100, 50, 10, 1.0, 0.1  // (mm)
+  //#define MANUAL_MOVE_DISTANCE_MM    500, 100, 50, 10, 1.0, 0.1  // (mm)
+
+  // Manual move distances for INCH_MODE_SUPPORT
+  #define MANUAL_MOVE_DISTANCE_IN                          0.100, 0.010, 0.001  // (in)
+  //#define MANUAL_MOVE_DISTANCE_IN          1.000, 0.500, 0.100, 0.010, 0.001  // (in)
+  //#define MANUAL_MOVE_DISTANCE_IN   5.000, 1.000, 0.500, 0.100, 0.010, 0.001  // (in)
 
   // BACK menu items keep the highlight at the top
   //#define TURBO_BACK_MENU_ITEM

+ 2 - 0
Marlin/src/inc/Changes.h

@@ -667,6 +667,8 @@
   #error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
 #elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX)
   #error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
+#elif defined(LARGE_MOVE_ITEMS)
+  #error "LARGE_MOVE_ITEMS is obsolete. Instead define MANUAL_MOVE_DISTANCE_MM and MANUAL_MOVE_DISTANCE_IN."
 #endif
 
 // L64xx stepper drivers have been removed

+ 5 - 0
Marlin/src/inc/Conditionals_adv.h

@@ -1303,3 +1303,8 @@
 #if defined(REDUNDANT_PART_COOLING_FAN) && !defined(NUM_REDUNDANT_FANS)
   #define NUM_REDUNDANT_FANS 1
 #endif
+
+// Clean up if only mm units are used
+#if DISABLED(INCH_MODE_SUPPORT)
+  #undef MANUAL_MOVE_DISTANCE_IN
+#endif

+ 3 - 8
Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp

@@ -433,14 +433,9 @@ void ChironTFT::sendFileList(int8_t startindex) {
 }
 
 void ChironTFT::selectFile() {
-  if (panel_type <= AC_panel_new) {
-    strncpy(selectedfile, panel_command + 4, command_len - 3);
-    selectedfile[command_len - 4] = '\0';
-  }
-  else {
-    strncpy(selectedfile, panel_command + 4, command_len - 4);
-    selectedfile[command_len - 5] = '\0';
-  }
+  const size_t namelen = command_len - 4 + (panel_type <= AC_panel_new);
+  strncpy(selectedfile, panel_command + 4, namelen);
+  selectedfile[namelen] = '\0';
   #if ACDEBUG(AC_FILE)
     DEBUG_ECHOLNPGM(" Selected File: ", selectedfile);
   #endif

+ 1 - 5
Marlin/src/lcd/language/language_an.h

@@ -87,11 +87,7 @@ namespace LanguageNarrow_an {
   LSTR MSG_MOVE_E                         = _UxGT("Extrusor");
   LSTR MSG_MOVE_EN                        = _UxGT("Extrusor *");
   LSTR MSG_MOVE_N_MM                      = _UxGT("Mover $mm");
-  LSTR MSG_MOVE_01MM                      = _UxGT("Mover 0.1mm");
-  LSTR MSG_MOVE_1MM                       = _UxGT("Mover 1mm");
-  LSTR MSG_MOVE_10MM                      = _UxGT("Mover 10mm");
-  LSTR MSG_MOVE_50MM                      = _UxGT("Mover 50mm");
-  LSTR MSG_MOVE_100MM                     = _UxGT("Mover 100mm");
+  LSTR MSG_MOVE_N_IN                      = _UxGT("Mover $in");
   LSTR MSG_SPEED                          = _UxGT("Velocidat");
   LSTR MSG_MESH_Z_OFFSET                  = _UxGT("Base Z");
   LSTR MSG_NOZZLE                         = _UxGT("Boquilla");

+ 1 - 5
Marlin/src/lcd/language/language_bg.h

@@ -76,11 +76,7 @@ namespace LanguageNarrow_bg {
   LSTR MSG_MOVE_E                         = _UxGT("Екструдер");
   LSTR MSG_MOVE_EN                        = _UxGT("Екструдер *");
   LSTR MSG_MOVE_N_MM                      = _UxGT("Премести с $mm");
-  LSTR MSG_MOVE_01MM                      = _UxGT("Премести с 0.1mm");
-  LSTR MSG_MOVE_1MM                       = _UxGT("Премести с 1mm");
-  LSTR MSG_MOVE_10MM                      = _UxGT("Премести с 10mm");
-  LSTR MSG_MOVE_50MM                      = _UxGT("Премести с 50mm");
-  LSTR MSG_MOVE_100MM                     = _UxGT("Премести с 100mm");
+  LSTR MSG_MOVE_N_IN                      = _UxGT("Премести с $in");
   LSTR MSG_SPEED                          = _UxGT("Скорост");
   LSTR MSG_MESH_Z_OFFSET                  = _UxGT("Bed Z");
   LSTR MSG_NOZZLE                         = " " LCD_STR_THERMOMETER _UxGT(" Дюза");

+ 1 - 5
Marlin/src/lcd/language/language_ca.h

@@ -87,11 +87,7 @@ namespace LanguageNarrow_ca {
   LSTR MSG_MOVE_E                         = _UxGT("Extrusor");
   LSTR MSG_MOVE_EN                        = _UxGT("Extrusor *");
   LSTR MSG_MOVE_N_MM                      = _UxGT("Mou $mm");
-  LSTR MSG_MOVE_01MM                      = _UxGT("Mou 0.1mm");
-  LSTR MSG_MOVE_1MM                       = _UxGT("Mou 1mm");
-  LSTR MSG_MOVE_10MM                      = _UxGT("Mou 10mm");
-  LSTR MSG_MOVE_50MM                      = _UxGT("Mou 50mm");
-  LSTR MSG_MOVE_100MM                     = _UxGT("Mou 100mm");
+  LSTR MSG_MOVE_N_IN                      = _UxGT("Mou $in");
   LSTR MSG_SPEED                          = _UxGT("Velocitat");
   LSTR MSG_MESH_Z_OFFSET                  = _UxGT("Llit Z");
   LSTR MSG_NOZZLE                         = _UxGT("Nozzle");

+ 1 - 5
Marlin/src/lcd/language/language_cz.h

@@ -231,11 +231,7 @@ namespace LanguageNarrow_cz {
   LSTR MSG_MOVE_EN                        = _UxGT("Extrudér *");
   LSTR MSG_HOTEND_TOO_COLD                = _UxGT("Hotend je studený");
   LSTR MSG_MOVE_N_MM                      = _UxGT("Posunout o $mm");
-  LSTR MSG_MOVE_01MM                      = _UxGT("Posunout o 0,1mm");
-  LSTR MSG_MOVE_1MM                       = _UxGT("Posunout o 1mm");
-  LSTR MSG_MOVE_10MM                      = _UxGT("Posunout o 10mm");
-  LSTR MSG_MOVE_50MM                      = _UxGT("Posunout o 50mm");
-  LSTR MSG_MOVE_100MM                     = _UxGT("Posunout o 100mm");
+  LSTR MSG_MOVE_N_IN                      = _UxGT("Posunout o $in");
   LSTR MSG_SPEED                          = _UxGT("Rychlost");
   LSTR MSG_MESH_Z_OFFSET                  = _UxGT("Výška podl.");
   LSTR MSG_NOZZLE                         = _UxGT("Tryska");

+ 1 - 5
Marlin/src/lcd/language/language_da.h

@@ -78,11 +78,7 @@ namespace LanguageNarrow_da {
   LSTR MSG_MOVE_E                         = _UxGT("Flyt E");
   LSTR MSG_MOVE_EN                        = _UxGT("Flyt *");
   LSTR MSG_MOVE_N_MM                      = _UxGT("Flyt $mm");
-  LSTR MSG_MOVE_01MM                      = _UxGT("Flyt 0.1mm");
-  LSTR MSG_MOVE_1MM                       = _UxGT("Flyt 1mm");
-  LSTR MSG_MOVE_10MM                      = _UxGT("Flyt 10mm");
-  LSTR MSG_MOVE_50MM                      = _UxGT("Flyt 50mm");
-  LSTR MSG_MOVE_100MM                     = _UxGT("Flyt 100mm");
+  LSTR MSG_MOVE_N_IN                      = _UxGT("Flyt $in");
   LSTR MSG_SPEED                          = _UxGT("Hastighed");
   LSTR MSG_MESH_Z_OFFSET                  = _UxGT("Plade Z");
   LSTR MSG_NOZZLE                         = _UxGT("Dyse");

Некоторые файлы не были показаны из-за большого количества измененных файлов