Ver código fonte

The big LCD code update. This splits the display and menu implementation. Paving the way for future different displays. It also makes it easier to modify the menu structures while keeping everything consistant. Note that this most likely breaks the translations, which need to be updated.

daid303 12 anos atrás
pai
commit
1a8f54cea1

+ 0
- 1
Marlin/Marlin.h Ver arquivo

182
 extern float homing_feedrate[];
182
 extern float homing_feedrate[];
183
 extern bool axis_relative_modes[];
183
 extern bool axis_relative_modes[];
184
 extern int feedmultiply;
184
 extern int feedmultiply;
185
-extern bool feedmultiplychanged;
186
 extern int extrudemultiply; // Sets extrude multiply factor (in percent)
185
 extern int extrudemultiply; // Sets extrude multiply factor (in percent)
187
 extern float current_position[NUM_AXIS] ;
186
 extern float current_position[NUM_AXIS] ;
188
 extern float add_homeing[3];
187
 extern float add_homeing[3];

+ 1
- 2
Marlin/Marlin_main.cpp Ver arquivo

147
 float homing_feedrate[] = HOMING_FEEDRATE;
147
 float homing_feedrate[] = HOMING_FEEDRATE;
148
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
148
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
149
 int feedmultiply=100; //100->1 200->2
149
 int feedmultiply=100; //100->1 200->2
150
-bool feedmultiplychanged;
151
 int saved_feedmultiply;
150
 int saved_feedmultiply;
152
 int extrudemultiply=100; //100->1 200->2
151
 int extrudemultiply=100; //100->1 200->2
153
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
152
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
1372
       if(code_seen('S')) 
1371
       if(code_seen('S')) 
1373
       {
1372
       {
1374
         feedmultiply = code_value() ;
1373
         feedmultiply = code_value() ;
1375
-        feedmultiplychanged = true;
1376
       }
1374
       }
1377
     }
1375
     }
1378
     break;
1376
     break;
1543
     break;
1541
     break;
1544
     case 999: // M999: Restart after being stopped
1542
     case 999: // M999: Restart after being stopped
1545
       Stopped = false;
1543
       Stopped = false;
1544
+      lcd_reset_alert_level();
1546
       gcode_LastN = Stopped_gcode_LastN;
1545
       gcode_LastN = Stopped_gcode_LastN;
1547
       FlushSerialRequestResend();
1546
       FlushSerialRequestResend();
1548
     break;
1547
     break;

+ 10
- 9
Marlin/cardreader.cpp Ver arquivo

527
 
527
 
528
 void CardReader::printingHasFinished()
528
 void CardReader::printingHasFinished()
529
 {
529
 {
530
- st_synchronize();
531
- quickStop();
532
- sdprinting = false;
533
- if(SD_FINISHED_STEPPERRELEASE)
534
- {
535
-   //finishAndDisableSteppers();
536
-   enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
537
- }
538
- autotempShutdown();
530
+    st_synchronize();
531
+    quickStop();
532
+    file.close();
533
+    sdprinting = false;
534
+    if(SD_FINISHED_STEPPERRELEASE)
535
+    {
536
+        //finishAndDisableSteppers();
537
+        enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
538
+    }
539
+    autotempShutdown();
539
 }
540
 }
540
 #endif //SDSUPPORT
541
 #endif //SDSUPPORT

+ 2
- 1
Marlin/cardreader.h Ver arquivo

35
   void setroot();
35
   void setroot();
36
 
36
 
37
 
37
 
38
+  FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
38
   FORCE_INLINE bool eof() { return sdpos>=filesize ;};
39
   FORCE_INLINE bool eof() { return sdpos>=filesize ;};
39
   FORCE_INLINE int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
40
   FORCE_INLINE int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
40
   FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
41
   FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
41
-  FORCE_INLINE uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
42
+  FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
42
   FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
43
   FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
43
 
44
 
44
 public:
45
 public:

+ 137
- 154
Marlin/language.h Ver arquivo

39
 	#define WELCOME_MSG MACHINE_NAME " Ready."
39
 	#define WELCOME_MSG MACHINE_NAME " Ready."
40
 	#define MSG_SD_INSERTED "Card inserted"
40
 	#define MSG_SD_INSERTED "Card inserted"
41
 	#define MSG_SD_REMOVED "Card removed"
41
 	#define MSG_SD_REMOVED "Card removed"
42
-	#define MSG_MAIN " Main \003"
43
-	#define MSG_AUTOSTART " Autostart"
44
-	#define MSG_DISABLE_STEPPERS " Disable Steppers"
45
-	#define MSG_AUTO_HOME " Auto Home"
46
-	#define MSG_SET_ORIGIN " Set Origin"
47
-	#define MSG_PREHEAT_PLA " Preheat PLA"
48
-	#define MSG_PREHEAT_PLA_SETTINGS " Preheat PLA Setting"
49
-	#define MSG_PREHEAT_ABS " Preheat ABS"
50
-	#define MSG_PREHEAT_ABS_SETTINGS " Preheat ABS Setting"
51
-	#define MSG_COOLDOWN " Cooldown"
52
-	#define MSG_EXTRUDE " Extrude"
53
-	#define MSG_RETRACT " Retract"
54
-	#define MSG_PREHEAT_PLA " Preheat PLA"
55
-	#define MSG_PREHEAT_ABS " Preheat ABS"
56
-	#define MSG_MOVE_AXIS " Move Axis      \x7E"
57
-	#define MSG_SPEED " Speed:"
58
-	#define MSG_NOZZLE " \002Nozzle:"
59
-	#define MSG_NOZZLE1 " \002Nozzle2:"
60
-	#define MSG_NOZZLE2 " \002Nozzle3:"
61
-	#define MSG_BED " \002Bed:"
62
-	#define MSG_FAN_SPEED " Fan speed:"
63
-	#define MSG_FLOW " Flow:"
64
-	#define MSG_CONTROL " Control \003"
65
-	#define MSG_MIN " \002 Min:"
66
-	#define MSG_MAX " \002 Max:"
67
-	#define MSG_FACTOR " \002 Fact:"
68
-	#define MSG_AUTOTEMP " Autotemp:"
42
+	#define MSG_MAIN "Main"
43
+	#define MSG_AUTOSTART "Autostart"
44
+	#define MSG_DISABLE_STEPPERS "Disable Steppers"
45
+	#define MSG_AUTO_HOME "Auto Home"
46
+	#define MSG_SET_ORIGIN "Set Origin"
47
+	#define MSG_PREHEAT_PLA "Preheat PLA"
48
+	#define MSG_PREHEAT_PLA_SETTINGS "Preheat PLA Conf"
49
+	#define MSG_PREHEAT_ABS "Preheat ABS"
50
+	#define MSG_PREHEAT_ABS_SETTINGS "Preheat ABS Conf"
51
+	#define MSG_COOLDOWN "Cooldown"
52
+	#define MSG_EXTRUDE "Extrude"
53
+	#define MSG_RETRACT "Retract"
54
+	#define MSG_PREHEAT_PLA "Preheat PLA"
55
+	#define MSG_PREHEAT_ABS "Preheat ABS"
56
+	#define MSG_MOVE_AXIS "Move Axis"
57
+	#define MSG_SPEED "Speed"
58
+	#define MSG_NOZZLE "Nozzle"
59
+	#define MSG_NOZZLE1 "Nozzle2"
60
+	#define MSG_NOZZLE2 "Nozzle3"
61
+	#define MSG_BED "Bed"
62
+	#define MSG_FAN_SPEED "Fan speed"
63
+	#define MSG_FLOW "Flow"
64
+	#define MSG_CONTROL "Control"
65
+	#define MSG_MIN " \002 Min"
66
+	#define MSG_MAX " \002 Max"
67
+	#define MSG_FACTOR " \002 Fact"
68
+	#define MSG_AUTOTEMP "Autotemp"
69
 	#define MSG_ON "On "
