Scott Lahteine преди 7 години
родител
ревизия
062131554f
променени са 4 файла, в които са добавени 25 реда и са изтрити 25 реда
  1. 3
    3
      Marlin/language_en.h
  2. 13
    12
      Marlin/ubl.cpp
  3. 1
    1
      Marlin/ubl_G29.cpp
  4. 8
    9
      Marlin/ultralcd.cpp

+ 3
- 3
Marlin/language_en.h Целия файл

@@ -280,9 +280,9 @@
280 280
 #ifndef MSG_UBL_OUTPUT_MAP_CSV
281 281
   #define MSG_UBL_OUTPUT_MAP_CSV              _UxGT("Output for CSV")
282 282
 #endif
283
-  #ifndef MSG_UBL_OUTPUT_MAP_BACKUP
284
-    #define MSG_UBL_OUTPUT_MAP_BACKUP         _UxGT("Off Printer Backup")
285
-  #endif
283
+#ifndef MSG_UBL_OUTPUT_MAP_BACKUP
284
+  #define MSG_UBL_OUTPUT_MAP_BACKUP           _UxGT("Off Printer Backup")
285
+#endif
286 286
 #ifndef MSG_UBL_INFO_UBL
287 287
   #define MSG_UBL_INFO_UBL                    _UxGT("Output UBL Info")
288 288
 #endif

+ 13
- 12
Marlin/ubl.cpp Целия файл

@@ -115,8 +115,9 @@
115 115
   void unified_bed_leveling::display_map(const int map_type) {
116 116
     constexpr uint8_t spaces = 8 * (GRID_MAX_POINTS_X - 2);
117 117
 
118
+    SERIAL_PROTOCOLPGM("\nBed Topography Report");
118 119
     if (map_type == 0) {
119
-      SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n");
120
+      SERIAL_PROTOCOLPGM(":\n\n");
120 121
       serial_echo_xy(0, GRID_MAX_POINTS_Y - 1);
121 122
       SERIAL_ECHO_SP(spaces + 3);
122 123
       serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1);
@@ -126,9 +127,10 @@
126 127
       serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MAX_Y);
127 128
       SERIAL_EOL();
128 129
     }
129
-
130
-    if (map_type == 1) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report for CSV:"); SERIAL_EOL(); }
131
-    if (map_type == 2) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report for LCD:"); SERIAL_EOL(); }
130
+    else {
131
+      SERIAL_PROTOCOLPGM(" for ");
132
+      serialprintPGM(map_type == 1 ? PSTR("CSV:\n\n") : PSTR("LCD:\n\n"));
133
+    }
132 134
 
133 135
     const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
134 136
                 current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
@@ -142,14 +144,14 @@
142 144
 
143 145
         const float f = z_values[i][j];
144 146
         if (isnan(f)) {
145
-          serialprintPGM((map_type == 0) ? PSTR("    .   ") : PSTR("NAN"));
147
+          serialprintPGM(map_type == 0 ? PSTR("    .   ") : PSTR("NAN"));
146 148
         }
147
-        else {
149
+        else if (map_type <= 1) {
148 150
           // if we don't do this, the columns won't line up nicely
149
-          if ((map_type == 0) && f >= 0.0) SERIAL_CHAR(' ');
150
-          if (map_type <= 1) SERIAL_PROTOCOL_F(f, 3);
151
-          idle();
151
+          if (map_type == 0 && f >= 0.0) SERIAL_CHAR(' ');
152
+          SERIAL_PROTOCOL_F(f, 3);
152 153
         }
154
+        idle();
153 155
         if (map_type == 1 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');
154 156
 
155 157
         #if TX_BUFFER_SIZE > 0
@@ -162,7 +164,7 @@
162 164
         }
163 165
       }
164 166
       SERIAL_EOL();
165
-      if (j && (map_type == 0)) { // we want the (0,0) up tight against the block of numbers
167
+      if (j && map_type == 0) { // we want the (0,0) up tight against the block of numbers
166 168
         SERIAL_CHAR(' ');
167 169
         SERIAL_EOL();
168 170
       }
@@ -183,8 +185,7 @@
183 185
   bool unified_bed_leveling::sanity_check() {
184 186
     uint8_t error_flag = 0;
185 187
 
186
-    const int a = settings.calc_num_meshes();
187
-    if (a < 1) {
188
+    if (settings.calc_num_meshes() < 1) {
188 189
       SERIAL_PROTOCOLLNPGM("?Insufficient EEPROM storage for a mesh of this size.");
189 190
       error_flag++;
190 191
     }

+ 1
- 1
Marlin/ubl_G29.cpp Целия файл

@@ -1576,7 +1576,7 @@
1576 1576
 
1577 1577
       if (ubl_lcd_map_control) {
1578 1578
         #if ENABLED(DOGLCD)
1579
-        lcd_goto_screen(_lcd_ubl_output_map_lcd);
1579
+          lcd_goto_screen(_lcd_ubl_output_map_lcd);
1580 1580
         #endif
1581 1581
       }
1582 1582
       else lcd_return_to_status();

+ 8
- 9
Marlin/ultralcd.cpp Целия файл

@@ -2094,11 +2094,11 @@ void kill_screen(const char* lcd_msg) {
2094 2094
       /*********************************************************/
2095 2095
       /************ Scale the box pixels appropriately *********/
2096 2096
       /*********************************************************/
2097
-      x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / GRID_MAX_POINTS_X) * GRID_MAX_POINTS_X;
2098
-      y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / GRID_MAX_POINTS_Y) * GRID_MAX_POINTS_Y;
2097
+      x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X);
2098
+      y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y);
2099 2099
 
2100
-      pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
2101
-      pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
2100
+      pixels_per_X_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X);
2101
+      pixels_per_Y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y);
2102 2102
 
2103 2103
       x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
2104 2104
       y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
@@ -2184,7 +2184,7 @@ void kill_screen(const char* lcd_msg) {
2184 2184
     void sync_plan_position();
2185 2185
 
2186 2186
     void _lcd_ubl_output_map_lcd() {
2187
-      static int step_scaler=0;
2187
+      static int16_t step_scaler = 0;
2188 2188
       int32_t signed_enc_pos;
2189 2189
 
2190 2190
       defer_return_to_status = true;
@@ -2194,11 +2194,10 @@ void kill_screen(const char* lcd_msg) {
2194 2194
         if (lcd_clicked) { return _lcd_ubl_map_lcd_edit_cmd(); }
2195 2195
         ENCODER_DIRECTION_NORMAL();
2196 2196
 
2197
-        if (encoderPosition != 0) {
2197
+        if (encoderPosition) {
2198 2198
           signed_enc_pos = (int32_t)encoderPosition;
2199 2199
           step_scaler += signed_enc_pos;
2200
-          x_plot = (x_plot + step_scaler / ENCODER_STEPS_PER_MENU_ITEM);
2201
-
2200
+          x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM);
2202 2201
           if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM)
2203 2202
             step_scaler = 0;
2204 2203
           refresh_cmd_timeout();
@@ -2240,7 +2239,7 @@ void kill_screen(const char* lcd_msg) {
2240 2239
 
2241 2240
           ubl_map_move_to_xy(); // Move to current location
2242 2241
 
2243
-          if (planner.movesplanned()>1) { // if the nozzle is moving, cancel the move.  There is a new location
2242
+          if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move.  There is a new location
2244 2243
             #define ENABLE_STEPPER_DRIVER_INTERRUPT()  SBI(TIMSK1, OCIE1A)
2245 2244
             #define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
2246 2245
             DISABLE_STEPPER_DRIVER_INTERRUPT();

Loading…
Отказ
Запис