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

Rename float32 => float52, etc.

Scott Lahteine 7 лет назад
Родитель
Сommit
a90d99c27c

+ 1
- 1
Marlin/src/core/utility.cpp Просмотреть файл

@@ -125,7 +125,7 @@ void safe_delay(millis_t ms) {
125 125
   }
126 126
 
127 127
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
128
-  char* ftostr32(const float &f) {
128
+  char* ftostr52(const float &f) {
129 129
     long i = (f * 1000 + (f < 0 ? -5: 5)) / 10;
130 130
     conv[1] = MINUSOR(i, DIGIMOD(i, 10000));
131 131
     conv[2] = DIGIMOD(i, 1000);

+ 1
- 1
Marlin/src/core/utility.h Просмотреть файл

@@ -63,7 +63,7 @@ void safe_delay(millis_t ms);
63 63
   char* ftostr12ns(const float &x);
64 64
 
65 65
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
66
-  char* ftostr32(const float &x);
66
+  char* ftostr52(const float &x);
67 67
 
68 68
   // Convert float to fixed-length string with +123.4 / -123.4 format
69 69
   char* ftostr41sign(const float &x);

+ 23
- 23
Marlin/src/lcd/ultralcd.cpp Просмотреть файл

@@ -136,11 +136,11 @@ uint16_t max_display_update_time = 0;
136 136
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3);
137 137
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3);
138 138
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3);
139
-  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float32, ftostr32);
139
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52);
140 140
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign);
141 141
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj);
142 142
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign);
143
-  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52sign);
143
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign);
144 144
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj);
145 145
   DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj);
146 146
   #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data)                    DRAW_BOOL_SETTING(sel, row, pstr, data)
@@ -264,11 +264,11 @@ uint16_t max_display_update_time = 0;
264 264
   DECLARE_MENU_EDIT_TYPE(int16_t, int3);
265 265
   DECLARE_MENU_EDIT_TYPE(uint8_t, int8);
266 266
   DECLARE_MENU_EDIT_TYPE(float, float3);
267
-  DECLARE_MENU_EDIT_TYPE(float, float32);
267
+  DECLARE_MENU_EDIT_TYPE(float, float52);
268 268
   DECLARE_MENU_EDIT_TYPE(float, float43);
269 269
   DECLARE_MENU_EDIT_TYPE(float, float5);
270 270
   DECLARE_MENU_EDIT_TYPE(float, float51);
271
-  DECLARE_MENU_EDIT_TYPE(float, float52);
271
+  DECLARE_MENU_EDIT_TYPE(float, float52sign);
272 272
   DECLARE_MENU_EDIT_TYPE(float, float62);
273 273
   DECLARE_MENU_EDIT_TYPE(uint32_t, long5);
274 274
 
@@ -2090,7 +2090,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
2090 2090
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
2091 2091
         MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
2092 2092
       #elif HAS_BED_PROBE
2093
-        MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
2093
+        MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
2094 2094
       #endif
2095 2095
 
2096 2096
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
@@ -2864,15 +2864,15 @@ void lcd_quick_feedback(const bool clear_buttons) {
2864 2864
     void lcd_delta_settings() {
2865 2865
       START_MENU();
2866 2866
       MENU_BACK(MSG_DELTA_CALIBRATE);
2867
-      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, _recalc_delta_settings);
2867
+      MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, _recalc_delta_settings);
2868 2868
       MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0, _recalc_delta_settings);
2869 2869
       MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0, _recalc_delta_settings);
2870 2870
       MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0, _recalc_delta_settings);
2871
-      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5.0, delta_radius + 5.0, _recalc_delta_settings);
2871
+      MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5.0, delta_radius + 5.0, _recalc_delta_settings);
2872 2872
       MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0, _recalc_delta_settings);
2873 2873
       MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0, _recalc_delta_settings);
2874 2874
       MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5.0, 5.0, _recalc_delta_settings);
2875
-      MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, _recalc_delta_settings);
2875
+      MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, _recalc_delta_settings);
2876 2876
       END_MENU();
2877 2877
     }
2878 2878
 
@@ -3315,7 +3315,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3315 3315
     #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
3316 3316
       MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
3317 3317
     #elif ENABLED(LIN_ADVANCE)
3318
-      MENU_ITEM_EDIT(float32, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3318
+      MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3319 3319
     #endif
3320 3320
 
3321 3321
     #if HAS_LCD_CONTRAST
@@ -3500,7 +3500,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3500 3500
       MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled);
3501 3501
       MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15);
3502 3502
       MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15);
3503
-      MENU_ITEM_EDIT(float32, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0);
3503
+      MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0);
3504 3504
     #endif
3505 3505
 
3506 3506
     //