69
 	#define MSG_ON "On "
70
 	#define MSG_OFF "Off"
70
 	#define MSG_OFF "Off"
71
-	#define MSG_PID_P " PID-P: "
72
-	#define MSG_PID_I " PID-I: "
73
-	#define MSG_PID_D " PID-D: "
74
-	#define MSG_PID_C " PID-C: "
75
-	#define MSG_ACC  " Acc:"
76
-	#define MSG_VXY_JERK " Vxy-jerk: "
77
-	#define MSG_VMAX " Vmax "
78
-	#define MSG_X "x:"
79
-	#define MSG_Y "y:"
80
-	#define MSG_Z "z:"
81
-	#define MSG_E "e:"
82
-	#define MSG_VMIN " Vmin:"
83
-	#define MSG_VTRAV_MIN " VTrav min:"
84
-	#define MSG_AMAX " Amax "
85
-	#define MSG_A_RETRACT " A-retract:"
86
-	#define MSG_XSTEPS " Xsteps/mm:"
87
-	#define MSG_YSTEPS " Ysteps/mm:"
88
-	#define MSG_ZSTEPS " Zsteps/mm:"
89
-	#define MSG_ESTEPS " Esteps/mm:"
90
-	#define MSG_MAIN_WIDE " Main        \003"
91
-	#define MSG_RECTRACT_WIDE " Rectract    \x7E"
92
-	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
93
-	#define MSG_TEMPERATURE_RTN " Temperature  \003"
94
-	#define MSG_MOTION_WIDE " Motion      \x7E"
95
-	#define MSG_STORE_EPROM " Store memory"
96
-	#define MSG_LOAD_EPROM " Load memory"
97
-	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
98
-	#define MSG_REFRESH "\004Refresh"
99
-	#define MSG_WATCH " Watch   \003"
100
-	#define MSG_PREPARE " Prepare \x7E"
101
-	#define MSG_PREPARE_ALT " Prepare \003"
102
-	#define MSG_CONTROL_ARROW " Control \x7E"
103
-	#define MSG_RETRACT_ARROW " Retract \x7E"
104
-	#define MSG_TUNE " Tune    \x7E"
105
-	#define MSG_PAUSE_PRINT " Pause Print \x7E"
106
-	#define MSG_RESUME_PRINT " Resume Print \x7E"
107
-	#define MSG_STOP_PRINT " Stop Print   \x7E"
108
-	#define MSG_CARD_MENU " Card Menu    \x7E"
109
-	#define MSG_NO_CARD " No Card"
71
+	#define MSG_PID_P "PID-P"
72
+	#define MSG_PID_I "PID-I"
73
+	#define MSG_PID_D "PID-D"
74
+	#define MSG_PID_C "PID-C"
75
+	#define MSG_ACC  "Accel"
76
+	#define MSG_VXY_JERK "Vxy-jerk"
77
+	#define MSG_VMAX "Vmax "
78
+	#define MSG_X "x"
79
+	#define MSG_Y "y"
80
+	#define MSG_Z "z"
81
+	#define MSG_E "e"
82
+	#define MSG_VMIN "Vmin"
83
+	#define MSG_VTRAV_MIN "VTrav min"
84
+	#define MSG_AMAX "Amax "
85
+	#define MSG_A_RETRACT "A-retract"
86
+	#define MSG_XSTEPS "Xsteps/mm"
87
+	#define MSG_YSTEPS "Ysteps/mm"
88
+	#define MSG_ZSTEPS "Zsteps/mm"
89
+	#define MSG_ESTEPS "Esteps/mm"
90
+	#define MSG_RECTRACT "Rectract"
91
+	#define MSG_TEMPERATURE "Temperature"
92
+	#define MSG_MOTION "Motion"
93
+	#define MSG_STORE_EPROM "Store memory"
94
+	#define MSG_LOAD_EPROM "Load memory"
95
+	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
96
+	#define MSG_REFRESH "Refresh"
97
+	#define MSG_WATCH "Watch"
98
+	#define MSG_PREPARE "Prepare"
99
+	#define MSG_TUNE "Tune"
100
+	#define MSG_PAUSE_PRINT "Pause Print"
101
+	#define MSG_RESUME_PRINT "Resume Print"
102
+	#define MSG_STOP_PRINT "Stop Print"
103
+	#define MSG_CARD_MENU "Card Menu"
104
+	#define MSG_NO_CARD "No Card"
110
 	#define MSG_DWELL "Sleep..."
105
 	#define MSG_DWELL "Sleep..."
111
 	#define MSG_USERWAIT "Wait for user..."
106
 	#define MSG_USERWAIT "Wait for user..."
112
 	#define MSG_NO_MOVE "No move."
107
 	#define MSG_NO_MOVE "No move."
