浏览代码

Move Motion Menu to its own file

Scott Lahteine 6 年前
父节点
当前提交
a489c9fa52

+ 0
- 477
Marlin/src/lcd/menu/menu.cpp 查看文件

@@ -282,8 +282,6 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
282 282
 
283 283
 bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
284 284
 
285
-float move_menu_scale;
286
-
287 285
 #if HAS_CHARACTER_LCD && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(LCD_PROGRESS_BAR_TEST) || ENABLED(AUTO_BED_LEVELING_UBL))
288 286
   void lcd_set_custom_characters(
289 287
     #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
@@ -364,22 +362,6 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
364 362
 ///////////// Manual Movement //////////////
365 363
 ////////////////////////////////////////////
366 364
 
367
-extern millis_t manual_move_start_time;
368
-extern int8_t manual_move_axis;
369
-
370
-#if IS_KINEMATIC
371
-  extern float manual_move_offset;
372
-#endif
373
-
374
-#if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1
375
-  extern int8_t manual_move_e_index;
376
-#endif
377
-
378
-#if ENABLED(MANUAL_E_MOVES_RELATIVE)
379
-  float manual_move_e_origin = 0;
380
-#endif
381
-
382
-
383 365
 //
384 366
 // Display the synchronize screen until moves are
385 367
 // finished, and don't return to the caller until
@@ -1261,8 +1243,6 @@ void _lcd_draw_homing() {
1261 1243
 
1262 1244
 #elif ENABLED(AUTO_BED_LEVELING_UBL)
1263 1245
 
1264
-  void _lcd_ubl_level_bed();
1265
-
1266 1246
   static int16_t ubl_storage_slot = 0,
1267 1247
              custom_hotend_temp = 190,
1268 1248
              side_points = 3,
@@ -1856,86 +1836,6 @@ void _lcd_draw_homing() {
1856 1836
 
1857 1837
 #endif // LCD_BED_LEVELING
1858 1838
 
1859
-/**
1860
- *
1861
- * "Movement" submenu
1862
- *
1863
- */
1864
-
1865
-void menu_movement() {
1866
-  START_MENU();
1867
-
1868
-  //
1869
-  // ^ Main
1870
-  //
1871
-  MENU_BACK(MSG_MAIN);
1872
-
1873
-  //
1874
-  // Move Axis
1875
-  //
1876
-  #if ENABLED(DELTA)
1877
-    if (all_axes_homed())
1878
-  #endif
1879
-      MENU_ITEM(submenu, MSG_MOVE_AXIS, menu_move);
1880
-
1881
-  //
1882
-  // Auto Home
1883
-  //
1884
-  MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1885
-  #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
1886
-    MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X"));
1887
-    MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y"));
1888
-    MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z"));
1889
-  #endif
1890
-
1891
-  //
1892
-  // TMC Z Calibration
1893
-  //
1894
-  #if ENABLED(TMC_Z_CALIBRATION)
1895
-    MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915"));
1896
-  #endif
1897
-
1898
-  //
1899
-  // Level Bed
1900
-  //
1901
-  #if ENABLED(AUTO_BED_LEVELING_UBL)
1902
-
1903
-    MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed);
1904
-
1905
-  #elif ENABLED(LCD_BED_LEVELING)
1906
-
1907
-    #if ENABLED(PROBE_MANUALLY)
1908
-      if (!g29_in_progress)
1909
-    #endif
1910
-        MENU_ITEM(submenu, MSG_BED_LEVELING, menu_bed_leveling);
1911
-
1912
-  #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)
1913
-
1914
-    #if DISABLED(PROBE_MANUALLY)
1915
-      MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29"));
1916
-    #endif
1917
-    if (leveling_is_valid()) {
1918
-      bool new_level_state = planner.leveling_active;
1919
-      MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling);
1920
-    }
1921
-    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1922
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height);
1923
-    #endif
1924
-
1925
-  #endif
1926
-
1927
-  #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING)
1928
-      MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners);
1929
-  #endif
1930
-
1931
-  //
1932
-  // Disable Steppers
1933
-  //
1934
-  MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
1935
-
1936
-  END_MENU();
1937
-}
1938
-
1939 1839
 #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)
1940 1840
 
