Browse Source

Menu edit accel in increments of 25 (#13850)

Tanguy Pruvot 5 years ago
parent
commit
e7b3720b81

+ 2
- 0
Marlin/src/lcd/menu/menu.cpp View File

@@ -167,10 +167,12 @@ DEFINE_MENU_EDIT_ITEM(float3);      // 123        right-justified
167 167
 DEFINE_MENU_EDIT_ITEM(float52);     // 123.45
168 168
 DEFINE_MENU_EDIT_ITEM(float43);     // 1.234
169 169
 DEFINE_MENU_EDIT_ITEM(float5);      // 12345      right-justified
170
+DEFINE_MENU_EDIT_ITEM(float5_25);   // 12345      right-justified (25 increment)
170 171
 DEFINE_MENU_EDIT_ITEM(float51);     // 1234.5     right-justified
171 172
 DEFINE_MENU_EDIT_ITEM(float51sign); // +1234.5
172 173
 DEFINE_MENU_EDIT_ITEM(float52sign); // +123.45
173 174
 DEFINE_MENU_EDIT_ITEM(long5);       // 12345      right-justified
175
+DEFINE_MENU_EDIT_ITEM(long5_25);    // 12345      right-justified (25 increment)
174 176
 
175 177
 void MenuItem_bool::action_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) {
176 178
   UNUSED(pstr); *ptr ^= true; ui.refresh();

+ 6
- 0
Marlin/src/lcd/menu/menu.h View File

@@ -56,10 +56,12 @@ DECLARE_MENU_EDIT_TYPE(float,    float3,      ftostr3,         1     );   // 123
56 56
 DECLARE_MENU_EDIT_TYPE(float,    float52,     ftostr52,      100     );   // 123.45
57 57
 DECLARE_MENU_EDIT_TYPE(float,    float43,     ftostr43sign, 1000     );   // 1.234
58 58
 DECLARE_MENU_EDIT_TYPE(float,    float5,      ftostr5rj,       0.01f );   // 12345      right-justified
59
+DECLARE_MENU_EDIT_TYPE(float,    float5_25,   ftostr5rj,       0.04f );   // 12345      right-justified (25 increment)
59 60
 DECLARE_MENU_EDIT_TYPE(float,    float51,     ftostr51rj,     10     );   // 1234.5     right-justified
60 61
 DECLARE_MENU_EDIT_TYPE(float,    float51sign, ftostr51sign,   10     );   // +1234.5
61 62
 DECLARE_MENU_EDIT_TYPE(float,    float52sign, ftostr52sign,  100     );   // +123.45
62 63
 DECLARE_MENU_EDIT_TYPE(uint32_t, long5,       ftostr5rj,       0.01f );   // 12345      right-justified
64
+DECLARE_MENU_EDIT_TYPE(uint32_t, long5_25,    ftostr5rj,       0.04f );   // 12345      right-justified (25 increment)
63 65
 
64 66
 ////////////////////////////////////////////
65 67
 ///////// Menu Item Draw Functions /////////
@@ -124,10 +126,12 @@ DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3);           // 123        right-justif
124 126
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52);          // 123.45
125 127
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43);          // 1.234
126 128
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float5);           // 12345      right-justified
129
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float5_25);        // 12345      right-justified (25 increment)
127 130
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float51);          // 1234.5     right-justified
128 131
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float51sign);      // +1234.5
129 132
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52sign);      // +123.45
130 133
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5);            // 12345      right-justified
134
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5_25);         // 12345      right-justified (25 increment)
131 135
 
132 136
 #define draw_menu_item_edit_bool(sel, row, pstr, pstr2, data, ...)           DRAW_BOOL_SETTING(sel, row, pstr, data)
133 137
 #define draw_menu_item_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data)
@@ -205,10 +209,12 @@ DECLARE_MENU_EDIT_ITEM(float3);
205 209
 DECLARE_MENU_EDIT_ITEM(float52);
206 210
 DECLARE_MENU_EDIT_ITEM(float43);
207 211
 DECLARE_MENU_EDIT_ITEM(float5);
212
+DECLARE_MENU_EDIT_ITEM(float5_25);
208 213
 DECLARE_MENU_EDIT_ITEM(float51);
209 214
 DECLARE_MENU_EDIT_ITEM(float51sign);
210 215
 DECLARE_MENU_EDIT_ITEM(float52sign);
211 216
 DECLARE_MENU_EDIT_ITEM(long5);
217
+DECLARE_MENU_EDIT_ITEM(long5_25);
212 218
 
213 219
 class MenuItem_bool {
214 220
   public:

+ 4
- 3
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -499,16 +499,17 @@ void menu_backlash();
499 499
     MENU_BACK(MSG_ADVANCED_SETTINGS);
500 500
 
501 501
     // M204 P Acceleration
502
-    MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.settings.acceleration, 10, 99000);
502
+    MENU_MULTIPLIER_ITEM_EDIT(float5_25, MSG_ACC, &planner.settings.acceleration, 25, 99000);
503 503
 
504 504
     // M204 R Retract Acceleration
505 505
     MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, 99000);
506 506
 
507 507
     // M204 T Travel Acceleration
508
-    MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 100, 99000);
508
+    MENU_MULTIPLIER_ITEM_EDIT(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, 99000);
509 509
 
510 510
     // M201 settings
511
-    #define EDIT_AMAX(Q,L) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, 99000, _reset_acceleration_rates)
511
+    #define EDIT_AMAX(Q,L) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5_25, MSG_AMAX MSG_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, 99000, _reset_acceleration_rates)
512
+
512 513
     EDIT_AMAX(A,100);
513 514
     EDIT_AMAX(B,100);
514 515
     EDIT_AMAX(C, 10);

Loading…
Cancel
Save