113
-	#define MSG_PART_RELEASE "Partial Release"
114
 	#define MSG_KILLED "KILLED. "
108
 	#define MSG_KILLED "KILLED. "
115
 	#define MSG_STOPPED "STOPPED. "
109
 	#define MSG_STOPPED "STOPPED. "
116
-	#define MSG_STEPPER_RELEASED "Released."
117
-	#define MSG_CONTROL_RETRACT  " Retract mm:"
118
-	#define MSG_CONTROL_RETRACTF " Retract  F:"
119
-	#define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
120
-	#define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
121
-	#define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
122
-	#define MSG_AUTORETRACT " AutoRetr.:"
123
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
110
+	#define MSG_CONTROL_RETRACT  "Retract mm"
111
+	#define MSG_CONTROL_RETRACTF "Retract  F"
112
+	#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
113
+	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
114
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
115
+	#define MSG_AUTORETRACT "AutoRetr."
124
 
116
 
125
 // Serial Console Messages
117
 // Serial Console Messages
126
 
118
 
200
 	#define WELCOME_MSG MACHINE_NAME " Gotowe."
192
 	#define WELCOME_MSG MACHINE_NAME " Gotowe."
201
 	#define MSG_SD_INSERTED "Karta wlozona"
193
 	#define MSG_SD_INSERTED "Karta wlozona"
202
 	#define MSG_SD_REMOVED "Karta usunieta"
194
 	#define MSG_SD_REMOVED "Karta usunieta"
203
-	#define MSG_MAIN " Menu \003"
204
-	#define MSG_AUTOSTART " Autostart"
205
-	#define MSG_DISABLE_STEPPERS " Wylacz silniki"
206
-	#define MSG_AUTO_HOME " Auto. poz. zerowa"
207
-	#define MSG_SET_ORIGIN " Ustaw punkt zerowy"
208
-	#define MSG_PREHEAT_PLA " Rozgrzej PLA"
209
-	#define MSG_PREHEAT_PLA_SETTINGS " Ustawienia roz. PLA"
210
-	#define MSG_PREHEAT_ABS " Rozgrzej ABS"
211
-	#define MSG_PREHEAT_ABS_SETTINGS " Ustawienia roz. ABS"
212
-	#define MSG_COOLDOWN " Chlodzenie"
213
-	#define MSG_EXTRUDE " Ekstruzja"
214
-	#define MSG_RETRACT " Cofanie"
215
-	#define MSG_MOVE_AXIS " Ruch osi       \x7E"
216
-	#define MSG_SPEED " Predkosc:"
217
-	#define MSG_NOZZLE " \002Dysza:"
218
-	#define MSG_NOZZLE1 " \002Dysza2:"
219
-	#define MSG_NOZZLE2 " \002Dysza3:"
220
-	#define MSG_BED " \002Loze:"
221
-	#define MSG_FAN_SPEED " Obroty wiatraka:"
222
-	#define MSG_FLOW " Przeplyw:"
223
-	#define MSG_CONTROL " Kontrola \003"
224
-	#define MSG_MIN " \002 Min:"
225
-	#define MSG_MAX " \002 Max:"
226
-	#define MSG_FACTOR " \002 Mnoznik:"
227
-	#define MSG_AUTOTEMP " Auto. temp.:"
195
+	#define MSG_MAIN "Main"
196
+	#define MSG_AUTOSTART "Autostart"
197
+	#define MSG_DISABLE_STEPPERS "Wylacz silniki"
198
+	#define MSG_AUTO_HOME "Auto. poz. zerowa"
199
+	#define MSG_SET_ORIGIN "Ustaw punkt zerowy"
200
+	#define MSG_PREHEAT_PLA "Rozgrzej PLA"
201
+	#define MSG_PREHEAT_PLA_SETTINGS "Ustawienia roz. PLA"
202
+	#define MSG_PREHEAT_ABS "Rozgrzej ABS"
203
+	#define MSG_PREHEAT_ABS_SETTINGS "Ustawienia roz. ABS"
204
+	#define MSG_COOLDOWN "Chlodzenie"
205
+	#define MSG_EXTRUDE "Ekstruzja"
206
+	#define MSG_RETRACT "Cofanie"
207
+	#define MSG_MOVE_AXIS "Ruch osi"
208
+	#define MSG_SPEED "Predkosc"
209
+	#define MSG_NOZZLE "Dysza"
210
+	#define MSG_NOZZLE1 "Dysza2"
211
+	#define MSG_NOZZLE2 "Dysza3"
212
+	#define MSG_BED "Loze"
213
+	#define MSG_FAN_SPEED "Obroty wiatraka"
214
+	#define MSG_FLOW "Przeplyw"
215
+	#define MSG_CONTROL "Kontrola"
216
+	#define MSG_MIN " \002 Min"
217
+	#define MSG_MAX " \002 Max"
218
+	#define MSG_FACTOR " \002 Mnoznik"
219
+	#define MSG_AUTOTEMP "Auto. temp."
228
 	#define MSG_ON "Wl. "
220
 	#define MSG_ON "Wl. "
229
 	#define MSG_OFF "Wyl."
221
 	#define MSG_OFF "Wyl."