@@ -3516,9 +3516,9 @@ void lcd_quick_feedback(const bool clear_buttons) {
3516 3516
       #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \
3517 3517
         raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \
3518 3518
         raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \
3519
-        MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \
3520
-        MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
3521
-        MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
3519
+        MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \
3520
+        MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
3521
+        MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
3522 3522
 
3523 3523
       #if ENABLED(PID_EXTRUSION_SCALING)
3524 3524
         #define _PID_MENU_ITEMS(ELABEL, eindex) \
@@ -3739,7 +3739,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3739 3739
       #if ENABLED(DELTA)
3740 3740
         MENU_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990);
3741 3741
       #else
3742
-        MENU_ITEM_EDIT(float52, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1, 990);
3742
+        MENU_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1, 990);
3743 3743
       #endif
3744 3744
       MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990);
3745 3745
 
@@ -3790,7 +3790,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3790 3790
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
3791 3791
       MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
3792 3792
     #elif HAS_BED_PROBE
3793
-      MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
3793
+      MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
3794 3794
     #endif
3795 3795
 
3796 3796
     #if DISABLED(SLIM_LCD_MENUS)
@@ -3828,7 +3828,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3828 3828
       MENU_BACK(MSG_CONTROL);
3829 3829
 
3830 3830
       #if ENABLED(LIN_ADVANCE)
3831
-        MENU_ITEM_EDIT(float32, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3831
+        MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999);
3832 3832
       #endif
3833 3833
 
3834 3834
       #if DISABLED(NO_VOLUMETRICS)
@@ -3913,15 +3913,15 @@ void lcd_quick_feedback(const bool clear_buttons) {
3913 3913
       START_MENU();
3914 3914
       MENU_BACK(MSG_CONTROL);
3915 3915
       MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract);
3916
-      MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &fwretract.retract_length, 0, 100);
3916
+      MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.retract_length, 0, 100);
3917 3917
       #if EXTRUDERS > 1
3918
-        MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &fwretract.swap_retract_length, 0, 100);
3918
+        MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.swap_retract_length, 0, 100);
3919 3919
       #endif
3920 3920
       MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.retract_feedrate_mm_s, 1, 999);
3921
-      MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.retract_zlift, 0, 999);
3922
-      MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &fwretract.retract_recover_length, -100, 100);
3921
+      MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.retract_zlift, 0, 999);
3922
+      MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.retract_recover_length, -100, 100);
3923 3923
       #if EXTRUDERS > 1
3924
-        MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.swap_retract_recover_length, -100, 100);
3924
+        MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.swap_retract_recover_length, -100, 100);
3925 3925
       #endif
3926 3926
       MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.retract_recover_feedrate_mm_s, 1, 999);
3927 3927
       #if EXTRUDERS > 1
@@ -4829,11 +4829,11 @@ void lcd_quick_feedback(const bool clear_buttons) {
4829 4829
   DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1);
4830 4830
   DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1);
4831 4831
   DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1.0);
4832
-  DEFINE_MENU_EDIT_TYPE(float, float32, ftostr32, 100.0);
4832
+  DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100.0);
4833 4833
   DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000.0);
4834 4834
   DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01);
4835 4835
   DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10.0);
4836
-  DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52sign, 100.0);
4836
+  DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100.0);
4837 4837
   DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100.0);
4838 4838
   DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01);
4839 4839
 

+ 2
- 2
Marlin/src/lcd/ultralcd_impl_DOGM.h Просмотреть файл

@@ -619,10 +619,10 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
619 619
       if (PAGE_UNDER(7)) {
620 620
         lcd_moveto(5, 7);
621 621
         lcd_put_u8str("X:");
622
-        lcd_put_u8str(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
622
+        lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
623 623
         lcd_moveto(74, 7);
624 624
         lcd_put_u8str("Y:");
625
-        lcd_put_u8str(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
625
+        lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
626 626
       }
627 627
 
628 628
       // Print plot position

+ 4
- 4
Marlin/src/lcd/ultralcd_impl_HD44780.h Просмотреть файл

@@ -1065,10 +1065,10 @@ static void lcd_implementation_status_screen() {
1065 1065
          * Show X and Y positions
1066 1066
          */
1067 1067
         _XLABEL(_PLOT_X, 0);
1068
-        lcd_put_u8str(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x]))));
1068
+        lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x]))));
1069 1069
 
1070 1070
         _YLABEL(_LCD_W_POS, 0);
1071
-        lcd_put_u8str(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y]))));
1071
+        lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y]))));
1072 1072
 
1073 1073
         lcd_moveto(_PLOT_X, 0);
1074 1074
 
@@ -1301,9 +1301,9 @@ static void lcd_implementation_status_screen() {
1301 1301
          * Show all values at right of screen
1302 1302
          */
1303 1303
         _XLABEL(_LCD_W_POS, 1);
1304
-        lcd_put_u8str(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x]))));
1304
+        lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x]))));
1305 1305
         _YLABEL(_LCD_W_POS, 2);
1306
-        lcd_put_u8str(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y]))));
1306
+        lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y]))));
1307 1307
 
1308 1308
         /**
1309 1309
          * Show the location value

Загрузка…
Отмена
Сохранить