|
@@ -108,7 +108,6 @@ uint16_t max_display_update_time = 0;
|
108
|
108
|
extern bool powersupply_on;
|
109
|
109
|
#endif
|
110
|
110
|
|
111
|
|
-
|
112
|
111
|
////////////////////////////////////////////
|
113
|
112
|
///////////////// Menu Tree ////////////////
|
114
|
113
|
////////////////////////////////////////////
|
|
@@ -2163,97 +2162,6 @@ void kill_screen(const char* lcd_msg) {
|
2163
|
2162
|
enqueue_and_echo_command(ubl_lcd_gcode);
|
2164
|
2163
|
}
|
2165
|
2164
|
|
2166
|
|
- #if ENABLED(DOGLCD)
|
2167
|
|
-
|
2168
|
|
- /**
|
2169
|
|
- * UBL LCD "radar" map data
|
2170
|
|
- */
|
2171
|
|
- #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now,
|
2172
|
|
- #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here
|
2173
|
|
- #define MAP_MAX_PIXELS_X 53
|
2174
|
|
- #define MAP_MAX_PIXELS_Y 49
|
2175
|
|
-
|
2176
|
|
- void _lcd_ubl_plot_drawing_prep() {
|
2177
|
|
- uint8_t i, j, x_offset, y_offset, x_map_pixels, y_map_pixels,
|
2178
|
|
- pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt, inverted_y;
|
2179
|
|
-
|
2180
|
|
- /*********************************************************/
|
2181
|
|
- /************ Scale the box pixels appropriately *********/
|
2182
|
|
- /*********************************************************/
|
2183
|
|
- x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X);
|
2184
|
|
- y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y);
|
2185
|
|
-
|
2186
|
|
- pixels_per_X_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X);
|
2187
|
|
- pixels_per_Y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y);
|
2188
|
|
-
|
2189
|
|
- x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
|
2190
|
|
- y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
|
2191
|
|
-
|
2192
|
|
- /*********************************************************/
|
2193
|
|
- /************ Clear the Mesh Map Box**********************/
|
2194
|
|
- /*********************************************************/
|
2195
|
|
-
|
2196
|
|
- u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box
|
2197
|
|
- u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4);
|
2198
|
|
-
|
2199
|
|
- u8g.setColorIndex(0); // Now actually clear the mesh map box
|
2200
|
|
- u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels);
|
2201
|
|
-
|
2202
|
|
- /*********************************************************/
|
2203
|
|
- /************ Display Mesh Point Locations ***************/
|
2204
|
|
- /*********************************************************/
|
2205
|
|
-
|
2206
|
|
- u8g.setColorIndex(1);
|
2207
|
|
- for (i = 0; i < GRID_MAX_POINTS_X; i++) {
|
2208
|
|
- for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
|
2209
|
|
- u8g.drawBox(x_offset + i * pixels_per_X_mesh_pnt + pixels_per_X_mesh_pnt / 2,
|
2210
|
|
- y_offset + j * pixels_per_Y_mesh_pnt + pixels_per_Y_mesh_pnt / 2, 1, 1);
|
2211
|
|
- }
|
2212
|
|
- }
|
2213
|
|
-
|
2214
|
|
- /*********************************************************/
|
2215
|
|
- /************ Fill in the Specified Mesh Point ***********/
|
2216
|
|
- /*********************************************************/
|
2217
|
|
-
|
2218
|
|
- inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to
|
2219
|
|
- // invert the Y to get it to plot in the right location.
|
2220
|
|
- u8g.drawBox(x_offset + x_plot * pixels_per_X_mesh_pnt, y_offset + inverted_y * pixels_per_Y_mesh_pnt,
|
2221
|
|
- pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt);
|
2222
|
|
-
|
2223
|
|
- /*********************************************************/
|
2224
|
|
- /************** Put Relevent Text on Display *************/
|
2225
|
|
- /*********************************************************/
|
2226
|
|
-
|
2227
|
|
- // Show X and Y positions at top of screen
|
2228
|
|
- u8g.setColorIndex(1);
|
2229
|
|
- u8g.setPrintPos(5, 7);
|
2230
|
|
- lcd_print("X:");
|
2231
|
|
- lcd_print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
|
2232
|
|
- u8g.setPrintPos(74, 7);
|
2233
|
|
- lcd_print("Y:");
|
2234
|
|
- lcd_print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
|
2235
|
|
-
|
2236
|
|
- // Print plot position
|
2237
|
|
- u8g.setPrintPos(5, 64);
|
2238
|
|
- lcd_print('(');
|
2239
|
|
- u8g.print(x_plot);
|
2240
|
|
- lcd_print(',');
|
2241
|
|
- u8g.print(y_plot);
|
2242
|
|
- lcd_print(')');
|
2243
|
|
-
|
2244
|
|
- // Show the location value
|
2245
|
|
- u8g.setPrintPos(74, 64);
|
2246
|
|
- lcd_print("Z:");
|
2247
|
|
- if (!isnan(ubl.z_values[x_plot][y_plot])) {
|
2248
|
|
- lcd_print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
|
2249
|
|
- }
|
2250
|
|
- else {
|
2251
|
|
- lcd_print(" -----");
|
2252
|
|
- }
|
2253
|
|
- }
|
2254
|
|
-
|
2255
|
|
- #endif // DOGLCD
|
2256
|
|
-
|
2257
|
2165
|
/**
|
2258
|
2166
|
* UBL LCD Map Movement
|
2259
|
2167
|
*/
|
|
@@ -2318,9 +2226,9 @@ void kill_screen(const char* lcd_msg) {
|
2318
|
2226
|
|
2319
|
2227
|
if (lcdDrawUpdate) {
|
2320
|
2228
|
#if ENABLED(DOGLCD)
|
2321
|
|
- _lcd_ubl_plot_drawing_prep();
|
|
2229
|
+ _lcd_ubl_plot_DOGLCD(x_plot, y_plot);
|
2322
|
2230
|
#else
|
2323
|
|
- _lcd_ubl_output_char_lcd();
|
|
2231
|
+ _lcd_ubl_plot_HD44780(x_plot, y_plot);
|
2324
|
2232
|
#endif
|
2325
|
2233
|
|
2326
|
2234
|
ubl_map_move_to_xy(); // Move to current location
|