230
-	#define MSG_PID_P " PID-P: "
231
-	#define MSG_PID_I " PID-I: "
232
-	#define MSG_PID_D " PID-D: "
233
-	#define MSG_PID_C " PID-C: "
234
-	#define MSG_ACC  " Acc:"
235
-	#define MSG_VXY_JERK " Zryw Vxy: "
236
-	#define MSG_VMAX " Vmax "
237
-	#define MSG_X "x:"
238
-	#define MSG_Y "y:"
239
-	#define MSG_Z "z:"
240
-	#define MSG_E "e:"
241
-	#define MSG_VMIN " Vmin:"
242
-	#define MSG_VTRAV_MIN " Vskok min:"
243
-	#define MSG_AMAX " Amax "
244
-	#define MSG_A_RETRACT " A-wycofanie:"
245
-	#define MSG_XSTEPS " krokiX/mm:"
246
-	#define MSG_YSTEPS " krokiY/mm:"
247
-	#define MSG_ZSTEPS " krokiZ/mm:"
248
-	#define MSG_ESTEPS " krokiE/mm:"
249
-	#define MSG_MAIN_WIDE " Menu        \003"
250
-	#define MSG_RECTRACT_WIDE " Wycofanie   \x7E"
251
-	#define MSG_TEMPERATURE_WIDE " Temperatura \x7E"
252
-	#define MSG_TEMPERATURE_RTN " Temperatura  \003"
253
-	#define MSG_MOTION_WIDE " Ruch        \x7E"
254
-	#define MSG_STORE_EPROM " Zapisz w pamieci"
255
-	#define MSG_LOAD_EPROM " Wczytaj z pamieci"
222
+	#define MSG_PID_P "PID-P"
223
+	#define MSG_PID_I "PID-I"
224
+	#define MSG_PID_D "PID-D"
225
+	#define MSG_PID_C "PID-C"
226
+	#define MSG_ACC  "Acc"
227
+	#define MSG_VXY_JERK "Zryw Vxy"
228
+	#define MSG_VMAX "Vmax"
229
+	#define MSG_X "x"
230
+	#define MSG_Y "y"
231
+	#define MSG_Z "z"
232
+	#define MSG_E "e"
233
+	#define MSG_VMIN "Vmin"
234
+	#define MSG_VTRAV_MIN "Vskok min"
235
+	#define MSG_AMAX "Amax"
236
+	#define MSG_A_RETRACT "A-wycofanie"
237
+	#define MSG_XSTEPS "krokiX/mm"
238
+	#define MSG_YSTEPS "krokiY/mm"
239
+	#define MSG_ZSTEPS "krokiZ/mm"
240
+	#define MSG_ESTEPS "krokiE/mm"
241
+	#define MSG_RECTRACT "Wycofanie"
242
+	#define MSG_TEMPERATURE "Temperatura"
243
+	#define MSG_MOTION "Ruch"
244
+	#define MSG_STORE_EPROM "Zapisz w pamieci"
245
+	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
256
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
246
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
257
 	#define MSG_REFRESH "\004Odswiez"
247
 	#define MSG_REFRESH "\004Odswiez"
258
-	#define MSG_WATCH " Obserwuj   \003"
259
-	#define MSG_PREPARE " Przygotuj \x7E"
260
-	#define MSG_PREPARE_ALT " Przygotuj \003"
261
-	#define MSG_CONTROL_ARROW " Kontroluj \x7E"
262
-	#define MSG_RETRACT_ARROW " Wycofaj \x7E"
263
-	#define MSG_TUNE "Strojenie\x7E"
264
-	#define MSG_PAUSE_PRINT "    Pauza    \x7E"
265
-	#define MSG_RESUME_PRINT "  Wznowienie  \x7E"
266
-	#define MSG_STOP_PRINT "     Stop     \x7E"
267
-	#define MSG_CARD_MENU " Menu SDCard  \x7E"
268
-	#define MSG_NO_CARD " Brak karty"
248
+	#define MSG_WATCH "Obserwuj"
249
+	#define MSG_PREPARE "Przygotuj"
250
+	#define MSG_CONTROL "Kontroluj"
251
+	#define MSG_TUNE "Strojenie"
252
+	#define MSG_PAUSE_PRINT "Pauza"
253
+	#define MSG_RESUME_PRINT "Wznowienie"
254
+	#define MSG_STOP_PRINT "Stop"
255
+	#define MSG_CARD_MENU "Menu SDCard"
256
+	#define MSG_NO_CARD "Brak karty"
269
 	#define MSG_DWELL "Uspij..."
257
 	#define MSG_DWELL "Uspij..."
270
 	#define MSG_USERWAIT "Czekaj na uzytkownika..."
258
 	#define MSG_USERWAIT "Czekaj na uzytkownika..."
271
 	#define MSG_NO_MOVE "Brak ruchu."
259
 	#define MSG_NO_MOVE "Brak ruchu."
273
 	#define MSG_KILLED "Ubity. "
261
 	#define MSG_KILLED "Ubity. "
274
 	#define MSG_STOPPED "Zatrzymany. "
262
 	#define MSG_STOPPED "Zatrzymany. "
275
 	#define MSG_STEPPER_RELEASED "Zwolniony."
263
 	#define MSG_STEPPER_RELEASED "Zwolniony."
276
-	#define MSG_CONTROL_RETRACT  " Wycofaj mm:"
277
-	#define MSG_CONTROL_RETRACTF " Wycofaj  F:"
278
-	#define MSG_CONTROL_RETRACT_ZLIFT " Skok Z mm:"
279
-	#define MSG_CONTROL_RETRACT_RECOVER " Cof. wycof. +mm:"
280
-	#define MSG_CONTROL_RETRACT_RECOVERF " Cof. wycof.  F:"
281
-	#define MSG_AUTORETRACT " Auto. wycofanie:"
282
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Cos jest nie tak ze struktura menu."
264
+	#define MSG_CONTROL_RETRACT  "Wycofaj mm"
265
+	#define MSG_CONTROL_RETRACTF "Wycofaj  F"
266
+	#define MSG_CONTROL_RETRACT_ZLIFT "Skok Z mm:"
267
+	#define MSG_CONTROL_RETRACT_RECOVER "Cof. wycof. +mm"
268
+	#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof.  F"
269
+	#define MSG_AUTORETRACT "Auto. wycofanie"
283
 
270
 
284
 // Serial Console Messages
271
 // Serial Console Messages
285
 
272
 
439
 #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
426
 #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
440
 #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
427
 #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
441
 #define MSG_AUTORETRACT " Retract. Auto.:"
428
 #define MSG_AUTORETRACT " Retract. Auto.:"
442
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Erreur avec MenuStructure."
443
 
429
 
444
 // Serial Console Messages
430
 // Serial Console Messages
445
 
431
 
593
 	#define MSG_KILLED           "KILLED"
579
 	#define MSG_KILLED           "KILLED"
594
 	#define MSG_STOPPED          "GESTOPPT"
580
 	#define MSG_STOPPED          "GESTOPPT"
595
 	#define MSG_STEPPER_RELEASED "Stepper frei"
581
 	#define MSG_STEPPER_RELEASED "Stepper frei"
