From 69961dbba32c3a8f9638507d4e5c9724ba50e332 Mon Sep 17 00:00:00 2001 From: stohn Date: Tue, 21 Aug 2012 14:44:20 +0200 Subject: [PATCH 1/4] fixed incorrect menu messages from last commit... - removed several multiple definitions of same message - fixed definition of missing messages in german and spanish - tweaked german translation (a lot) - added note about changing and testing this file --- Marlin/language.h | 187 ++++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 89 deletions(-) diff --git a/Marlin/language.h b/Marlin/language.h index 99c675145..8ace273ec 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -1,11 +1,16 @@ #ifndef LANGUAGE_H #define LANGUAGE_H +// NOTE: IF YOU CHANGE THIS FILE / MERGE THIS FILE WITH CHANGES +// +// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" +// ==> ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS + // Languages -// 1 Custom (For you to add your own messages) -// 2 English +// 1 English +// 2 - // 3 French (Waiting translation) -// 4 German (Waiting translation) +// 4 German // 5 Spanish // 6 Etc @@ -37,7 +42,7 @@ #define MSG_SET_ORIGIN " Set Origin" #define MSG_COOLDOWN " Cooldown" #define MSG_EXTRUDE " Extrude" - #define MSG_RETRACT " Extract" + #define MSG_RETRACT " Retract" #define MSG_PREHEAT_PLA " Preheat PLA" #define MSG_PREHEAT_ABS " Preheat ABS" #define MSG_MOVE_AXIS " Move Axis \x7E" @@ -86,29 +91,27 @@ #define MSG_PREPARE " Prepare \x7E" #define MSG_PREPARE_ALT " Prepare \003" #define MSG_CONTROL_ARROW " Control \x7E" - #define MSG_RETRACT_ARROW " Control \x7E" + #define MSG_RETRACT_ARROW " Retract \x7E" #define MSG_TUNE " Tune \x7E" #define MSG_PAUSE_PRINT " Pause Print \x7E" #define MSG_RESUME_PRINT " Resume Print \x7E" #define MSG_STOP_PRINT " Stop Print \x7E" #define MSG_CARD_MENU " Card Menu \x7E" #define MSG_NO_CARD " No Card" - #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure." #define MSG_DWELL "Sleep..." #define MSG_USERWAIT "Wait for user..." #define MSG_NO_MOVE "No move." #define MSG_PART_RELEASE "Partial Release" #define MSG_KILLED "KILLED. " #define MSG_STOPPED "STOPPED. " - #define MSG_PREHEAT_PLA " Preheat PLA" - #define MSG_PREHEAT_ABS " Preheat ABS" #define MSG_STEPPER_RELEASED "Released." - #define MSG_CONTROL_RETRACT " Retract mm:" - #define MSG_CONTROL_RETRACTF " Retract F:" - #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:" - #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:" - #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:" - #define MSG_AUTORETRACT " AutoRetr.:" + #define MSG_CONTROL_RETRACT " Retract mm:" + #define MSG_CONTROL_RETRACTF " Retract F:" + #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:" + #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:" + #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:" + #define MSG_AUTORETRACT " AutoRetr.:" + #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure." // Serial Console Messages @@ -181,84 +184,87 @@ // LCD Menu Messages - #define WELCOME_MSG MACHINE_NAME " Ready." + #define WELCOME_MSG MACHINE_NAME " Bereit." - #define MSG_SD_INSERTED "Card inserted" - #define MSG_SD_REMOVED "Card removed" - #define MSG_MAIN " Main \003" - #define MSG_AUTOSTART " Autostart" + #define MSG_SD_INSERTED "SDKarte erkannt" + #define MSG_SD_REMOVED "SDKarte entfernt" + #define MSG_MAIN " Hauptmneü \003" + #define MSG_AUTOSTART " Autostart" #define MSG_DISABLE_STEPPERS " Stepper abschalten" - #define MSG_AUTO_HOME " Auto Heim" - #define MSG_SET_ORIGIN " Position setzen" - #define MSG_PREHEAT_PLA " Aufheizen PLA" - #define MSG_PREHEAT_ABS " Aufheizen ABS" - #define MSG_COOLDOWN " Abkuehlen" - #define MSG_EXTRUDE " Extrude" - #define MSG_PREHEAT_PLA " Preheat PLA" - #define MSG_PREHEAT_ABS " Preheat ABS" - #define MSG_MOVE_AXIS " Move Axis \x7E" - #define MSG_MOVE_AXIS " Achsen verfahren \x7E" - #define MSG_SPEED " Geschw:" - #define MSG_NOZZLE " \002Duese:" - #define MSG_NOZZLE1 " \002Duese2:" - #define MSG_NOZZLE2 " \002Duese3:" - #define MSG_BED " \002Bett:" - #define MSG_FAN_SPEED " Luefter geschw.:" - #define MSG_FLOW " Fluss:" - #define MSG_CONTROL " Kontrolle \003" - #define MSG_MIN " \002 Min:" - #define MSG_MAX " \002 Max:" - #define MSG_FACTOR " \002 Faktor:" - #define MSG_AUTOTEMP " AutoTemp:" - #define MSG_ON "Ein " - #define MSG_OFF "Aus " - #define MSG_PID_P " PID-P: " - #define MSG_PID_I " PID-I: " - #define MSG_PID_D " PID-D: " - #define MSG_PID_C " PID-C: " - #define MSG_ACC " Acc:" - #define MSG_VXY_JERK " Vxy-jerk: " - #define MSG_VMAX " Vmax " - #define MSG_X "x:" - #define MSG_Y "y:" - #define MSG_Z "z:" - #define MSG_E "e:" - #define MSG_VMIN " Vmin:" - #define MSG_VTRAV_MIN " VTrav min:" - #define MSG_AMAX " Amax " - #define MSG_A_RETRACT " A-retract:" - #define MSG_XSTEPS " Xsteps/mm:" - #define MSG_YSTEPS " Ysteps/mm:" - #define MSG_ZSTEPS " Zsteps/mm:" - #define MSG_ESTEPS " Esteps/mm:" - #define MSG_MAIN_WIDE " Main \003" - #define MSG_TEMPERATURE_WIDE " Temperatur \x7E" - #define MSG_MOTION_WIDE " Motion \x7E" - #define MSG_STORE_EPROM " EPROM speichern" - #define MSG_LOAD_EPROM " EPROM laden" - #define MSG_RESTORE_FAILSAFE " Standard Konfig." - #define MSG_REFRESH "\004Refresh" - #define MSG_WATCH " Beobachten \003" - #define MSG_PREPARE " Prepare \x7E" - #define MSG_PREPARE_ALT " Prepare \003" - #define MSG_CONTROL_ARROW " Control \x7E" + #define MSG_AUTO_HOME " Auto Nullpunkt" + #define MSG_SET_ORIGIN " Setze Nullpunkt" + #define MSG_PREHEAT_PLA " Vorwärmen PLA" + #define MSG_PREHEAT_ABS " Vorwärmen ABS" + #define MSG_COOLDOWN " Abkühlen" + #define MSG_EXTRUDE " Extrude" + #define MSG_RETRACT " Retract" + #define MSG_MOVE_AXIS " Achsen bewegen\x7E" + #define MSG_SPEED " Geschw:" + #define MSG_NOZZLE " \002Düse:" + #define MSG_NOZZLE1 " \002Düse2:" + #define MSG_NOZZLE2 " \002Düse3:" + #define MSG_BED " \002Bett:" + #define MSG_FAN_SPEED " Lüftergeschw.:" + #define MSG_FLOW " Fluß:" + #define MSG_CONTROL " Einstellungen \003" + #define MSG_MIN " \002 Min:" + #define MSG_MAX " \002 Max:" + #define MSG_FACTOR " \002 Faktor:" + #define MSG_AUTOTEMP " AutoTemp:" + #define MSG_ON "Ein " + #define MSG_OFF "Aus " + #define MSG_PID_P " PID-P: " + #define MSG_PID_I " PID-I: " + #define MSG_PID_D " PID-D: " + #define MSG_PID_C " PID-C: " + #define MSG_ACC " Acc:" + #define MSG_VXY_JERK " Vxy-jerk: " + #define MSG_VMAX " Vmax " + #define MSG_X "x:" + #define MSG_Y "y:" + #define MSG_Z "z:" + #define MSG_E "e:" + #define MSG_VMIN " Vmin:" + #define MSG_VTRAV_MIN " VTrav min:" + #define MSG_AMAX " Amax " + #define MSG_A_RETRACT " A-Retract:" + #define MSG_XSTEPS " Xsteps/mm:" + #define MSG_YSTEPS " Ysteps/mm:" + #define MSG_ZSTEPS " Zsteps/mm:" + #define MSG_ESTEPS " Esteps/mm:" + #define MSG_MAIN_WIDE " Hauptmenü \003" + #define MSG_RECTRACT_WIDE " Rectract \x7E" + #define MSG_WATCH " Beobachten \003" + #define MSG_TEMPERATURE_WIDE " Temperatur \x7E" + #define MSG_MOTION_WIDE " Bewegung \x7E" + #define MSG_STORE_EPROM " EPROM speichern" + #define MSG_LOAD_EPROM " EPROM laden" + #define MSG_RESTORE_FAILSAFE " Standardkonfig." + #define MSG_REFRESH "\004Aktualisieren" + #define MSG_PREPARE " Vorbereitung \x7E" + #define MSG_PREPARE_ALT " Vorbereitung \003" + #define MSG_CONTROL_ARROW " Einstellungen \x7E" + #define MSG_TUNE " Justierung \x7E" + #define MSG_PAUSE_PRINT " Druck anhalten\x7E" + #define MSG_RESUME_PRINT " Druck fortsetz\x7E" + #define MSG_STOP_PRINT " Druck stoppen \x7E" + #define MSG_CARD_MENU " SDKarten Menü \x7E" + #define MSG_NO_CARD " Keine SDKarte" + #define MSG_DWELL "Warten..." + #define MSG_USERWAIT "Warte auf Nutzer..." + #define MSG_NO_MOVE "Kein Zug." + #define MSG_PART_RELEASE "Stepper tlw frei" + #define MSG_KILLED "KILLED" + #define MSG_STOPPED "GESTOPPT" + #define MSG_STEPPER_RELEASED "Stepper frei" + #define MSG_CONTROL_RETRACT " Retract mm:" + #define MSG_CONTROL_RETRACTF " Retract F:" + #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:" + #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:" + #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:" + #define MSG_AUTORETRACT " AutoRetr.:" + #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in Menüstruktur." - #define MSG_TUNE " Tune \x7E" - #define MSG_STOP_PRINT " Druck stoppen \x7E" - #define MSG_CARD_MENU " SDKarten Menue \x7E" - #define MSG_NO_CARD " Keine SDKarte" - #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in der Menuestruktur." - #define MSG_DWELL "DWELL..." - #define MSG_NO_MOVE "No move." - #define MSG_PART_RELEASE "Partial Release" - #define MSG_KILLED "KILLED. " - #define MSG_STOPPED "STOPPED. " - #define MSG_PREHEAT_PLA " Preheat PLA" - #define MSG_PREHEAT_ABS " Preheat ABS" - #define MSG_STEPPER_RELEASED "Released." - - - // Serial Console Messages #define MSG_Enqueing "enqueing \"" @@ -340,6 +346,7 @@ #define MSG_SET_ORIGIN " Establecer Cero" #define MSG_COOLDOWN " Enfriar" #define MSG_EXTRUDE " Extruir" +#define MSG_RETRACT " Retract" #define MSG_PREHEAT_PLA " Precalentar PLA" #define MSG_PREHEAT_ABS " Precalentar ABS" #define MSG_MOVE_AXIS " Mover Ejes \x7E" @@ -390,6 +397,8 @@ #define MSG_CONTROL_ARROW " Control \x7E" #define MSG_RETRACT_ARROW " Control \x7E" #define MSG_TUNE " Ajustar \x7E" +#define MSG_PAUSE_PRINT " Pause Print \x7E" +#define MSG_RESUME_PRINT " Resume Print \x7E" #define MSG_STOP_PRINT " Detener Impresion \x7E" #define MSG_CARD_MENU " Menu de SD \x7E" #define MSG_NO_CARD " No hay Tarjeta SD" From de0448343f198369f018ed370d357364b9bd81f6 Mon Sep 17 00:00:00 2001 From: stohn Date: Tue, 21 Aug 2012 14:48:29 +0200 Subject: [PATCH 2/4] added KILL_PIN support / cleaned up manage_inactivity function definition --- Marlin/Marlin.h | 2 +- Marlin/Marlin.pde | 46 +++++++++++++++++++++++++++++----------------- Marlin/planner.cpp | 2 +- Marlin/stepper.cpp | 2 +- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 937fabb36..5b59885cd 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -107,7 +107,7 @@ FORCE_INLINE void serialprintPGM(const char *str) void get_command(); void process_commands(); -void manage_inactivity(byte debug); +void manage_inactivity(); #if X_ENABLE_PIN > -1 #define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index f48a41921..d46a5a62f 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -245,6 +245,14 @@ void enquecommand(const char *cmd) } } +void setup_killpin() +{ + #if( KILL_PIN>-1 ) + pinMode(KILL_PIN,INPUT); + WRITE(KILL_PIN,HIGH); + #endif +} + void setup_photpin() { #ifdef PHOTOGRAPH_PIN @@ -276,7 +284,8 @@ void suicide() } void setup() -{ +{ + setup_killpin(); setup_powerhold(); MYSERIAL.begin(BAUDRATE); SERIAL_PROTOCOLLNPGM("start"); @@ -365,7 +374,7 @@ void loop() } //check heater every n milliseconds manage_heater(); - manage_inactivity(1); + manage_inactivity(); checkHitEndstops(); LCD_STATUS; } @@ -653,8 +662,8 @@ void process_commands() previous_millis_cmd = millis(); while(millis() < codenum ){ manage_heater(); - manage_inactivity(1); - LCD_STATUS; + manage_inactivity(); + LCD_STATUS; } break; #ifdef FWRETRACT @@ -816,21 +825,20 @@ void process_commands() st_synchronize(); previous_millis_cmd = millis(); - if (codenum > 0) - { + if (codenum > 0){ codenum += millis(); // keep track of when we started waiting while(millis() < codenum && !CLICKED){ manage_heater(); - manage_inactivity(1); - LCD_STATUS; - } + manage_inactivity(); + LCD_STATUS; + } }else{ - while(!CLICKED) { + while(!CLICKED){ manage_heater(); - manage_inactivity(1); - LCD_STATUS; - } - } + manage_inactivity(); + LCD_STATUS; + } + } } break; #endif @@ -1064,7 +1072,7 @@ void process_commands() codenum = millis(); } manage_heater(); - manage_inactivity(1); + manage_inactivity(); LCD_STATUS; #ifdef TEMP_RESIDENCY_TIME /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time @@ -1102,7 +1110,7 @@ void process_commands() codenum = millis(); } manage_heater(); - manage_inactivity(1); + manage_inactivity(); LCD_STATUS; } LCD_MESSAGEPGM(MSG_BED_DONE); @@ -1664,7 +1672,7 @@ void controllerFan() } #endif -void manage_inactivity(byte debug) +void manage_inactivity() { if( (millis() - previous_millis_cmd) > max_inactive_time ) if(max_inactive_time) @@ -1682,6 +1690,10 @@ void manage_inactivity(byte debug) } } } + #if( KILL_PIN>-1 ) + if( 0 == READ(KILL_PIN) ) + kill(); + #endif #ifdef CONTROLLERFAN_PIN controllerFan(); //Check if fan should be turned on to cool stepper drivers down #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 93bd8225a..6c47e298d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -501,7 +501,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa // Rest here until there is room in the buffer. while(block_buffer_tail == next_buffer_head) { manage_heater(); - manage_inactivity(1); + manage_inactivity(); LCD_STATUS; } diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index a222f154a..d5c8164b7 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -899,7 +899,7 @@ void st_synchronize() { while( blocks_queued()) { manage_heater(); - manage_inactivity(1); + manage_inactivity(); LCD_STATUS; } } From 31873ec707d5ba19de59b046cb1e882b8bd4e1db Mon Sep 17 00:00:00 2001 From: stohn Date: Tue, 21 Aug 2012 16:47:39 +0200 Subject: [PATCH 3/4] changed int to long to overcome overflow of number display - related bug reports: Issue #201, Issue #213 --- Marlin/ultralcd.pde | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 98d9f4bc8..5663dda80 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -2621,7 +2621,7 @@ char *ftostr31(const float &x) char *ftostr32(const float &x) { - int xx=x*100; + long xx=x*100; conv[0]=(xx>=0)?'+':'-'; xx=abs(xx); conv[1]=(xx/100)%10+'0'; @@ -2666,7 +2666,7 @@ char *itostr4(const int &xx) // convert float to string with +1234.5 format char *ftostr51(const float &x) { - int xx=x*10; + long xx=x*10; conv[0]=(xx>=0)?'+':'-'; xx=abs(xx); conv[1]=(xx/10000)%10+'0'; @@ -2682,7 +2682,7 @@ char *ftostr51(const float &x) // convert float to string with +123.45 format char *ftostr52(const float &x) { - int xx=x*100; + long xx=x*100; conv[0]=(xx>=0)?'+':'-'; xx=abs(xx); conv[1]=(xx/10000)%10+'0'; From 06c03fe2f0947723a9013b636a6751b1a7c5af1a Mon Sep 17 00:00:00 2001 From: stohn Date: Wed, 22 Aug 2012 12:44:41 +0200 Subject: [PATCH 4/4] new method for message for making KILLED message visible The cli(); at the start of the kill() function also stops the internal arduino timer which stops updating of millis() which prevents the display of the "KILLED." message. The new function updates the display directly without checking any timers. --- Marlin/Marlin.pde | 2 +- Marlin/ultralcd.h | 3 +++ Marlin/ultralcd.pde | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index d46a5a62f..a7b637b89 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -1734,7 +1734,7 @@ void kill() if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT); SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - LCD_MESSAGEPGM(MSG_KILLED); + LCD_ALERTMESSAGEPGM(MSG_KILLED); suicide(); while(1); // Wait for reset } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index dc44d1cda..5cfa6a543 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -140,12 +140,14 @@ #define LCD_INIT lcd_init(); #define LCD_MESSAGE(x) lcd_status(x); #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x)); + #define LCD_ALERTMESSAGEPGM(x) lcd_alertstatuspgm(MYPGM(x)); #define LCD_STATUS lcd_status() #else //no lcd #define LCD_INIT #define LCD_STATUS #define LCD_MESSAGE(x) #define LCD_MESSAGEPGM(x) + #define LCD_ALERTMESSAGEPGM(x) FORCE_INLINE void lcd_status() {}; #define CLICKED false @@ -153,6 +155,7 @@ #endif void lcd_statuspgm(const char* message); +void lcd_alertstatuspgm(const char* message); char *ftostr3(const float &x); char *itostr2(const uint8_t &x); diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 5663dda80..becdf4677 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -92,6 +92,12 @@ void lcd_statuspgm(const char* message) *target=0; } +void lcd_alertstatuspgm(const char* message) +{ + lcd_statuspgm(message); + menu.showStatus(); +} + FORCE_INLINE void clear() { lcd.clear();