Kaynağa Gözat

Updated to better support the coming "radar"

Tannoo 8 yıl önce
ebeveyn
işleme
80abc872f3
1 değiştirilmiş dosya ile 176 ekleme ve 48 silme
  1. 176
    48
      Marlin/ultralcd_impl_HD44780.h

+ 176
- 48
Marlin/ultralcd_impl_HD44780.h Dosyayı Görüntüle

@@ -1085,64 +1085,192 @@ static void lcd_implementation_status_screen() {
1085 1085
 
1086 1086
 #ifdef AUTO_BED_LEVELING_UBL
1087 1087
 
1088
-    // These are just basic data for the 20x4 LCD work that
1089
-    // is coming up very soon.
1090
-    // Soon this will morph into a map code.
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
+    */
1091 1113
 
1092 1114
     void _lcd_ubl_plot_HD44780(uint8_t x_plot, uint8_t y_plot) {
1093 1115
 
1094
-      uint8_t lcd_w_pos = 8, lcd_h_pos = 1;
1116
+      uint8_t lcd_w_pos;
1095 1117
 
1096 1118
       #if LCD_WIDTH < 20
1097 1119
         lcd_w_pos = 8;
1098 1120
       #else
1099 1121
         lcd_w_pos = 12;
1100 1122
       #endif
1101
-      #if LCD_HEIGHT > 3
1102
-        lcd_h_pos = 3;
1103
-      #elif LCD_HEIGHT > 2
1104
-        lcd_h_pos = 2;
1105
-      #else
1106
-        lcd_h_pos = 1;
1107
-      #endif
1108 1123
 
1109
-      // Show X and Y positions at top of screen
1110
-      lcd.setCursor(0, 0);
1111
-      #if LCD_WIDTH < 20
1112
-        lcd.print("X");
1113
-      #else
1114
-        lcd.print("X:");
1115
-      #endif
1116
-      lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
1117
-      lcd.setCursor(lcd_w_pos, 0);
1118
-      #if LCD_WIDTH < 20
1119
-        lcd.print("Y");
1120
-      #else
1121
-        lcd.print("Y:");
1122
-      #endif
1123
-      lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
1124
-
1125
-      // Print plot position
1126
-      lcd.setCursor(0, lcd_h_pos);
1127
-      lcd.print("(");
1128
-      lcd.print(x_plot);
1129
-      lcd.print(",");
1130
-      lcd.print(y_plot);
1131
-      lcd.print(")");
1132
-
1133
-      // Show the location value
1134
-      lcd.setCursor(lcd_w_pos, lcd_h_pos);
1135
-      #if LCD_WIDTH < 20
1136
-        lcd.print("Z");
1137
-      #else
1138
-        lcd.print("Z:");
1139
-      #endif
1140
-      if (!isnan(ubl.z_values[x_plot][y_plot])) {
1141
-        lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1142
-      }
1143
-      else {
1144
-        lcd.print(" -----");
1145
-      }
1124
+      #if LCD_HEIGHT < 3
1125
+
1126
+        /*
1127
+         *** 16x2 or 20x2 display **
1128
+         * 
1129
+         * Show X and Y positions
1130
+         */
1131
+        #if LCD_WIDTH < 20
1132
+          lcd.setCursor(0, 0);
1133
+          lcd.print("X");
1134
+        #else
1135
+          lcd.setCursor(1, 0);
1136
+          lcd.print("X:");
1137
+        #endif
1138
+        lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
1139
+
1140
+        lcd.setCursor(lcd_w_pos, 0);
1141
+        #if LCD_WIDTH < 20
1142
+          lcd.print("Y");
1143
+        #else
1144
+          lcd.print("Y:");
1145
+        #endif
1146
+        lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
1147
+
1148
+        /*
1149
+         * Print plot position
1150
+         */
1151
+        #if LCD_WIDTH < 20
1152
+          lcd.setCursor(0, 1);
1153
+        #else
1154
+          lcd.setCursor(1, 1);
1155
+        #endif
1156
+        lcd.print("(");
1157
+        lcd.print(x_plot);
1158
+        lcd.print(",");
1159
+        lcd.print(y_plot);
1160
+        lcd.print(")");
1161
+
1162
+        /*
1163
+         * Print Z values
1164
+         */
1165
+        lcd.setCursor(lcd_w_pos, 1);
1166
+        #if LCD_WIDTH < 20
1167
+          lcd.print("Z");
1168
+        #else
1169
+          lcd.print("Z:");
1170
+        #endif
1171
+        if (!isnan(ubl.z_values[x_plot][y_plot])) {
1172
+          lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1173
+        }
1174
+        else {
1175
+          lcd.print(" -----");
1176
+        }
1177
+
1178
+      #elif LCD_HEIGHT > 3
1179
+
1180
+        //#include "_ubl_lcd_map_characters.h"
1181
+
1182
+        const static PROGMEM byte _lcd_box_top[8] = {
1183
+          B11111,
1184
+          B00000,
1185
+          B00000,
1186
+          B00000,
1187
+          B00000,
1188
+          B00000,
1189
+          B00000,
1190
+          B00000
1191
+        };
1192
+
1193
+        const static PROGMEM byte _lcd_box_bottom[8] = {
1194
+          B00000,
1195
+          B00000,
1196
+          B00000,
1197
+          B00000,
1198
+          B00000,
1199
+          B00000,
1200
+          B00000,
1201
+          B11111
1202
+        };
1203
+
1204
+        /*
1205
+         * Draw the Mesh Map Box
1206
+         */
1207
+        // First create the box custom characters
1208
+        createChar_P(1, _lcd_box_top);
1209
+        createChar_P(2, _lcd_box_bottom);
1210
+
1211
+        // Draw the mesh map box
1212
+        uint8_t m;
1213
+        
1214
+        #if LCD_WIDTH < 20
1215
+
1216
+          for(m = 1; m <= 5; m++) { lcd.setCursor(m, 0); lcd.write(1); } // Top
1217
+          for(m = 1; m <= 5; m++) { lcd.setCursor(m, 3); lcd.write(2); } // Bottom
1218
+          for(m = 0; m <= 3; m++) { lcd.setCursor(2, m); lcd.write('|'); } // Left
1219
+          for(m = 0; m <= 3; m++) { lcd.setCursor(8, m); lcd.write('|');  } // Right
1220
+
1221
+        #else
1222
+        
1223
+          for(m = 3; m <= 7; m++) { lcd.setCursor(m, 0); lcd.write(1); } // Top
1224
+          for(m = 3; m <= 7; m++) { lcd.setCursor(m, 3); lcd.write(2); } // Bottom
1225
+          for(m = 0; m <= 3; m++) { lcd.setCursor(2, m); lcd.write('|'); } // Left
1226
+          for(m = 0; m <= 3; m++) { lcd.setCursor(8, m); lcd.write('|');  } // Right
1227
+
1228
+        #endif
1229
+        /*
1230
+         * Print plot position
1231
+         */
1232
+        lcd.setCursor(lcd_w_pos, 0);
1233
+        lcd.print("(");
1234
+        lcd.print(x_plot);
1235
+        lcd.print(",");
1236
+        lcd.print(y_plot);
1237
+        lcd.print(")");
1238
+
1239
+        /*
1240
+         * Show all values at right of screen
1241
+         */
1242
+        lcd.setCursor(lcd_w_pos, 1);
1243
+        #if LCD_WIDTH < 20
1244
+          lcd.print("X");
1245
+        #else
1246
+          lcd.print("X:");
1247
+        #endif
1248
+        lcd.print(ftostr32(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]))));
1249
+        lcd.setCursor(lcd_w_pos, 2);
1250
+        #if LCD_WIDTH < 20
1251
+          lcd.print("Y");
1252
+        #else
1253
+          lcd.print("Y:");
1254
+        #endif
1255
+        lcd.print(ftostr32(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]))));
1256
+
1257
+        /*
1258
+         * Show the location value
1259
+         */
1260
+        lcd.setCursor(lcd_w_pos, 3);
1261
+        #if LCD_WIDTH < 20
1262
+          lcd.print("Z");
1263
+        #else
1264
+          lcd.print("Z:");
1265
+        #endif
1266
+        if (!isnan(ubl.z_values[x_plot][y_plot])) {
1267
+          lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1268
+        }
1269
+        else {
1270
+          lcd.print(" -----");
1271
+        }
1272
+
1273
+      #endif // LCD_HEIGHT > 3
1146 1274
     }
1147 1275
 
1148 1276
 #endif // AUTO_BED_LEVELING_UBL

Loading…
İptal
Kaydet