596
-        #define MSG_CONTROL_RETRACT  " Retract mm:"
597
-        #define MSG_CONTROL_RETRACTF " Retract  F:"
598
-        #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
599
-        #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
600
-        #define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
601
-        #define MSG_AUTORETRACT      " AutoRetr.:"
602
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in Menüstruktur."
582
+    #define MSG_CONTROL_RETRACT  " Retract mm:"
583
+    #define MSG_CONTROL_RETRACTF " Retract  F:"
584
+    #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
585
+    #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
586
+    #define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
587
+    #define MSG_AUTORETRACT      " AutoRetr.:"
603
 	
588
 	
604
 // Serial Console Messages
589
 // Serial Console Messages
605
 
590
 
758
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
743
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
759
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
744
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
760
 #define MSG_AUTORETRACT " AutoRetr.:"
745
 #define MSG_AUTORETRACT " AutoRetr.:"
761
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
762
 
746
 
763
 // Serial Console Messages
747
 // Serial Console Messages
764
 
748
 
915
 #define MSG_CONTROL_RETRACT_RECOVER			" Возврат +mm:"
899
 #define MSG_CONTROL_RETRACT_RECOVER			" Возврат +mm:"
916
 #define MSG_CONTROL_RETRACT_RECOVERF		" Возврат  F:"
900
 #define MSG_CONTROL_RETRACT_RECOVERF		" Возврат  F:"
917
 #define MSG_AUTORETRACT						" АвтоОткат:"
901
 #define MSG_AUTORETRACT						" АвтоОткат:"
918
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE		"Ошибка в структуре меню."
919
 
902
 
920
 // Serial Console Messages
903
 // Serial Console Messages
921
 
904
 

+ 795
- 2808
Marlin/ultralcd.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 10
- 100
Marlin/ultralcd.h Ver arquivo

4
 #include "Marlin.h"
4
 #include "Marlin.h"
5
 
5
 
6
 #ifdef ULTRA_LCD
6
 #ifdef ULTRA_LCD
7
-
8
-  #if LANGUAGE_CHOICE == 6
9
-  #include "LiquidCrystalRus.h"
10
-  #define LCD_CLASS LiquidCrystalRus
11
-  #else
12
-  #include <LiquidCrystal.h>
13
-  #define LCD_CLASS LiquidCrystal
14
-  #endif
15
 
7
 
16
   void lcd_update();
8
   void lcd_update();
17
   void lcd_init();
9
   void lcd_init();
18
   void lcd_setstatus(const char* message);
10
   void lcd_setstatus(const char* message);
19
   void lcd_setstatuspgm(const char* message);
11
   void lcd_setstatuspgm(const char* message);
20
   void lcd_setalertstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
21
-  void lcd_buttons_update();
22
-  void lcd_buttons_init();
13
+  void lcd_reset_alert_level();
23
 
14
 
24
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
15
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
25
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
16
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
27
   #define LCD_UPDATE_INTERVAL 100
18
   #define LCD_UPDATE_INTERVAL 100
28
   #define LCD_TIMEOUT_TO_STATUS 15000
19
   #define LCD_TIMEOUT_TO_STATUS 15000
29
 
20
 
21
+  #ifdef ULTIPANEL
22
+  void lcd_buttons_update();
30
   extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
23
   extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
24
+  #else
25
+  FORCE_INLINE void lcd_buttons_update() {}
26
+  #endif
31
 
27
 
32
   extern int plaPreheatHotendTemp;
28
   extern int plaPreheatHotendTemp;
33
   extern int plaPreheatHPBTemp;
29
   extern int plaPreheatHPBTemp;
43
     #define EN_A (1<<BLEN_A)
39
     #define EN_A (1<<BLEN_A)
44
 
40
 
45
     #define LCD_CLICKED (buttons&EN_C)
41
     #define LCD_CLICKED (buttons&EN_C)
46
-    #define LCD_BLOCK {blocking=millis()+blocktime;}
47
   #else
42
   #else
48
     //atomatic, do not change
43
     //atomatic, do not change
49
     #define B_LE (1<<BL_LE)
44
     #define B_LE (1<<BL_LE)
56
     #define EN_A (1<<BLEN_A)
51
     #define EN_A (1<<BLEN_A)
57
     
52
     
58
     #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
53
     #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
59
-    #define LCD_BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
60
-  #endif
54
+  #endif//NEWPANEL
61
 
55
 
62
-  // blocking time for recognizing a new keypress of one key, ms
63
-  #define blocktime 500
64
-  #define lcdslow 5
65
-    
66
-  enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl,Sub_RetractControl, Sub_PreheatPLASettings, Sub_PreheatABSSettings};
67
-  
68
-  extern LCD_CLASS lcd;
69
-  
70
-  class MainMenu{
71
-  public:
72
-    MainMenu();
73
-    void update();
74
-    int8_t activeline;
75
-    MainStatus status;
76
-    uint8_t displayStartingRow;
77
-    
78
-    void showStatus();
79
-    void showMainMenu();
80
-    void showPrepare();
81
-    void showTune();
82
-    void showControl();
83
-    void showControlMotion();
84
-    void showControlTemp();
85
-    void showControlRetract();
86
-    void showAxisMove();
87
-    void showSD();
88
-	void showPLAsettings();
89
-	void showABSsettings();
90
-    bool force_lcd_update;
91
-    long lastencoderpos;
92
-    int8_t lineoffset;
93
-    int8_t lastlineoffset;
94
-    
95
-    bool linechanging;
96
-    
97
-    bool tune;
98
-    
99
-  private:
100
-    FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile long &encoderpos)
101
-    {
102
-      if(linechanging) return; // an item is changint its value, do not switch lines hence
103
-      lastlineoffset=lineoffset; 
104
-      long curencoderpos=encoderpos;  
105
-      force_lcd_update=false;
106
-      if(  (abs(curencoderpos-lastencoderpos)<lcdslow) ) 
107
-      { 
108
-        lcd.setCursor(0,activeline);lcd.print((activeline+lineoffset)?' ':' '); 
109
-        if(curencoderpos<0)  
110
-        {  
111
-          lineoffset--; 
112
-          if(lineoffset<0) lineoffset=0; 
113
-          curencoderpos=lcdslow-1;
114
-        } 
115
-        if(curencoderpos>(LCD_HEIGHT-1+1)*lcdslow) 
116
-        { 
117
-          lineoffset++; 
118
-          curencoderpos=(LCD_HEIGHT-1)*lcdslow; 
119
-          if(lineoffset>(maxlines+1-LCD_HEIGHT)) 
120
-            lineoffset=maxlines+1-LCD_HEIGHT; 
121
-          if(curencoderpos>maxlines*lcdslow) 
122
-            curencoderpos=maxlines*lcdslow; 
123
-        } 
124
-        lastencoderpos=encoderpos=curencoderpos;
125
-        activeline=curencoderpos/lcdslow;
126
-        if(activeline<0) activeline=0;
127
-        if(activeline>LCD_HEIGHT-1) activeline=LCD_HEIGHT-1;
128
-        if(activeline>maxlines) 
129
-        {
130
-          activeline=maxlines;
131
-          curencoderpos=maxlines*lcdslow;
132
-        }
133
-        if(lastlineoffset!=lineoffset)
134
-          force_lcd_update=true;
135
-        lcd.setCursor(0,activeline);lcd.print((activeline+lineoffset)?'>':'\003');    
136
-      } 
137
-    }
138
-    
139
-    FORCE_INLINE void clearIfNecessary()
140
-    {
141
-      if(lastlineoffset!=lineoffset ||force_lcd_update)
142
-      {
143
-        force_lcd_update=true;
144
-         lcd.clear();
145
-      } 
146
-    }
147
-  };
148
 #else //no lcd