1941 1841
   void _man_probe_pt(const float &rx, const float &ry) {
@@ -2035,383 +1935,6 @@ void menu_movement() {
2035 1935
 #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION
2036 1936
 
2037 1937
 /**
2038
- * Set a flag that lcd_update() should start a move
2039
- * to "current_position" after a short delay.
2040
- */
2041
-inline void manual_move_to_current(AxisEnum axis
2042
-  #if E_MANUAL > 1
2043
-    , const int8_t eindex=-1
2044
-  #endif
2045
-) {
2046
-  #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1
2047
-    #if E_MANUAL > 1
2048
-      if (axis == E_AXIS)
2049
-    #endif
2050
-        manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
2051
-  #endif
2052
-  manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
2053
-  manual_move_axis = (int8_t)axis;
2054
-}
2055
-
2056
-/**
2057
- *
2058
- * "Motion" > "Move Axis" submenu
2059
- *
2060
- */
2061
-
2062
-void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
2063
-  if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
2064
-  ENCODER_DIRECTION_NORMAL();
2065
-  if (encoderPosition && !processing_manual_move) {
2066
-
2067
-    // Start with no limits to movement
2068
-    float min = current_position[axis] - 1000,
2069
-          max = current_position[axis] + 1000;
2070
-
2071
-    // Limit to software endstops, if enabled
2072
-    #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)
2073
-      if (soft_endstops_enabled) switch (axis) {
2074
-        case X_AXIS:
2075
-          #if ENABLED(MIN_SOFTWARE_ENDSTOP_X)
2076
-            min = soft_endstop_min[X_AXIS];
2077
-          #endif
2078
-          #if ENABLED(MAX_SOFTWARE_ENDSTOP_X)
2079
-            max = soft_endstop_max[X_AXIS];
2080
-          #endif
2081
-          break;
2082
-        case Y_AXIS:
2083
-          #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y)
2084
-            min = soft_endstop_min[Y_AXIS];
2085
-          #endif
2086
-          #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y)
2087
-            max = soft_endstop_max[Y_AXIS];
2088
-          #endif
2089
-          break;
2090
-        case Z_AXIS:
2091
-          #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z)
2092
-            min = soft_endstop_min[Z_AXIS];
2093
-          #endif
2094
-          #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
2095
-            max = soft_endstop_max[Z_AXIS];
2096
-          #endif
2097
-        default: break;
2098
-      }
2099
-    #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
2100
-
2101
-    // Delta limits XY based on the current offset from center
2102
-    // This assumes the center is 0,0
2103
-    #if ENABLED(DELTA)
2104
-      if (axis != Z_AXIS) {
2105
-        max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis
2106
-        min = -max;
2107
-      }
2108
-    #endif
2109
-
2110
-    // Get the new position
2111
-    const float diff = float((int32_t)encoderPosition) * move_menu_scale;
2112
-    #if IS_KINEMATIC
2113
-      manual_move_offset += diff;
2114
-      if ((int32_t)encoderPosition < 0)
2115
-        NOLESS(manual_move_offset, min - current_position[axis]);
2116
-      else
2117
-        NOMORE(manual_move_offset, max - current_position[axis]);
2118
-    #else
2119
-      current_position[axis] += diff;
2120
-      if ((int32_t)encoderPosition < 0)
2121
-        NOLESS(current_position[axis], min);
2122
-      else
2123
-        NOMORE(current_position[axis], max);
2124
-    #endif
2125
-
2126
-    manual_move_to_current(axis);
2127
-    lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
2128
-  }
2129
-  encoderPosition = 0;
2130
-  if (lcdDrawUpdate) {
2131
-    const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis]
2132
-      #if IS_KINEMATIC
2133
-        + manual_move_offset
2134
-      #endif
2135
-    , axis);
2136
-    lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
2137
-  }
2138
-}
2139
-void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); }
2140
-void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); }
2141
-void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); }
2142
-void _lcd_move_e(
2143
-  #if E_MANUAL > 1
2144
-    const int8_t eindex=-1
2145
-  #endif
2146
-) {
2147
-  if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
2148
-  ENCODER_DIRECTION_NORMAL();
2149
-  if (encoderPosition) {
2150
-    if (!processing_manual_move) {
2151
-      const float diff = float((int32_t)encoderPosition) * move_menu_scale;
2152
-      #if IS_KINEMATIC
2153
-        manual_move_offset += diff;
2154
-      #else
2155
-        current_position[E_AXIS] += diff;
2156
-      #endif
2157
-      manual_move_to_current(E_AXIS
2158
-        #if E_MANUAL > 1
2159
-          , eindex
2160
-        #endif
2161
-      );
2162
-      lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
2163
-    }
2164
-    encoderPosition = 0;
2165
-  }
2166
-  if (lcdDrawUpdate) {
2167
-    PGM_P pos_label;
2168
-    #if E_MANUAL == 1
2169
-      pos_label = PSTR(MSG_MOVE_E);
2170
-    #else
2171
-      switch (eindex) {
2172
-        default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
2173
-        case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
2174
-        #if E_MANUAL > 2
2175
-          case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
2176
-          #if E_MANUAL > 3
2177
-            case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
2178
-            #if E_MANUAL > 4
2179
-              case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break;
2180
-              #if E_MANUAL > 5
2181
-                case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break;
2182
-              #endif // E_MANUAL > 5
2183
-            #endif // E_MANUAL > 4
2184
-          #endif // E_MANUAL > 3
2185
-        #endif // E_MANUAL > 2
2186
-      }
2187
-    #endif // E_MANUAL > 1
2188
-
2189
-    lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS]
2190
-      #if IS_KINEMATIC
2191
-        + manual_move_offset
2192
-      #endif
2193
-      #if ENABLED(MANUAL_E_MOVES_RELATIVE)
2194
-        - manual_move_e_origin
2195
-      #endif
2196
-    ));
2197
-  }
2198
-}
2199
-
2200
-void lcd_move_e() { _lcd_move_e(); }
2201
-#if E_MANUAL > 1
2202
-  void lcd_move_e0() { _lcd_move_e(0); }
2203
-  void lcd_move_e1() { _lcd_move_e(1); }
2204
-  #if E_MANUAL > 2
2205
-    void lcd_move_e2() { _lcd_move_e(2); }
2206
-    #if E_MANUAL > 3
2207
-      void lcd_move_e3() { _lcd_move_e(3); }
2208
-      #if E_MANUAL > 4
2209
-        void lcd_move_e4() { _lcd_move_e(4); }
2210
-        #if E_MANUAL > 5
2211
-          void lcd_move_e5() { _lcd_move_e(5); }
2212
-        #endif // E_MANUAL > 5
2213
-      #endif // E_MANUAL > 4
2214
-    #endif // E_MANUAL > 3
2215
-  #endif // E_MANUAL > 2
2216
-#endif // E_MANUAL > 1
2217
-
2218
-/**
2219
- *
2220
- * "Motion" > "Move Xmm" > "Move XYZ" submenu
2221
- *
2222
- */
2223
-
2224
-screenFunc_t _manual_move_func_ptr;
2225
-
2226
-void _goto_manual_move(const float scale) {
2227
-  defer_return_to_status = true;
2228
-  move_menu_scale = scale;
2229
-  lcd_goto_screen(_manual_move_func_ptr);
2230
-}
2231
-void menu_move_10mm() { _goto_manual_move(10); }
2232
-void menu_move_1mm()  { _goto_manual_move( 1); }
2233
-void menu_move_01mm() { _goto_manual_move( 0.1f); }
2234
-
2235
-void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) {
2236
-  _manual_move_func_ptr = func;
2237
-  START_MENU();
2238
-  if (LCD_HEIGHT >= 4) {
2239
-    switch (axis) {
2240
-      case X_AXIS:
2241
-        STATIC_ITEM(MSG_MOVE_X, true, true); break;
2242
-      case Y_AXIS:
2243
-        STATIC_ITEM(MSG_MOVE_Y, true, true); break;
2244
-      case Z_AXIS:
2245
-        STATIC_ITEM(MSG_MOVE_Z, true, true); break;
2246
-      default:
2247
-        #if ENABLED(MANUAL_E_MOVES_RELATIVE)
2248
-          manual_move_e_origin = current_position[E_AXIS];
2249
-        #endif
2250
-        STATIC_ITEM(MSG_MOVE_E, true, true);
2251
-        break;
2252
-    }
2253
-  }
2254
-  #if ENABLED(PREVENT_COLD_EXTRUSION)
2255
-    if (axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder))
2256
-      MENU_BACK(MSG_HOTEND_TOO_COLD);
2257
-    else
2258
-  #endif
2259
-  {
2260
-    MENU_BACK(MSG_MOVE_AXIS);
2261
-    MENU_ITEM(submenu, MSG_MOVE_10MM, menu_move_10mm);
2262
-    MENU_ITEM(submenu, MSG_MOVE_1MM, menu_move_1mm);
2263
-    MENU_ITEM(submenu, MSG_MOVE_01MM, menu_move_01mm);
2264
-  }
2265
-  END_MENU();
2266
-}
2267
-void lcd_move_get_x_amount()        { _menu_move_distance(X_AXIS, lcd_move_x); }
2268
-void lcd_move_get_y_amount()        { _menu_move_distance(Y_AXIS, lcd_move_y); }
2269
-void lcd_move_get_z_amount()        { _menu_move_distance(Z_AXIS, lcd_move_z); }
2270
-void lcd_move_get_e_amount()        { _menu_move_distance(E_AXIS, lcd_move_e, -1); }
2271
-#if E_MANUAL > 1
2272
-  void lcd_move_get_e0_amount()     { _menu_move_distance(E_AXIS, lcd_move_e0, 0); }
2273
-  void lcd_move_get_e1_amount()     { _menu_move_distance(E_AXIS, lcd_move_e1, 1); }
2274
-  #if E_MANUAL > 2
2275
-    void lcd_move_get_e2_amount()   { _menu_move_distance(E_AXIS, lcd_move_e2, 2); }
2276
-    #if E_MANUAL > 3
2277
-      void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); }
2278
-      #if E_MANUAL > 4
2279
-        void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); }
2280
-        #if E_MANUAL > 5
2281
-          void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); }
2282
-        #endif // E_MANUAL > 5
2283
-      #endif // E_MANUAL > 4
2284
-    #endif // E_MANUAL > 3
2285
-  #endif // E_MANUAL > 2
2286
-#endif // E_MANUAL > 1
2287
-
2288
-/**
2289
- *
2290
- * "Motion" > "Move Axis" submenu
2291
- *
2292
- */
2293
-
2294
-#if ENABLED(DELTA)
2295
-  void lcd_lower_z_to_clip_height() {
2296
-    line_to_z(delta_clip_start_height);
2297
-    lcd_synchronize();
2298
-  }
2299
-#endif
2300
-
2301
-void menu_move() {
2302
-  START_MENU();
2303
-  MENU_BACK(MSG_MOTION);
2304
-
2305
-  #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM)
2306
-    MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled);
2307
-  #endif
2308
-
2309
-  if (
2310
-    #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
2311
-      all_axes_homed()
2312
-    #else
2313
-      true
2314
-    #endif
2315
-  ) {
2316
-    if (
2317
-      #if ENABLED(DELTA)
2318
-        current_position[Z_AXIS] <= delta_clip_start_height
2319
-      #else
2320
-        true
2321
-      #endif
2322
-    ) {
2323
-      MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount);
2324
-      MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount);
2325
-    }
2326
-    #if ENABLED(DELTA)
2327
-      else
2328
-        MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height);
2329
-    #endif
2330
-
2331
-    MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount);
2332
-  }
2333
-  else
2334
-    MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
2335
-
2336
-  #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
2337
-
2338
-    #if EXTRUDERS == 6
2339
-      switch (active_extruder) {
2340
-        case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break;
2341
-        case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break;
2342
-        case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break;
2343
-        case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break;
2344
-        case 4: MENU_ITEM(gcode, MSG_SELECT " " MSG_E6, PSTR("T5")); break;
2345
-        case 5: MENU_ITEM(gcode, MSG_SELECT " " MSG_E5, PSTR("T4")); break;
2346
-      }
2347
-    #elif EXTRUDERS == 5 || EXTRUDERS == 4
2348
-      switch (active_extruder) {
2349
-        case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break;
2350
-        case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break;
2351
-        case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break;
2352
-        case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break;
2353
-      }
2354
-    #elif EXTRUDERS == 3
2355
-      if (active_extruder < 2) {
2356
-        if (active_extruder)
2357
-          MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
2358
-        else
2359
-          MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
2360
-      }
2361
-    #else
2362
-      if (active_extruder)
2363
-        MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
2364
-      else
2365
-        MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
2366
-    #endif
2367
-
2368
-  #elif ENABLED(DUAL_X_CARRIAGE)
2369
-
2370
-    if (active_extruder)
2371
-      MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
2372
-    else
2373
-      MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
2374
-
2375
-  #endif
2376
-
2377
-  #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
2378
-
2379
-    // Only the current...
2380
-    MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
2381
-    // ...and the non-switching
2382
-    #if E_MANUAL == 5
2383
-      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
2384
-    #elif E_MANUAL == 3
2385
-      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
2386
-    #endif
2387
-
2388
-  #else
2389
-
2390
-    // Independent extruders with one E-stepper per hotend
2391
-    MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
2392
-    #if E_MANUAL > 1
2393
-      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
2394
-      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
2395
-      #if E_MANUAL > 2
2396
-        MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
2397
-        #if E_MANUAL > 3
2398
-          MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
2399
-          #if E_MANUAL > 4
2400
-            MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
2401
-            #if E_MANUAL > 5
2402
-              MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount);
2403
-            #endif // E_MANUAL > 5
2404
-          #endif // E_MANUAL > 4
2405
-        #endif // E_MANUAL > 3
2406
-      #endif // E_MANUAL > 2
2407
-    #endif // E_MANUAL > 1
2408
-
2409
-  #endif
2410
-
2411
-  END_MENU();
2412
-}
2413
-
2414
-/**
2415 1938
  *
2416 1939
  * "Temperature" submenu
2417 1940
  *

+ 2
- 2
Marlin/src/lcd/menu/menu_main.cpp 查看文件

@@ -72,7 +72,7 @@
72 72
 #endif // SDSUPPORT
73 73
 
74 74
 void menu_tune();
75
-void menu_movement();
75
+void menu_motion();
76 76
 void menu_temperature();
77 77
 void menu_configuration();
78 78
 void _menu_user();
@@ -113,7 +113,7 @@ void menu_main() {
113 113
   if (busy)
114 114
     MENU_ITEM(submenu, MSG_TUNE, menu_tune);
115 115
   else {
116
-    MENU_ITEM(submenu, MSG_MOTION, menu_movement);
116
+    MENU_ITEM(submenu, MSG_MOTION, menu_motion);
117 117
     MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature);
118 118
   }
119 119
 

+ 499
- 0
Marlin/src/lcd/menu/menu_motion.cpp 查看文件

@@ -0,0 +1,499 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+//
24
+// Motion Menu
25
+//
26
+
27
+#include "../../inc/MarlinConfigPre.h"
28
+
29
+#if HAS_LCD_MENU
30
+
31
+#include "menu.h"
32
+#include "../../module/motion.h"
33
+
34
+#if ENABLED(DELTA)
35
+  #include "../../module/delta.h"
36
+#endif
37
+
38
+#if ENABLED(PREVENT_COLD_EXTRUSION)
39
+  #include "../../module/temperature.h"
40
+#endif
41
+
42
+#if HAS_LEVELING
43
+  #include "../../module/planner.h"
44
+  #include "../../feature/bedlevel/bedlevel.h"
45
+#endif
46
+
47
+extern millis_t manual_move_start_time;
48
+extern int8_t manual_move_axis;
49
+#if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1
50
+  extern int8_t manual_move_e_index;
51
+#endif
52
+#if ENABLED(MANUAL_E_MOVES_RELATIVE)
53
+  float manual_move_e_origin = 0;
54
+#endif
55
+#if IS_KINEMATIC
56
+  extern float manual_move_offset;
57
+#endif
58
+
59
+//
60
+// Tell lcd_update() to start a move to current_position" after a short delay.
61
+//
62
+inline void manual_move_to_current(AxisEnum axis
63
+  #if E_MANUAL > 1
64
+    , const int8_t eindex=-1
65
+  #endif
66
+) {
67
+  #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1
68
+    #if E_MANUAL > 1
69
+      if (axis == E_AXIS)
70
+    #endif
71
+        manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
72
+  #endif
73
+  manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
74
+  manual_move_axis = (int8_t)axis;
75
+}
76
+
77
+//
78
+// "Motion" > "Move Axis" submenu
79
+//
80
+
81
+static void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
82
+  if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
83
+  ENCODER_DIRECTION_NORMAL();
84
+  if (encoderPosition && !processing_manual_move) {
85
+
86
+    // Start with no limits to movement
87
+    float min = current_position[axis] - 1000,
88
+          max = current_position[axis] + 1000;
89
+
90
+    // Limit to software endstops, if enabled
91
+    #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)
92
+      if (soft_endstops_enabled) switch (axis) {
93
+        case X_AXIS:
94
+          #if ENABLED(MIN_SOFTWARE_ENDSTOP_X)
95
+            min = soft_endstop_min[X_AXIS];
96
+          #endif
97
+          #if ENABLED(MAX_SOFTWARE_ENDSTOP_X)
98
+            max = soft_endstop_max[X_AXIS];
99
+          #endif
100
+          break;
101
+        case Y_AXIS:
102
+          #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y)
103
+            min = soft_endstop_min[Y_AXIS];
104
+          #endif
105
+          #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y)
106
+            max = soft_endstop_max[Y_AXIS];
107
+          #endif
108
+          break;
109
+        case Z_AXIS:
110
+          #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z)
111
+            min = soft_endstop_min[Z_AXIS];
112
+          #endif
113
+          #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
114
+            max = soft_endstop_max[Z_AXIS];
115
+          #endif
116
+        default: break;
117
+      }
118
+    #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
119
+
120
+    // Delta limits XY based on the current offset from center
121
+    // This assumes the center is 0,0
122
+    #if ENABLED(DELTA)
123
+      if (axis != Z_AXIS) {
124
+        max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis
125
+        min = -max;
126
+      }
127
+    #endif
128
+
129
+    // Get the new position
130
+    const float diff = float((int32_t)encoderPosition) * move_menu_scale;
131
+    #if IS_KINEMATIC
132
+      manual_move_offset += diff;
133
+      if ((int32_t)encoderPosition < 0)
134
+        NOLESS(manual_move_offset, min - current_position[axis]);
135
+      else
136
+        NOMORE(manual_move_offset, max - current_position[axis]);
137
+    #else
138
+      current_position[axis] += diff;
139
+      if ((int32_t)encoderPosition < 0)
140
+        NOLESS(current_position[axis], min);
141
+      else
142
+        NOMORE(current_position[axis], max);
143
+    #endif
144
+
145
+    manual_move_to_current(axis);
146
+    lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
147
+  }
148
+  encoderPosition = 0;
149
+  if (lcdDrawUpdate) {
150
+    const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis]
151
+      #if IS_KINEMATIC
152
+        + manual_move_offset
153
+      #endif
154
+    , axis);
155
+    lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos));
156
+  }
157
+}
158
+inline void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); }
159
+inline void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); }
160
+inline void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); }
161
+static void _lcd_move_e(
162
+  #if E_MANUAL > 1
163
+    const int8_t eindex=-1
164
+  #endif
165
+) {
166
+  if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
167
+  ENCODER_DIRECTION_NORMAL();
168
+  if (encoderPosition) {
169
+    if (!processing_manual_move) {
170
+      const float diff = float((int32_t)encoderPosition) * move_menu_scale;
171
+      #if IS_KINEMATIC
172
+        manual_move_offset += diff;
173
+      #else
174
+        current_position[E_AXIS] += diff;
175
+      #endif
176
+      manual_move_to_current(E_AXIS
177
+        #if E_MANUAL > 1
178
+          , eindex
179
+        #endif
180
+      );
181
+      lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
182
+    }
183
+    encoderPosition = 0;
184
+  }
185
+  if (lcdDrawUpdate) {
186
+    PGM_P pos_label;
187
+    #if E_MANUAL == 1
188
+      pos_label = PSTR(MSG_MOVE_E);
189
+    #else
190
+      switch (eindex) {
191
+        default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
192
+        case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
193
+        #if E_MANUAL > 2
194
+          case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
195
+          #if E_MANUAL > 3
196
+            case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
197
+            #if E_MANUAL > 4
198
+              case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break;
199
+              #if E_MANUAL > 5
200
+                case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break;
201
+              #endif // E_MANUAL > 5
202
+            #endif // E_MANUAL > 4
203
+          #endif // E_MANUAL > 3
204
+        #endif // E_MANUAL > 2
205
+      }
206
+    #endif // E_MANUAL > 1
207
+
208
+    lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS]
209
+      #if IS_KINEMATIC
210
+        + manual_move_offset
211
+      #endif
212
+      #if ENABLED(MANUAL_E_MOVES_RELATIVE)
213
+        - manual_move_e_origin
214
+      #endif
215
+    ));
216
+  }
217
+}
218
+
219
+inline void lcd_move_e() { _lcd_move_e(); }
220
+#if E_MANUAL > 1
221
+  inline void lcd_move_e0() { _lcd_move_e(0); }
222
+  inline void lcd_move_e1() { _lcd_move_e(1); }
223
+  #if E_MANUAL > 2
224
+    inline void lcd_move_e2() { _lcd_move_e(2); }
225
+    #if E_MANUAL > 3
226
+      inline void lcd_move_e3() { _lcd_move_e(3); }
227
+      #if E_MANUAL > 4
228
+        inline void lcd_move_e4() { _lcd_move_e(4); }
229
+        #if E_MANUAL > 5
230
+          inline void lcd_move_e5() { _lcd_move_e(5); }
231
+        #endif // E_MANUAL > 5
232
+      #endif // E_MANUAL > 4
233
+    #endif // E_MANUAL > 3
234
+  #endif // E_MANUAL > 2
235
+#endif // E_MANUAL > 1
236
+
237
+//
238
+// "Motion" > "Move Xmm" > "Move XYZ" submenu
239
+//
240
+
241
+screenFunc_t _manual_move_func_ptr;
242
+
243
+void _goto_manual_move(const float scale) {
244
+  defer_return_to_status = true;
245
+  move_menu_scale = scale;
246
+  lcd_goto_screen(_manual_move_func_ptr);
247
+}
248
+void menu_move_10mm() { _goto_manual_move(10); }
249
+void menu_move_1mm()  { _goto_manual_move( 1); }
250
+void menu_move_01mm() { _goto_manual_move( 0.1f); }
251
+
252
+void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) {
253
+  _manual_move_func_ptr = func;
254
+  START_MENU();
255
+  if (LCD_HEIGHT >= 4) {
256
+    switch (axis) {
257
+      case X_AXIS:
258
+        STATIC_ITEM(MSG_MOVE_X, true, true); break;
259
+      case Y_AXIS:
260
+        STATIC_ITEM(MSG_MOVE_Y, true, true); break;
261
+      case Z_AXIS:
262
+        STATIC_ITEM(MSG_MOVE_Z, true, true); break;
263
+      default:
264
+        #if ENABLED(MANUAL_E_MOVES_RELATIVE)
265
+          manual_move_e_origin = current_position[E_AXIS];
266
+        #endif
267
+        STATIC_ITEM(MSG_MOVE_E, true, true);
268
+        break;
269
+    }
270
+  }
271
+  #if ENABLED(PREVENT_COLD_EXTRUSION)
272
+    if (axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder))
273
+      MENU_BACK(MSG_HOTEND_TOO_COLD);
274
+    else
275
+  #endif
276
+  {
277
+    MENU_BACK(MSG_MOVE_AXIS);
278
+    MENU_ITEM(submenu, MSG_MOVE_10MM, menu_move_10mm);
279
+    MENU_ITEM(submenu, MSG_MOVE_1MM, menu_move_1mm);
280
+    MENU_ITEM(submenu, MSG_MOVE_01MM, menu_move_01mm);
281
+  }
282
+  END_MENU();
283
+}
284
+void lcd_move_get_x_amount() { _menu_move_distance(X_AXIS, lcd_move_x); }
285
+void lcd_move_get_y_amount() { _menu_move_distance(Y_AXIS, lcd_move_y); }
286
+void lcd_move_get_z_amount() { _menu_move_distance(Z_AXIS, lcd_move_z); }
287
+void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); }
288
+#if E_MANUAL > 1
289
+  void lcd_move_get_e0_amount()     { _menu_move_distance(E_AXIS, lcd_move_e0, 0); }
290
+  void lcd_move_get_e1_amount()     { _menu_move_distance(E_AXIS, lcd_move_e1, 1); }
291
+  #if E_MANUAL > 2
292
+    void lcd_move_get_e2_amount()   { _menu_move_distance(E_AXIS, lcd_move_e2, 2); }
293
+    #if E_MANUAL > 3
294
+      void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); }
295
+      #if E_MANUAL > 4
296
+        void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); }
297
+        #if E_MANUAL > 5
298
+          void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); }
299
+        #endif // E_MANUAL > 5
300
+      #endif // E_MANUAL > 4
301
+    #endif // E_MANUAL > 3
302
+  #endif // E_MANUAL > 2
303
+#endif // E_MANUAL > 1
304
+
305
+#if ENABLED(DELTA)
306
+  void lcd_lower_z_to_clip_height() {
307
+    line_to_z(delta_clip_start_height);
308
+    lcd_synchronize();
309
+  }
310
+#endif
311
+
312
+void menu_move() {
313
+  START_MENU();
314
+  MENU_BACK(MSG_MOTION);
315
+
316
+  #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM)
317
+    MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled);
318
+  #endif
319
+
320
+  if (
321
+    #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
322
+      all_axes_homed()
323
+    #else
324
+      true
325
+    #endif
326
+  ) {
327
+    if (
328
+      #if ENABLED(DELTA)
329
+        current_position[Z_AXIS] <= delta_clip_start_height
330
+      #else
331
+        true
332
+      #endif
333
+    ) {
334
+      MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount);
335
+      MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount);
336
+    }
337
+    #if ENABLED(DELTA)
338
+      else
339
+        MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height);
340
+    #endif
341
+
342
+    MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount);
343
+  }
344
+  else
345
+    MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
346
+
347
+  #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
348
+
349
+    #if EXTRUDERS == 6
350
+      switch (active_extruder) {
351
+        case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break;
352
+        case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break;
353
+        case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break;
354
+        case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break;
355
+        case 4: MENU_ITEM(gcode, MSG_SELECT " " MSG_E6, PSTR("T5")); break;
356
+        case 5: MENU_ITEM(gcode, MSG_SELECT " " MSG_E5, PSTR("T4")); break;
357
+      }
358
+    #elif EXTRUDERS == 5 || EXTRUDERS == 4
359
+      switch (active_extruder) {
360
+        case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break;
361
+        case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break;
362
+        case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break;
363
+        case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break;
364
+      }
365
+    #elif EXTRUDERS == 3
366
+      if (active_extruder < 2) {
367
+        if (active_extruder)
368
+          MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
369
+        else
370
+          MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
371
+      }
372
+    #else
373
+      if (active_extruder)
374
+        MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
375
+      else
376
+        MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
377
+    #endif
378
+
379
+  #elif ENABLED(DUAL_X_CARRIAGE)
380
+
381
+    if (active_extruder)
382
+      MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
383
+    else
384
+      MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
385
+
386
+  #endif
387
+
388
+  #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
389
+
390
+    // Only the current...
391
+    MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
392
+    // ...and the non-switching
393
+    #if E_MANUAL == 5
394
+      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
395
+    #elif E_MANUAL == 3
396
+      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
397
+    #endif
398
+
399
+  #else
400
+
401
+    // Independent extruders with one E-stepper per hotend
402
+    MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
403
+    #if E_MANUAL > 1
404
+      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
405
+      MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
406
+      #if E_MANUAL > 2
407
+        MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
408
+        #if E_MANUAL > 3
409
+          MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
410
+          #if E_MANUAL > 4
411
+            MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount);
412
+            #if E_MANUAL > 5
413
+              MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount);
414
+            #endif // E_MANUAL > 5
415
+          #endif // E_MANUAL > 4
416
+        #endif // E_MANUAL > 3
417
+      #endif // E_MANUAL > 2
418
+    #endif // E_MANUAL > 1
419
+
420
+  #endif
421
+
422
+  END_MENU();
423
+}
424
+
425
+void _lcd_ubl_level_bed();
426
+void menu_bed_leveling();
427
+
428
+void menu_motion() {
429
+  START_MENU();
430
+
431
+  //
432
+  // ^ Main
433
+  //
434
+  MENU_BACK(MSG_MAIN);
435
+
436
+  //
437
+  // Move Axis
438
+  //
439
+  #if ENABLED(DELTA)
440
+    if (all_axes_homed())
441
+  #endif
442
+      MENU_ITEM(submenu, MSG_MOVE_AXIS, menu_move);
443
+
444
+  //
445
+  // Auto Home
446
+  //
447
+  MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
448
+  #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
449
+    MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X"));
450
+    MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y"));
451
+    MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z"));
452
+  #endif
453
+
454
+  //
455
+  // TMC Z Calibration
456
+  //
457
+  #if ENABLED(TMC_Z_CALIBRATION)
458
+    MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915"));
459
+  #endif
460
+
461
+  //
462
+  // Level Bed
463
+  //
464
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
465
+
466
+    MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed);
467
+
468
+  #elif ENABLED(LCD_BED_LEVELING)
469
+
470
+    if (!g29_in_progress) MENU_ITEM(submenu, MSG_BED_LEVELING, menu_bed_leveling);
471
+
472
+  #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)
473
+
474
+    #if DISABLED(PROBE_MANUALLY)
475
+      MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29"));
476
+    #endif
477
+    if (leveling_is_valid()) {
478
+      bool new_level_state = planner.leveling_active;
479
+      MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling);
480
+    }
481
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
482
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height);
483
+    #endif
484
+
485
+  #endif
486
+
487
+  #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING)
488
+    MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners);
489
+  #endif
490
+
491
+  //
492
+  // Disable Steppers
493
+  //
494
+  MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
495
+
496
+  END_MENU();
497
+}
498
+
499
+#endif // HAS_LCD_MENU

+ 1
- 0
Marlin/src/lcd/ultralcd.cpp 查看文件

@@ -131,6 +131,7 @@ void lcd_status_screen();
131 131
   uint32_t encoderPosition;
132 132
   millis_t lastEncoderMovementMillis = 0;
133 133
   bool lcd_clicked, wait_for_unclick;
134
+  float move_menu_scale;
134 135
 
135 136
   bool use_click() {
136 137
     const bool click = lcd_clicked;

+ 1
- 0
Marlin/src/lcd/ultralcd.h 查看文件

@@ -288,6 +288,7 @@
288 288
 
289 289
     // Manual Movement
290 290
     constexpr float manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE;
291
+    extern float move_menu_scale;
291 292
     #if IS_KINEMATIC
292 293
       extern bool processing_manual_move;
293 294
     #else

正在加载...
取消
保存