|
@@ -1085,151 +1085,151 @@ static void lcd_implementation_status_screen() {
|
1085
|
1085
|
|
1086
|
1086
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
1087
|
1087
|
|
1088
|
|
- /*
|
1089
|
|
- * These are just basic data for the 20x4 LCD work that
|
1090
|
|
- * is coming up very soon.
|
1091
|
|
- * Soon this will morph into a map code.
|
1092
|
|
- */
|
|
1088
|
+ /*
|
|
1089
|
+ * These are just basic data for the 20x4 LCD work that
|
|
1090
|
+ * is coming up very soon.
|
|
1091
|
+ * Soon this will morph into a map code.
|
|
1092
|
+ */
|
|
1093
|
+
|
|
1094
|
+ /**
|
|
1095
|
+ Possible map screens:
|
|
1096
|
+
|
|
1097
|
+ 16x2 |X000.00 Y000.00|
|
|
1098
|
+ |(00,00) Z00.000|
|
|
1099
|
+
|
|
1100
|
+ 20x2 | X:000.00 Y:000.00 |
|
|
1101
|
+ | (00,00) Z:00.000 |
|
|
1102
|
+
|
|
1103
|
+ 16x4 |+-------+(00,00)|
|
|
1104
|
+ || |X000.00|
|
|
1105
|
+ || |Y000.00|
|
|
1106
|
+ |+-------+Z00.000|
|
|
1107
|
+
|
|
1108
|
+ 20x4 | +-------+ (00,00) |
|
|
1109
|
+ | | | X:000.00|
|
|
1110
|
+ | | | Y:000.00|
|
|
1111
|
+ | +-------+ Z:00.000|
|
|
1112
|
+ */
|
|
1113
|
+
|
|
1114
|
+ void lcd_set_ubl_map_plot_chars() {
|
|
1115
|
+ #if LCD_HEIGHT > 3
|
|
1116
|
+ //#include "_ubl_lcd_map_characters.h"
|
|
1117
|
+ const static byte _lcd_box_top[8] PROGMEM = {
|
|
1118
|
+ B11111,
|
|
1119
|
+ B00000,
|
|
1120
|
+ B00000,
|
|
1121
|
+ B00000,
|
|
1122
|
+ B00000,
|
|
1123
|
+ B00000,
|
|
1124
|
+ B00000,
|
|
1125
|
+ B00000
|
|
1126
|
+ };
|
|
1127
|
+ const static byte _lcd_box_bottom[8] PROGMEM = {
|
|
1128
|
+ B00000,
|
|
1129
|
+ B00000,
|
|
1130
|
+ B00000,
|
|
1131
|
+ B00000,
|
|
1132
|
+ B00000,
|
|
1133
|
+ B00000,
|
|
1134
|
+ B00000,
|
|
1135
|
+ B11111
|
|
1136
|
+ };
|
|
1137
|
+ createChar_P(LCD_UBL_BOXTOP_CHAR, _lcd_box_top);
|
|
1138
|
+ createChar_P(LCD_UBL_BOXBOT_CHAR, _lcd_box_bottom);
|
|
1139
|
+ #endif
|
|
1140
|
+ }
|
1093
|
1141
|
|
1094
|
|
- /**
|
1095
|
|
- Possible map screens:
|
1096
|
|
-
|
1097
|
|
- 16x2 |X000.00 Y000.00|
|
1098
|
|
- |(00,00) Z00.000|
|
1099
|
|
-
|
1100
|
|
- 20x2 | X:000.00 Y:000.00 |
|
1101
|
|
- | (00,00) Z:00.000 |
|
1102
|
|
-
|
1103
|
|
- 16x4 |+-------+(00,00)|
|
1104
|
|
- || |X000.00|
|
1105
|
|
- || |Y000.00|
|
1106
|
|
- |+-------+Z00.000|
|
1107
|
|
-
|
1108
|
|
- 20x4 | +-------+ (00,00) |
|
1109
|
|
- | | | X:000.00|
|
1110
|
|
- | | | Y:000.00|
|
1111
|
|
- | +-------+ Z:00.000|
|
1112
|
|
- */
|
1113
|
|
-
|
1114
|
|
- void lcd_set_ubl_map_plot_chars() {
|
1115
|
|
- #if LCD_HEIGHT > 3
|
1116
|
|
- //#include "_ubl_lcd_map_characters.h"
|
1117
|
|
- const static byte _lcd_box_top[8] PROGMEM = {
|
1118
|
|
- B11111,
|
1119
|
|
- B00000,
|
1120
|
|
- B00000,
|
1121
|
|
- B00000,
|
1122
|
|
- B00000,
|
1123
|
|
- B00000,
|
1124
|
|
- B00000,
|
1125
|
|
- B00000
|
1126
|
|
- };
|
1127
|
|
- const static byte _lcd_box_bottom[8] PROGMEM = {
|
1128
|
|
- B00000,
|
1129
|
|
- B00000,
|
1130
|
|
- B00000,
|
1131
|
|
- B00000,
|
1132
|
|
- B00000,
|
1133
|
|
- B00000,
|
1134
|
|
- B00000,
|
1135
|
|
- B11111
|
1136
|
|
- };
|
1137
|
|
- createChar_P(LCD_UBL_BOXTOP_CHAR, _lcd_box_top);
|
1138
|
|
- createChar_P(LCD_UBL_BOXBOT_CHAR, _lcd_box_bottom);
|
1139
|
|
- #endif
|
1140
|
|
- }
|
|
1142
|
+ void lcd_implementation_ubl_plot(const uint8_t x_plot, const uint8_t y_plot) {
|
1141
|
1143
|
|
1142
|
|
- void lcd_implementation_ubl_plot(const uint8_t x_plot, const uint8_t y_plot) {
|
|
1144
|
+ #if LCD_WIDTH >= 20
|
|
1145
|
+ #define _LCD_W_POS 12
|
|
1146
|
+ #define _PLOT_X 1
|
|
1147
|
+ #define _MAP_X 3
|
|
1148
|
+ #define _LABEL(C,X,Y) lcd.setCursor(X, Y); lcd.print(C)
|
|
1149
|
+ #define _XLABEL(X,Y) _LABEL("X:",X,Y)
|
|
1150
|
+ #define _YLABEL(X,Y) _LABEL("Y:",X,Y)
|
|
1151
|
+ #define _ZLABEL(X,Y) _LABEL("Z:",X,Y)
|
|
1152
|
+ #else
|
|
1153
|
+ #define _LCD_W_POS 8
|
|
1154
|
+ #define _PLOT_X 0
|
|
1155
|
+ #define _MAP_X 1
|
|
1156
|
+ #define _LABEL(X,Y,C) lcd.setCursor(X, Y); lcd.write(C)
|
|
1157
|
+ #define _XLABEL(X,Y) _LABEL('X',X,Y)
|
|
1158
|
+ #define _YLABEL(X,Y) _LABEL('Y',X,Y)
|
|
1159
|
+ #define _ZLABEL(X,Y) _LABEL('Z',X,Y)
|
|
1160
|
+ #endif
|
1143
|
1161
|
|
1144
|
|
- #if LCD_WIDTH >= 20
|
1145
|
|
- #define _LCD_W_POS 12
|
1146
|
|
- #define _PLOT_X 1
|
1147
|
|
- #define _MAP_X 3
|
1148
|
|
- #define _LABEL(C,X,Y) lcd.setCursor(X, Y); lcd.print(C)
|
1149
|
|
- #define _XLABEL(X,Y) _LABEL("X:",X,Y)
|
1150
|
|
- #define _YLABEL(X,Y) _LABEL("Y:",X,Y)
|
1151
|
|
- #define _ZLABEL(X,Y) _LABEL("Z:",X,Y)
|
1152
|
|
- #else
|
1153
|
|
- #define _LCD_W_POS 8
|
1154
|
|
- #define _PLOT_X 0
|
1155
|
|
- #define _MAP_X 1
|
1156
|
|
- #define _LABEL(X,Y,C) lcd.setCursor(X, Y); lcd.write(C)
|
1157
|
|
- #define _XLABEL(X,Y) _LABEL('X',X,Y)
|
1158
|
|
- #define _YLABEL(X,Y) _LABEL('Y',X,Y)
|
1159
|
|
- #define _ZLABEL(X,Y) _LABEL('Z',X,Y)
|
1160
|
|
- #endif
|
|
1162
|
+ #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
|
1161
|
1163
|
|
1162
|
|
- #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
|
|
1164
|
+ /**
|
|
1165
|
+ * Show X and Y positions
|
|
1166
|
+ */
|
|
1167
|
+ _XLABEL(_PLOT_X, 0);
|
|
1168
|
+ lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
|
1163
|
1169
|
|
1164
|
|
- /**
|
1165
|
|
- * Show X and Y positions
|
1166
|
|
- */
|
1167
|
|
- _XLABEL(_PLOT_X, 0);
|
1168
|
|
- lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
|
|
1170
|
+ _YLABEL(_LCD_W_POS, 0);
|
|
1171
|
+ lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
|
1169
|
1172
|
|
1170
|
|
- _YLABEL(_LCD_W_POS, 0);
|
1171
|
|
- lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
|
|
1173
|
+ lcd.setCursor(_PLOT_X, 0);
|
1172
|
1174
|
|
1173
|
|
- lcd.setCursor(_PLOT_X, 0);
|
|
1175
|
+ #else // 16x4 or 20x4 display
|
1174
|
1176
|
|
1175
|
|
- #else // 16x4 or 20x4 display
|
|
1177
|
+ /**
|
|
1178
|
+ * Draw the Mesh Map Box
|
|
1179
|
+ */
|
|
1180
|
+ uint8_t m;
|
|
1181
|
+ lcd.setCursor(_MAP_X, 0); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXTOP_CHAR); // Top
|
|
1182
|
+ lcd.setCursor(_MAP_X, 3); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXBOT_CHAR); // Bottom
|
|
1183
|
+ for (m = 0; m <= 3; m++) {
|
|
1184
|
+ lcd.setCursor(2, m); lcd.write('|'); // Left
|
|
1185
|
+ lcd.setCursor(8, m); lcd.write('|'); // Right
|
|
1186
|
+ }
|
1176
|
1187
|
|
1177
|
|
- /**
|
1178
|
|
- * Draw the Mesh Map Box
|
1179
|
|
- */
|
1180
|
|
- uint8_t m;
|
1181
|
|
- lcd.setCursor(_MAP_X, 0); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXTOP_CHAR); // Top
|
1182
|
|
- lcd.setCursor(_MAP_X, 3); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXBOT_CHAR); // Bottom
|
1183
|
|
- for (m = 0; m <= 3; m++) {
|
1184
|
|
- lcd.setCursor(2, m); lcd.write('|'); // Left
|
1185
|
|
- lcd.setCursor(8, m); lcd.write('|'); // Right
|
1186
|
|
- }
|
|
1188
|
+ lcd.setCursor(_LCD_W_POS, 0);
|
1187
|
1189
|
|
1188
|
|
- lcd.setCursor(_LCD_W_POS, 0);
|
|
1190
|
+ #endif
|
1189
|
1191
|
|
1190
|
|
- #endif
|
|
1192
|
+ /**
|
|
1193
|
+ * Print plot position
|
|
1194
|
+ */
|
|
1195
|
+ lcd.write('(');
|
|
1196
|
+ lcd.print(x_plot);
|
|
1197
|
+ lcd.write(',');
|
|
1198
|
+ lcd.print(y_plot);
|
|
1199
|
+ lcd.write(')');
|
|
1200
|
+
|
|
1201
|
+ #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
|
1191
|
1202
|
|
1192
|
1203
|
/**
|
1193
|
|
- * Print plot position
|
|
1204
|
+ * Print Z values
|
1194
|
1205
|
*/
|
1195
|
|
- lcd.write('(');
|
1196
|
|
- lcd.print(x_plot);
|
1197
|
|
- lcd.write(',');
|
1198
|
|
- lcd.print(y_plot);
|
1199
|
|
- lcd.write(')');
|
1200
|
|
-
|
1201
|
|
- #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display
|
1202
|
|
-
|
1203
|
|
- /**
|
1204
|
|
- * Print Z values
|
1205
|
|
- */
|
1206
|
|
- _ZLABEL(_LCD_W_POS, 1);
|
1207
|
|
- if (!isnan(ubl.z_values[x_plot][y_plot]))
|
1208
|
|
- lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
|
1209
|
|
- else
|
1210
|
|
- lcd_printPGM(PSTR(" -----"));
|
1211
|
|
-
|
1212
|
|
- #else // 16x4 or 20x4 display
|
1213
|
|
-
|
1214
|
|
- /**
|
1215
|
|
- * Show all values at right of screen
|
1216
|
|
- */
|
1217
|
|
- _XLABEL(_LCD_W_POS, 1);
|
1218
|
|
- lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
|
1219
|
|
- _YLABEL(_LCD_W_POS, 2);
|
1220
|
|
- lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
|
1221
|
|
-
|
1222
|
|
- /**
|
1223
|
|
- * Show the location value
|
1224
|
|
- */
|
1225
|
|
- _ZLABEL(_LCD_W_POS, 3);
|
1226
|
|
- if (!isnan(ubl.z_values[x_plot][y_plot]))
|
1227
|
|
- lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
|
1228
|
|
- else
|
1229
|
|
- lcd_printPGM(PSTR(" -----"));
|
|
1206
|
+ _ZLABEL(_LCD_W_POS, 1);
|
|
1207
|
+ if (!isnan(ubl.z_values[x_plot][y_plot]))
|
|
1208
|
+ lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
|
|
1209
|
+ else
|
|
1210
|
+ lcd_printPGM(PSTR(" -----"));
|
1230
|
1211
|
|
1231
|
|
- #endif // LCD_HEIGHT > 3
|
1232
|
|
- }
|
|
1212
|
+ #else // 16x4 or 20x4 display
|
|
1213
|
+
|
|
1214
|
+ /**
|
|
1215
|
+ * Show all values at right of screen
|
|
1216
|
+ */
|
|
1217
|
+ _XLABEL(_LCD_W_POS, 1);
|
|
1218
|
+ lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
|
|
1219
|
+ _YLABEL(_LCD_W_POS, 2);
|
|
1220
|
+ lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
|
|
1221
|
+
|
|
1222
|
+ /**
|
|
1223
|
+ * Show the location value
|
|
1224
|
+ */
|
|
1225
|
+ _ZLABEL(_LCD_W_POS, 3);
|
|
1226
|
+ if (!isnan(ubl.z_values[x_plot][y_plot]))
|
|
1227
|
+ lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
|
|
1228
|
+ else
|
|
1229
|
+ lcd_printPGM(PSTR(" -----"));
|
|
1230
|
+
|
|
1231
|
+ #endif // LCD_HEIGHT > 3
|
|
1232
|
+ }
|
1233
|
1233
|
|
1234
|
1234
|
#endif // AUTO_BED_LEVELING_UBL
|
1235
|
1235
|
|