56
 #else //no lcd
149
   FORCE_INLINE void lcd_update() {}
57
   FORCE_INLINE void lcd_update() {}
150
   FORCE_INLINE void lcd_init() {}
58
   FORCE_INLINE void lcd_init() {}
151
   FORCE_INLINE void lcd_setstatus(const char* message) {}
59
   FORCE_INLINE void lcd_setstatus(const char* message) {}
152
-  FORCE_INLINE void lcd_buttons_init() {}
153
   FORCE_INLINE void lcd_buttons_update() {}
60
   FORCE_INLINE void lcd_buttons_update() {}
61
+  FORCE_INLINE void lcd_reset_alert_level() {}
154
 
62
 
155
   #define LCD_MESSAGEPGM(x) 
63
   #define LCD_MESSAGEPGM(x) 
156
   #define LCD_ALERTMESSAGEPGM(x) 
64
   #define LCD_ALERTMESSAGEPGM(x) 
162
 char *itostr2(const uint8_t &x);
70
 char *itostr2(const uint8_t &x);
163
 char *itostr31(const int &xx);
71
 char *itostr31(const int &xx);
164
 char *itostr3(const int &xx);
72
 char *itostr3(const int &xx);
73
+char *itostr3left(const int &xx);
165
 char *itostr4(const int &xx);
74
 char *itostr4(const int &xx);
166
 
75
 
167
 char *ftostr3(const float &x);
76
 char *ftostr3(const float &x);
168
 char *ftostr31(const float &x);
77
 char *ftostr31(const float &x);
169
 char *ftostr32(const float &x);
78
 char *ftostr32(const float &x);
79
+char *ftostr5(const float &x);
170
 char *ftostr51(const float &x);
80
 char *ftostr51(const float &x);
171
 char *ftostr52(const float &x);
81
 char *ftostr52(const float &x);
172
 
82
 

+ 461
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Ver arquivo

1
+#ifndef ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H
2
+#define ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H
3
+
4
+/**
5
+* Implementation of the LCD display routines for a hitachi HD44780 display. These are common LCD character displays.
6
+* When selecting the rusian language, a slightly different LCD implementation is used to handle UTF8 characters.
7
+**/
8
+
9
+#if LANGUAGE_CHOICE == 6
10
+#include "LiquidCrystalRus.h"
11
+#define LCD_CLASS LiquidCrystalRus
12
+#else
13
+#include <LiquidCrystal.h>
14
+#define LCD_CLASS LiquidCrystal
15
+#endif
16
+
17
+/* Custom characters defined in the first 8 characters of the LCD */
18
+#define LCD_STR_BEDTEMP     "\x00"
19
+#define LCD_STR_DEGREE      "\x01"
20
+#define LCD_STR_THERMOMETER "\x02"
21
+#define LCD_STR_UPLEVEL     "\x03"
22
+#define LCD_STR_REFRESH     "\x04"
23
+#define LCD_STR_FOLDER      "\x05"
24
+#define LCD_STR_FEEDRATE    "\x06"
25
+#define LCD_STR_CLOCK       "\x07"
26
+#define LCD_STR_ARROW_RIGHT "\x7E"  /* from the default character set */
27
+
28
+LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7
29
+static void lcd_implementation_init()
30
+{
31
+    byte bedTemp[8] =
32
+    {
33
+        B00000,
34
+        B11111,
35
+        B10101,
36
+        B10001,
37
+        B10101,
38
+        B11111,
39
+        B00000,
40
+        B00000
41
+    }; //thanks Sonny Mounicou
42
+    byte degree[8] =
43
+    {
44
+        B01100,
45
+        B10010,
46
+        B10010,
47
+        B01100,
48
+        B00000,
49
+        B00000,
50
+        B00000,
51
+        B00000
52
+    };
53
+    byte thermometer[8] =
54
+    {
55
+        B00100,
56
+        B01010,
57
+        B01010,
58
+        B01010,
59
+        B01010,
60
+        B10001,
61
+        B10001,
62
+        B01110
63
+    };
64
+    byte uplevel[8]={
65
+        B00100,
66
+        B01110,
67
+        B11111,
68
+        B00100,
69
+        B11100,
70
+        B00000,
71
+        B00000,
72
+        B00000
73
+    }; //thanks joris
74
+    byte refresh[8]={
75
+        B00000,
76
+        B00110,
77
+        B11001,
78
+        B11000,
79
+        B00011,
80
+        B10011,
81
+        B01100,
82
+        B00000,
83
+    }; //thanks joris
84
+    byte folder [8]={
85
+        B00000,
86
+        B11100,
87
+        B11111,
88
+        B10001,
89
+        B10001,
90
+        B11111,
91
+        B00000,
92
+        B00000
93
+    }; //thanks joris
94
+    byte feedrate [8]={
95
+        B11100,
96
+        B10000,
97
+        B11000,
98
+        B10111,
99
+        B00101,
100
+        B00110,
101
+        B00101,
102
+        B00000
103
+    }; //thanks Sonny Mounicou
104
+    byte clock [8]={
105
+        B00000,
106
+        B01110,
107
+        B10011,
108
+        B10101,
109
+        B10001,
110
+        B01110,
111
+        B00000,
112
+        B00000
113
+    }; //thanks Sonny Mounicou
114
+    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
115
+    lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
116
+    lcd.createChar(LCD_STR_DEGREE[0], degree);
117
+    lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
118
+    lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
119
+    lcd.createChar(LCD_STR_REFRESH[0], refresh);
120
+    lcd.createChar(LCD_STR_FOLDER[0], folder);
121
+    lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
122
+    lcd.createChar(LCD_STR_CLOCK[0], clock);
123
+    lcd.clear();
124
+}
125
+static void lcd_implementation_clear()
126
+{
127
+    lcd.clear();
128
+}
129
+/*
130
+Possible status screens:
131
+16x2   |0123456789012345|
132
+       |000/000 B000/000|
133
+       |Status line.....|
134
+
135
+16x4   |0123456789012345|
136
+       |000/000 B000/000|
137
+       |SD100%    Z000.0|
138
+       |F100%     T--:--|
139
+       |Status line.....|
140
+
141
+20x2   |01234567890123456789|
142
+       |T000/000D B000/000D |
143
+       |Status line.........|
144
+
145
+20x4   |01234567890123456789|
146
+       |T000/000D B000/000D |
147
+       |X+000.0 Y+000.0 Z+000.0|
148
+       |F100%  SD100% T--:--|
149
+       |Status line.........|
150
+
151
+20x4   |01234567890123456789|
152
+       |T000/000D B000/000D |
153
+       |T000/000D     Z000.0|
154
+       |F100%  SD100% T--:--|
155
+       |Status line.........|
156
+*/
157
+static void lcd_implementation_status_screen()
158
+{
159
+    int tHotend=int(degHotend(0) + 0.5);
160
+    int tTarget=int(degTargetHotend(0) + 0.5);
161
+
162
+#if LCD_WIDTH < 20
163
+    lcd.setCursor(0, 0);
164
+    lcd.print(itostr3(tHotend));
165
+    lcd.print('/');
166
+    lcd.print(itostr3left(tTarget));
167
+
168
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
169
+    //If we have an 2nd extruder or heated bed, show that in the top right corner
170
+    lcd.setCursor(8, 0);
171
+#  if EXTRUDERS > 1
172
+    tHotend = int(degHotend(1) + 0.5);
173
+    tTarget = int(degTargetHotend(1) + 0.5);
174
+    lcd.print(LCD_STR_THERMOMETER[0]);
175
+#  else//Heated bed
176
+    tHotend=int(degBed() + 0.5);
177
+    tTarget=int(degTargetBed() + 0.5);
178
+    lcd.print(LCD_STR_BEDTEMP[0]);
179
+#  endif
180
+    lcd.print(itostr3(tHotend));
181
+    lcd.print('/');
182
+    lcd.print(itostr3left(tTarget));
183
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
184
+
185
+#else//LCD_WIDTH > 19
186
+    lcd.setCursor(0, 0);
187
+    lcd.print(LCD_STR_THERMOMETER[0]);
188
+    lcd.print(itostr3(tHotend));
189
+    lcd.print('/');
190
+    lcd.print(itostr3left(tTarget));
191
+    lcd.print(F(LCD_STR_DEGREE " "));
192
+
193
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
194
+    //If we have an 2nd extruder or heated bed, show that in the top right corner
195
+    lcd.setCursor(10, 0);
196
+#  if EXTRUDERS > 1
197
+    tHotend = int(degHotend(1) + 0.5);
198
+    tTarget = int(degTargetHotend(1) + 0.5);
199
+    lcd.print(LCD_STR_THERMOMETER[0]);
200
+#  else//Heated bed
201
+    tHotend=int(degBed() + 0.5);
202
+    tTarget=int(degTargetBed() + 0.5);
203
+    lcd.print(LCD_STR_BEDTEMP[0]);
204
+#  endif
205
+    lcd.print(itostr3(tHotend));
206
+    lcd.print('/');
207
+    lcd.print(itostr3left(tTarget));
208
+    lcd.print(F(LCD_STR_DEGREE " "));
209
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
210
+#endif//LCD_WIDTH > 19
211
+
212
+#if LCD_HEIGHT > 2
213
+//Lines 2 for 4 line LCD
214
+# if LCD_WIDTH < 20
215
+#  ifdef SDSUPPORT
216
+    lcd.setCursor(0, 2);
217
+    lcd.print(F("SD"));
218
+    if (IS_SD_PRINTING)
219
+        lcd.print(itostr3(card.percentDone()));
220
+    else
221
+        lcd.print(F("---"));
222
+    lcd.print('%');
223
+#  endif//SDSUPPORT
224
+# else//LCD_WIDTH > 19
225
+#  if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
226
+    //If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
227
+    tHotend=int(degBed() + 0.5);
228
+    tTarget=int(degTargetBed() + 0.5);
229
+
230
+    lcd.setCursor(0, 1);
231
+    lcd.print(LCD_STR_BEDTEMP[0]);
232
+    lcd.print(itostr3(tHotend));
233
+    lcd.print('/');
234
+    lcd.print(itostr3left(tTarget));
235
+    lcd.print(F(LCD_STR_DEGREE " "));
236
+#  else
237
+    lcd.setCursor(0,1);
238
+    lcd.print('X');
239
+    lcd.print(ftostr3(current_position[X_AXIS]));
240
+    lcd.print(F(" Y"));
241
+    lcd.print(ftostr3(current_position[Y_AXIS]));
242
+#  endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
243
+# endif//LCD_WIDTH > 19
244
+    lcd.setCursor(LCD_WIDTH - 7, 1);
245
+    lcd.print('Z');
246
+    lcd.print(ftostr31(current_position[Z_AXIS]));
247
+#endif//LCD_HEIGHT > 2
248
+
249
+#if LCD_HEIGHT > 3
250
+    lcd.setCursor(0, 2);
251
+    lcd.print(LCD_STR_FEEDRATE[0]);
252
+    lcd.print(itostr3(feedmultiply));
253
+    lcd.print(F("%"));
254
+# if LCD_WIDTH > 19
255
+#  ifdef SDSUPPORT
256
+    lcd.setCursor(7, 2);
257
+    lcd.print(F("SD"));
258
+    if (IS_SD_PRINTING)
259
+        lcd.print(itostr3(card.percentDone()));
260
+    else
261
+        lcd.print(F("---"));
262
+    lcd.print(F("%"));
263
+#  endif//SDSUPPORT
264
+# endif//LCD_WIDTH > 19
265
+    lcd.setCursor(LCD_WIDTH - 6, 2);
266
+    lcd.print(LCD_STR_CLOCK[0]);
267
+    if(starttime != 0)
268
+    {
269
+        uint16_t time = millis()/60000 - starttime/60000;
270
+        lcd.print(itostr2(time/60));
271
+        lcd.print(F(":"));
272
+        lcd.print(itostr2(time%60));
273
+    }else{
274
+        lcd.print(F("--:--"));
275
+    }
276
+#endif
277
+
278
+    //Status message line on the last line
279
+    lcd.setCursor(0, LCD_HEIGHT - 1);
280
+    lcd.print(lcd_status_message);
281
+}
282
+static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char)
283
+{
284
+    char c;
285
+    uint8_t n = LCD_WIDTH - 1 - 2;
286
+    lcd.setCursor(0, row);
287
+    lcd.print(pre_char);
288
+    while((c = pgm_read_byte(pstr)) != '\0')
289
+    {
290
+        lcd.print(c);
291
+        pstr++;
292
+        n--;
293
+    }
294
+    while(n--)
295
+        lcd.print(' ');
296
+    lcd.print(post_char);
297
+    lcd.print(' ');
298
+}
299
+static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, char* data)
300
+{
301
+    char c;
302
+    uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data);
303
+    lcd.setCursor(0, row);
304
+    lcd.print(pre_char);
305
+    while((c = pgm_read_byte(pstr)) != '\0')
306
+    {
307
+        lcd.print(c);
308
+        pstr++;
309
+        n--;
310
+    }
311
+    lcd.print(':');
312
+    while(n--)
313
+        lcd.print(' ');
314
+    lcd.print(data);
315
+}
316
+static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, const char* pstr, char pre_char, const char* data)
317
+{
318
+    char c;
319
+    uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data);
320
+    lcd.setCursor(0, row);
321
+    lcd.print(pre_char);
322
+    while((c = pgm_read_byte(pstr)) != '\0')
323
+    {
324
+        lcd.print(c);
325
+        pstr++;
326
+        n--;
327
+    }
328
+    lcd.print(':');
329
+    while(n--)
330
+        lcd.print(' ');
331
+    lcd.print(reinterpret_cast<const __FlashStringHelper *>(data));
332
+}
333
+#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
334
+#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
335
+#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
336
+#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
337
+#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
338
+#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
339
+#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
340
+#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
341
+#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
342
+#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
343
+#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
344
+#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
345
+#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
346
+#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
347
+#define lcd_implementation_drawmenu_setting_edit_bool_selected(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
348
+#define lcd_implementation_drawmenu_setting_edit_bool(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
349
+void lcd_implementation_drawedit(const char* pstr, char* value)
350
+{
351
+    lcd.setCursor(0, 1);
352
+    lcd.print(reinterpret_cast<const __FlashStringHelper *>(pstr));
353
+    lcd.print(':');
354
+    lcd.setCursor(19 - strlen(value), 1);
355
+    lcd.print(value);
356
+}
357
+static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
358
+{
359
+    char c;
360
+    uint8_t n = LCD_WIDTH - 1;
361
+    lcd.setCursor(0, row);
362
+    lcd.print('>');
363
+    if (longFilename[0] != '\0')
364
+    {
365
+        filename = longFilename;
366
+        longFilename[LCD_WIDTH-1] = '\0';
367
+    }
368
+    while((c = *filename) != '\0')
369
+    {
370
+        lcd.print(c);
371
+        filename++;
372
+        n--;
373
+    }
374
+    while(n--)
375
+        lcd.print(' ');
376
+}
377
+static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
378
+{
379
+    char c;
380
+    uint8_t n = LCD_WIDTH - 1;
381
+    lcd.setCursor(0, row);
382
+    lcd.print(' ');
383
+    if (longFilename[0] != '\0')
384
+    {
385
+        filename = longFilename;
386
+        longFilename[LCD_WIDTH-1] = '\0';
387
+    }
388
+    while((c = *filename) != '\0')
389
+    {
390
+        lcd.print(c);
391
+        filename++;
392
+        n--;
393
+    }
394
+    while(n--)
395
+        lcd.print(' ');
396
+}
397
+static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
398
+{
399
+    char c;
400
+    uint8_t n = LCD_WIDTH - 2;
401
+    lcd.setCursor(0, row);
402
+    lcd.print('>');
403
+    lcd.print(LCD_STR_FOLDER[0]);
404
+    if (longFilename[0] != '\0')
405
+    {
406
+        filename = longFilename;
407
+        longFilename[LCD_WIDTH-2] = '\0';
408
+    }
409
+    while((c = *filename) != '\0')
410
+    {
411
+        lcd.print(c);
412
+        filename++;
413
+        n--;
414
+    }
415
+    while(n--)
416
+        lcd.print(' ');
417
+}
418
+static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
419
+{
420
+    char c;
421
+    uint8_t n = LCD_WIDTH - 2;
422
+    lcd.setCursor(0, row);
423
+    lcd.print(' ');
424
+    lcd.print(LCD_STR_FOLDER[0]);
425
+    if (longFilename[0] != '\0')
426
+    {
427
+        filename = longFilename;
428
+        longFilename[LCD_WIDTH-2] = '\0';
429
+    }
430
+    while((c = *filename) != '\0')
431
+    {
432
+        lcd.print(c);
433
+        filename++;
434
+        n--;
435
+    }
436
+    while(n--)
437
+        lcd.print(' ');
438
+}
439
+#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
440
+#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
441
+#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
442
+#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
443
+#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
444
+#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
445
+#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
446
+#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
447
+
448
+static void lcd_implementation_quick_feedback()
449
+{
450
+#if BEEPER > -1
451
+    SET_OUTPUT(BEEPER);
452
+    for(int8_t i=0;i<10;i++)
453
+    {
454
+		WRITE(BEEPER,HIGH);
455
+		delay(3);
456
+		WRITE(BEEPER,LOW);
457
+		delay(3);
458
+    }
459
+#endif
460
+}
461
+#endif//ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H

Carregando…
Cancelar
Salvar