Browse Source

Merge pull request #3330 from thinkyhead/rc_mbl_lcdDrawUpdate

Improvements to MBL, general LCD menu handling
Scott Lahteine 9 years ago
parent
commit
cf9a171aa9

+ 1
- 1
Marlin/Marlin_main.cpp View File

5589
     memcpy(current_position, new_pos, sizeof(new_pos));
5589
     memcpy(current_position, new_pos, sizeof(new_pos));
5590
     memcpy(home_offset, new_offs, sizeof(new_offs));
5590
     memcpy(home_offset, new_offs, sizeof(new_offs));
5591
     sync_plan_position();
5591
     sync_plan_position();
5592
-    LCD_ALERTMESSAGEPGM("Offset applied.");
5592
+    LCD_ALERTMESSAGEPGM(MSG_HOME_OFFSETS_APPLIED);
5593
     #if HAS_BUZZER
5593
     #if HAS_BUZZER
5594
       buzz(200, 659);
5594
       buzz(200, 659);
5595
       buzz(200, 698);
5595
       buzz(200, 698);

+ 3
- 0
Marlin/language_an.h View File

43
 #define MSG_DISABLE_STEPPERS                "Amortar motors"
43
 #define MSG_DISABLE_STEPPERS                "Amortar motors"
44
 #define MSG_AUTO_HOME                       "Levar a l'orichen"
44
 #define MSG_AUTO_HOME                       "Levar a l'orichen"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Establir zero"
50
 #define MSG_SET_ORIGIN                      "Establir zero"
48
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"
51
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Precalentar PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Precalentar PLA "

+ 3
- 0
Marlin/language_bg.h View File

43
 #define MSG_DISABLE_STEPPERS                "Изкл. двигатели"
43
 #define MSG_DISABLE_STEPPERS                "Изкл. двигатели"
44
 #define MSG_AUTO_HOME                       "Паркиране"
44
 #define MSG_AUTO_HOME                       "Паркиране"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Задай Начало"
48
 #define MSG_SET_HOME_OFFSETS                "Задай Начало"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Изходна точка"
50
 #define MSG_SET_ORIGIN                      "Изходна точка"
48
 #define MSG_PREHEAT_PLA                     "Подгряване PLA"
51
 #define MSG_PREHEAT_PLA                     "Подгряване PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Подгряване PLA"
52
 #define MSG_PREHEAT_PLA_N                   "Подгряване PLA"

+ 3
- 0
Marlin/language_ca.h View File

44
 #define MSG_DISABLE_STEPPERS                "Apagar motors"
44
 #define MSG_DISABLE_STEPPERS                "Apagar motors"
45
 #define MSG_AUTO_HOME                       "Home global"
45
 #define MSG_AUTO_HOME                       "Home global"
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
48
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
47
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
50
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
48
 #define MSG_SET_ORIGIN                      "Establir origen"
51
 #define MSG_SET_ORIGIN                      "Establir origen"
49
 #define MSG_PREHEAT_PLA                     "Preescalfar PLA"
52
 #define MSG_PREHEAT_PLA                     "Preescalfar PLA"
50
 #define MSG_PREHEAT_PLA_N                   "Preescalfar PLA "
53
 #define MSG_PREHEAT_PLA_N                   "Preescalfar PLA "

+ 3
- 0
Marlin/language_cn.h View File

41
 #define MSG_DISABLE_STEPPERS                "\xb5\xb6\xb7\xb8\xb9\xba"
41
 #define MSG_DISABLE_STEPPERS                "\xb5\xb6\xb7\xb8\xb9\xba"
42
 #define MSG_AUTO_HOME                       "\xbb\xbc\xbd"
42
 #define MSG_AUTO_HOME                       "\xbb\xbc\xbd"
43
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
43
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
44
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
45
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
44
 #define MSG_SET_HOME_OFFSETS                "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
46
 #define MSG_SET_HOME_OFFSETS                "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
47
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
45
 #define MSG_SET_ORIGIN                      "\xbe\xbf\xbc\xbd"
48
 #define MSG_SET_ORIGIN                      "\xbe\xbf\xbc\xbd"
46
 #define MSG_PREHEAT_PLA                     "\xc3\xc4 PLA"
49
 #define MSG_PREHEAT_PLA                     "\xc3\xc4 PLA"
47
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "
50
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "

+ 3
- 0
Marlin/language_cz.h View File

47
 #define MSG_DISABLE_STEPPERS                "Uvolnit motory"
47
 #define MSG_DISABLE_STEPPERS                "Uvolnit motory"
48
 #define MSG_AUTO_HOME                       "Domovska pozice"
48
 #define MSG_AUTO_HOME                       "Domovska pozice"
49
 #define MSG_LEVEL_BED_HOMING                "Mereni podlozky"
49
 #define MSG_LEVEL_BED_HOMING                "Mereni podlozky"
50
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
51
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
50
 #define MSG_SET_HOME_OFFSETS                "Nastavit ofsety"
52
 #define MSG_SET_HOME_OFFSETS                "Nastavit ofsety"
53
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
51
 #define MSG_SET_ORIGIN                      "Nastavit pocatek"
54
 #define MSG_SET_ORIGIN                      "Nastavit pocatek"
52
 #define MSG_PREHEAT_PLA                     "Zahrat PLA"
55
 #define MSG_PREHEAT_PLA                     "Zahrat PLA"
53
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "
56
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "

+ 3
- 0
Marlin/language_da.h View File

44
 #define MSG_COOLDOWN                        "Afkøl"
44
 #define MSG_COOLDOWN                        "Afkøl"
45
 #define MSG_DISABLE_STEPPERS                "Slå stepper fra"
45
 #define MSG_DISABLE_STEPPERS                "Slå stepper fra"
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
48
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
47
 #define MSG_SET_HOME_OFFSETS                "Sæt home offsets"
49
 #define MSG_SET_HOME_OFFSETS                "Sæt home offsets"
50
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
48
 #define MSG_SET_ORIGIN                      "Sæt origin"
51
 #define MSG_SET_ORIGIN                      "Sæt origin"
49
 #define MSG_SWITCH_PS_ON                    "Slå strøm til"
52
 #define MSG_SWITCH_PS_ON                    "Slå strøm til"
50
 #define MSG_SWITCH_PS_OFF                   "Slå strøm fra"
53
 #define MSG_SWITCH_PS_OFF                   "Slå strøm fra"

+ 3
- 0
Marlin/language_de.h View File

43
 #define MSG_DISABLE_STEPPERS                "Motoren Aus" // M84
43
 #define MSG_DISABLE_STEPPERS                "Motoren Aus" // M84
44
 #define MSG_AUTO_HOME                       "Home" // G28
44
 #define MSG_AUTO_HOME                       "Home" // G28
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Setze Home hier"
48
 #define MSG_SET_HOME_OFFSETS                "Setze Home hier"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Setze Null hier" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp
50
 #define MSG_SET_ORIGIN                      "Setze Null hier" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp
48
 #define MSG_PREHEAT_PLA                     "Vorwärmen PLA"
51
 #define MSG_PREHEAT_PLA                     "Vorwärmen PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Vorwärmen PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Vorwärmen PLA "

+ 9
- 0
Marlin/language_en.h View File

64
 #ifndef MSG_LEVEL_BED_HOMING
64
 #ifndef MSG_LEVEL_BED_HOMING
65
   #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
65
   #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
66
 #endif
66
 #endif
67
+#ifndef MSG_LEVEL_BED_WAITING
68
+  #define MSG_LEVEL_BED_WAITING               "Click to Begin"
69
+#endif
70
+#ifndef MSG_LEVEL_BED_DONE
71
+  #define MSG_LEVEL_BED_DONE                  "Leveling Done!"
72
+#endif
67
 #ifndef MSG_SET_HOME_OFFSETS
73
 #ifndef MSG_SET_HOME_OFFSETS
68
   #define MSG_SET_HOME_OFFSETS                "Set home offsets"
74
   #define MSG_SET_HOME_OFFSETS                "Set home offsets"
69
 #endif
75
 #endif
76
+#ifndef MSG_HOME_OFFSETS_APPLIED
77
+  #define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
78
+#endif
70
 #ifndef MSG_SET_ORIGIN
79
 #ifndef MSG_SET_ORIGIN
71
   #define MSG_SET_ORIGIN                      "Set origin"
80
   #define MSG_SET_ORIGIN                      "Set origin"
72
 #endif
81
 #endif

+ 3
- 0
Marlin/language_es.h View File

43
 #define MSG_DISABLE_STEPPERS                "Apagar motores"
43
 #define MSG_DISABLE_STEPPERS                "Apagar motores"
44
 #define MSG_AUTO_HOME                       "Llevar al origen"
44
 #define MSG_AUTO_HOME                       "Llevar al origen"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Ajustar offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Ajustar offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Establecer cero"
50
 #define MSG_SET_ORIGIN                      "Establecer cero"
48
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"
51
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Precalentar PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Precalentar PLA "

+ 3
- 0
Marlin/language_eu.h View File

43
 #define MSG_DISABLE_STEPPERS                "Itzali motoreak"
43
 #define MSG_DISABLE_STEPPERS                "Itzali motoreak"
44
 #define MSG_AUTO_HOME                       "Hasierara joan"
44
 #define MSG_AUTO_HOME                       "Hasierara joan"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Hasiera ipini"
50
 #define MSG_SET_ORIGIN                      "Hasiera ipini"
48
 #define MSG_PREHEAT_PLA                     "Aurreberotu PLA"
51
 #define MSG_PREHEAT_PLA                     "Aurreberotu PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Aurreberotu PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Aurreberotu PLA "

+ 3
- 0
Marlin/language_fi.h View File

43
 #define MSG_DISABLE_STEPPERS                "Vapauta moottorit"
43
 #define MSG_DISABLE_STEPPERS                "Vapauta moottorit"
44
 #define MSG_AUTO_HOME                       "Aja referenssiin"
44
 #define MSG_AUTO_HOME                       "Aja referenssiin"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Aseta origo"
50
 #define MSG_SET_ORIGIN                      "Aseta origo"
48
 #define MSG_PREHEAT_PLA                     "Esilämmitä PLA"
51
 #define MSG_PREHEAT_PLA                     "Esilämmitä PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Esilämmitä PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Esilämmitä PLA "

+ 3
- 0
Marlin/language_fr.h View File

44
 #define MSG_DISABLE_STEPPERS                "Arreter moteurs"
44
 #define MSG_DISABLE_STEPPERS                "Arreter moteurs"
45
 #define MSG_AUTO_HOME                       "Home auto."
45
 #define MSG_AUTO_HOME                       "Home auto."
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
48
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
47
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
50
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
48
 #define MSG_SET_ORIGIN                      "Regler origine"
51
 #define MSG_SET_ORIGIN                      "Regler origine"
49
 #define MSG_PREHEAT_PLA                     "Prechauffage PLA"
52
 #define MSG_PREHEAT_PLA                     "Prechauffage PLA"
50
 #define MSG_PREHEAT_PLA_N                   "Prechauff. PLA "
53
 #define MSG_PREHEAT_PLA_N                   "Prechauff. PLA "

+ 3
- 0
Marlin/language_it.h View File

43
 #define MSG_DISABLE_STEPPERS                "Disabilita Motori"
43
 #define MSG_DISABLE_STEPPERS                "Disabilita Motori"
44
 #define MSG_AUTO_HOME                       "Auto Home"
44
 #define MSG_AUTO_HOME                       "Auto Home"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Setta offset home"
48
 #define MSG_SET_HOME_OFFSETS                "Setta offset home"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Imposta Origine"
50
 #define MSG_SET_ORIGIN                      "Imposta Origine"
48
 #define MSG_PREHEAT_PLA                     "Preriscalda PLA"
51
 #define MSG_PREHEAT_PLA                     "Preriscalda PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Preriscalda PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Preriscalda PLA "

+ 3
- 0
Marlin/language_kana.h View File

45
 #define MSG_DISABLE_STEPPERS                "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc"         // "Disable steppers"
45
 #define MSG_DISABLE_STEPPERS                "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc"         // "Disable steppers"
46
 #define MSG_AUTO_HOME                       "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Auto home"
46
 #define MSG_AUTO_HOME                       "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Auto home"
47
 #define MSG_LEVEL_BED_HOMING                "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Homing XYZ"
47
 #define MSG_LEVEL_BED_HOMING                "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Homing XYZ"
48
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
49
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
48
 #define MSG_SET_HOME_OFFSETS                "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2"     // "Set home offsets"
50
 #define MSG_SET_HOME_OFFSETS                "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2"     // "Set home offsets"
51
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
49
 #define MSG_SET_ORIGIN                      "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4"                             // "Set origin"
52
 #define MSG_SET_ORIGIN                      "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4"                             // "Set origin"
50
 #define MSG_PREHEAT_PLA                     "PLA \xd6\xc8\xc2"                                             // "Preheat PLA"
53
 #define MSG_PREHEAT_PLA                     "PLA \xd6\xc8\xc2"                                             // "Preheat PLA"
51
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "
54
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "

+ 3
- 0
Marlin/language_kana_utf8.h View File

49
 #define MSG_DISABLE_STEPPERS                "モーターデンゲン オフ"            // "Disable steppers"
49
 #define MSG_DISABLE_STEPPERS                "モーターデンゲン オフ"            // "Disable steppers"
50
 #define MSG_AUTO_HOME                       "ゲンテンニイドウ"                // "Auto home"
50
 #define MSG_AUTO_HOME                       "ゲンテンニイドウ"                // "Auto home"
51
 #define MSG_LEVEL_BED_HOMING                "ゲンテンニイドウ"                // "Homing XYZ"
51
 #define MSG_LEVEL_BED_HOMING                "ゲンテンニイドウ"                // "Homing XYZ"
52
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
53
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
52
 #define MSG_SET_HOME_OFFSETS                "キジュンオフセットセッテイ"         // "Set home offsets"
54
 #define MSG_SET_HOME_OFFSETS                "キジュンオフセットセッテイ"         // "Set home offsets"
55
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
53
 #define MSG_SET_ORIGIN                      "キジュンセット"                 // "Set origin"
56
 #define MSG_SET_ORIGIN                      "キジュンセット"                 // "Set origin"
54
 #define MSG_PREHEAT_PLA                     "PLA ヨネツ"                   // "Preheat PLA"
57
 #define MSG_PREHEAT_PLA                     "PLA ヨネツ"                   // "Preheat PLA"
55
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "
58
 #define MSG_PREHEAT_PLA_N                   MSG_PREHEAT_PLA " "

+ 3
- 0
Marlin/language_nl.h View File

43
 #define MSG_DISABLE_STEPPERS                "Motoren uit"
43
 #define MSG_DISABLE_STEPPERS                "Motoren uit"
44
 #define MSG_AUTO_HOME                       "Auto home"
44
 #define MSG_AUTO_HOME                       "Auto home"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Nulpunt instellen"
50
 #define MSG_SET_ORIGIN                      "Nulpunt instellen"
48
 #define MSG_PREHEAT_PLA                     "PLA voorverwarmen"
51
 #define MSG_PREHEAT_PLA                     "PLA voorverwarmen"
49
 #define MSG_PREHEAT_PLA_N                   "PLA voorverw. "
52
 #define MSG_PREHEAT_PLA_N                   "PLA voorverw. "

+ 3
- 0
Marlin/language_pl.h View File

43
 #define MSG_DISABLE_STEPPERS                "Wylacz silniki"
43
 #define MSG_DISABLE_STEPPERS                "Wylacz silniki"
44
 #define MSG_AUTO_HOME                       "Auto. poz. zerowa"
44
 #define MSG_AUTO_HOME                       "Auto. poz. zerowa"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Ustaw punkt zero"
50
 #define MSG_SET_ORIGIN                      "Ustaw punkt zero"
48
 #define MSG_PREHEAT_PLA                     "Rozgrzej PLA"
51
 #define MSG_PREHEAT_PLA                     "Rozgrzej PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Rozgrzej PLA "
52
 #define MSG_PREHEAT_PLA_N                   "Rozgrzej PLA "

+ 3
- 0
Marlin/language_pt-br.h View File

43
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
43
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
44
 #define MSG_AUTO_HOME                       "Ir para origen"
44
 #define MSG_AUTO_HOME                       "Ir para origen"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
48
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Ajustar orig."
50
 #define MSG_SET_ORIGIN                      "Ajustar orig."
48
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
51
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"
52
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"

+ 3
- 0
Marlin/language_pt-br_utf8.h View File

43
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
43
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
44
 #define MSG_AUTO_HOME                       "Ir para origen"
44
 #define MSG_AUTO_HOME                       "Ir para origen"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
48
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Ajustar orig."
50
 #define MSG_SET_ORIGIN                      "Ajustar orig."
48
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
51
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"
52
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"

+ 3
- 0
Marlin/language_pt.h View File

43
 #define MSG_DISABLE_STEPPERS                "Desactivar motores"
43
 #define MSG_DISABLE_STEPPERS                "Desactivar motores"
44
 #define MSG_AUTO_HOME                       "Ir para origem"
44
 #define MSG_AUTO_HOME                       "Ir para origem"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Definir desvio"
48
 #define MSG_SET_HOME_OFFSETS                "Definir desvio"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Definir origem"
50
 #define MSG_SET_ORIGIN                      "Definir origem"
48
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
51
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"
52
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"

+ 3
- 0
Marlin/language_pt_utf8.h View File

43
 #define MSG_DISABLE_STEPPERS                "Desactivar motores"
43
 #define MSG_DISABLE_STEPPERS                "Desactivar motores"
44
 #define MSG_AUTO_HOME                       "Ir para origem"
44
 #define MSG_AUTO_HOME                       "Ir para origem"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
45
 #define MSG_LEVEL_BED_HOMING                "Indo para origem"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Definir desvio"
48
 #define MSG_SET_HOME_OFFSETS                "Definir desvio"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Definir origem"
50
 #define MSG_SET_ORIGIN                      "Definir origem"
48
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
51
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"
52
 #define MSG_PREHEAT_PLA_N                   "Pre-aquecer PLA"

+ 3
- 0
Marlin/language_ru.h View File

43
 #define MSG_DISABLE_STEPPERS                "Выкл. двигатели"
43
 #define MSG_DISABLE_STEPPERS                "Выкл. двигатели"
44
 #define MSG_AUTO_HOME                       "Парковка"
44
 #define MSG_AUTO_HOME                       "Парковка"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
45
 #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46
+#define MSG_LEVEL_BED_WAITING               "Click to Begin"
47
+#define MSG_LEVEL_BED_DONE                  "Leveling Done!"
46
 #define MSG_SET_HOME_OFFSETS                "Запомнить парковку"
48
 #define MSG_SET_HOME_OFFSETS                "Запомнить парковку"
49
+#define MSG_HOME_OFFSETS_APPLIED            "Offsets applied"
47
 #define MSG_SET_ORIGIN                      "Запомнить ноль"
50
 #define MSG_SET_ORIGIN                      "Запомнить ноль"
48
 #define MSG_PREHEAT_PLA                     "Преднагрев PLA"
51
 #define MSG_PREHEAT_PLA                     "Преднагрев PLA"
49
 #define MSG_PREHEAT_PLA_N                   "Греть PLA Сопло "
52
 #define MSG_PREHEAT_PLA_N                   "Греть PLA Сопло "

+ 129
- 42
Marlin/ultralcd.cpp View File

252
   #endif //!ENCODER_RATE_MULTIPLIER
252
   #endif //!ENCODER_RATE_MULTIPLIER
253
   #define END_MENU() \
253
   #define END_MENU() \
254
       if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = _menuItemNr - 1; }\
254
       if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = _menuItemNr - 1; }\
255
-      if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
255
+      if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
256
       } } while(0)
256
       } } while(0)
257
 
257
 
258
   /** Used variables to keep track of the menu */
258
   /** Used variables to keep track of the menu */
280
 bool ignore_click = false;
280
 bool ignore_click = false;
281
 bool wait_for_unclick;
281
 bool wait_for_unclick;
282
 bool defer_return_to_status = false;
282
 bool defer_return_to_status = false;
283
-uint8_t lcdDrawUpdate = 2;                  /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
283
+
284
+enum LCDHandlerAction {
285
+  LCD_DRAW_UPDATE_NONE,
286
+  LCD_DRAW_UPDATE_CALL_REDRAW,
287
+  LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW,
288
+  LCD_DRAW_UPDATE_CALL_NO_REDRAW,
289
+};
290
+
291
+uint8_t lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW; // Set 1 or 2 when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
284
 
292
 
285
 // Variables used when editing values.
293
 // Variables used when editing values.
286
 const char* editLabel;
294
 const char* editLabel;
298
 static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) {
306
 static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) {
299
   if (currentMenu != menu) {
307
   if (currentMenu != menu) {
300
     currentMenu = menu;
308
     currentMenu = menu;
301
-    lcdDrawUpdate = 2;
309
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW;
302
     #if ENABLED(NEWPANEL)
310
     #if ENABLED(NEWPANEL)
303
       encoderPosition = encoder;
311
       encoderPosition = encoder;
304
       if (feedback) lcd_quick_feedback();
312
       if (feedback) lcd_quick_feedback();
524
     if (encoderPosition != 0) {
532
     if (encoderPosition != 0) {
525
       int distance =  (int)encoderPosition * BABYSTEP_MULTIPLICATOR;
533
       int distance =  (int)encoderPosition * BABYSTEP_MULTIPLICATOR;
526
       encoderPosition = 0;
534
       encoderPosition = 0;
527
-      lcdDrawUpdate = 1;
535
+      lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
528
       #if ENABLED(COREXY) || ENABLED(COREXZ)
536
       #if ENABLED(COREXY) || ENABLED(COREXZ)
529
         #if ENABLED(BABYSTEP_XY)
537
         #if ENABLED(BABYSTEP_XY)
530
           switch(axis) {
538
           switch(axis) {
948
     if (max_software_endstops) NOMORE(current_position[axis], max);
956
     if (max_software_endstops) NOMORE(current_position[axis], max);
949
     encoderPosition = 0;
957
     encoderPosition = 0;
950
     line_to_current(axis);
958
     line_to_current(axis);
951
-    lcdDrawUpdate = 1;
959
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
952
   }
960
   }
953
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
961
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
954
   if (LCD_CLICKED) lcd_goto_previous_menu();
962
   if (LCD_CLICKED) lcd_goto_previous_menu();
977
     current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
985
     current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
978
     encoderPosition = 0;
986
     encoderPosition = 0;
979
     line_to_current(E_AXIS);
987
     line_to_current(E_AXIS);
980
-    lcdDrawUpdate = 1;
988
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
981
   }
989
   }
982
   if (lcdDrawUpdate) {
990
   if (lcdDrawUpdate) {
983
     PGM_P pos_label;
991
     PGM_P pos_label;
1449
         lcd_contrast &= 0x3F;
1457
         lcd_contrast &= 0x3F;
1450
       #endif
1458
       #endif
1451
       encoderPosition = 0;
1459
       encoderPosition = 0;
1452
-      lcdDrawUpdate = 1;
1460
+      lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
1453
       u8g.setContrast(lcd_contrast);
1461
       u8g.setContrast(lcd_contrast);
1454
     }
1462
     }
1455
     if (lcdDrawUpdate) {
1463
     if (lcdDrawUpdate) {
1590
   static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
1598
   static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
1591
     lcd_save_previous_menu(); \
1599
     lcd_save_previous_menu(); \
1592
     \
1600
     \
1593
-    lcdDrawUpdate = 2; \
1601
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW; \
1594
     currentMenu = menu_edit_ ## _name; \
1602
     currentMenu = menu_edit_ ## _name; \
1595
     \
1603
     \
1596
     editLabel = pstr; \
1604
     editLabel = pstr; \
1672
 #endif
1680
 #endif
1673
 
1681
 
1674
 void lcd_quick_feedback() {
1682
 void lcd_quick_feedback() {
1675
-  lcdDrawUpdate = 2;
1683
+  lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW;
1676
   next_button_update_ms = millis() + 500;
1684
   next_button_update_ms = millis() + 500;
1677
 
1685
 
1678
   #if ENABLED(LCD_USE_I2C_BUZZER)
1686
   #if ENABLED(LCD_USE_I2C_BUZZER)
1837
  *   - Act on RepRap World keypad input
1845
  *   - Act on RepRap World keypad input
1838
  *   - Update the encoder position
1846
  *   - Update the encoder position
1839
  *   - Apply acceleration to the encoder position
1847
  *   - Apply acceleration to the encoder position
1848
+ *   - Set lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW on controller events
1840
  *   - Reset the Info Screen timeout if there's any input
1849
  *   - Reset the Info Screen timeout if there's any input
1841
  *   - Update status indicators, if any
1850
  *   - Update status indicators, if any
1842
- *   - Clear the LCD if lcdDrawUpdate == 2
1843
  *
1851
  *
1844
- * Warning: This function is called from interrupt context!
1852
+ *   Run the current LCD menu handler callback function:
1853
+ *   - Call the handler only if lcdDrawUpdate != LCD_DRAW_UPDATE_NONE
1854
+ *   - Before calling the handler, LCD_DRAW_UPDATE_CALL_NO_REDRAW => LCD_DRAW_UPDATE_NONE
1855
+ *   - Call the menu handler. Menu handlers should do the following:
1856
+ *     - If a value changes, set lcdDrawUpdate to LCD_DRAW_UPDATE_CALL_REDRAW
1857
+ *     - if (lcdDrawUpdate) { redraw }
1858
+ *     - Before exiting the handler set lcdDrawUpdate to:
1859
+ *       - LCD_DRAW_UPDATE_CALL_REDRAW or LCD_DRAW_UPDATE_NONE for no callbacks until the next controller event.
1860
+ *       - LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW to clear screen, LCD_DRAW_UPDATE_CALL_REDRAW on the next loop.
1861
+ *       - LCD_DRAW_UPDATE_CALL_NO_REDRAW for a callback with no forced redraw on the next loop.
1862
+ *     - NOTE: For some displays, the menu handler may be called 2 or more times per loop.
1863
+ *
1864
+ *   After the menu handler callback runs (or not):
1865
+ *   - Clear the LCD if lcdDrawUpdate == LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW
1866
+ *   - Update lcdDrawUpdate for the next loop (i.e., move one state down, usually)
1867
+ *
1868
+ * No worries. This function is only called from the main thread.
1845
  */
1869
  */
1846
 void lcd_update() {
1870
 void lcd_update() {
1847
   #if ENABLED(ULTIPANEL)
1871
   #if ENABLED(ULTIPANEL)
1854
 
1878
 
1855
     bool sd_status = IS_SD_INSERTED;
1879
     bool sd_status = IS_SD_INSERTED;
1856
     if (sd_status != lcd_sd_status && lcd_detected()) {
1880
     if (sd_status != lcd_sd_status && lcd_detected()) {
1857
-      lcdDrawUpdate = 2;
1881
+      lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW;
1858
       lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
1882
       lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
1859
         #if ENABLED(LCD_PROGRESS_BAR)
1883
         #if ENABLED(LCD_PROGRESS_BAR)
1860
           currentMenu == lcd_status_screen
1884
           currentMenu == lcd_status_screen
1933
           encoderDiff = 0;
1957
           encoderDiff = 0;
1934
         }
1958
         }
1935
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
1959
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
1936
-        lcdDrawUpdate = 1;
1960
+        lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
1937
       }
1961
       }
1938
     #endif //ULTIPANEL
1962
     #endif //ULTIPANEL
1939
 
1963
 
1940
     if (currentMenu == lcd_status_screen) {
1964
     if (currentMenu == lcd_status_screen) {
1941
       if (!lcd_status_update_delay) {
1965
       if (!lcd_status_update_delay) {
1942
-        lcdDrawUpdate = 1;
1966
+        lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
1943
         lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
1967
         lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
1944
       }
1968
       }
1945
       else {
1969
       else {
1948
     }
1972
     }
1949
 
1973
 
1950
     if (lcdDrawUpdate) {
1974
     if (lcdDrawUpdate) {
1975
+
1976
+      if (lcdDrawUpdate == LCD_DRAW_UPDATE_CALL_NO_REDRAW) lcdDrawUpdate = LCD_DRAW_UPDATE_NONE;
1977
+
1951
       #if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
1978
       #if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
1952
         bool blink = lcd_blink();
1979
         bool blink = lcd_blink();
1953
         u8g.firstPage();
1980
         u8g.firstPage();
1971
     #if ENABLED(ULTIPANEL)
1998
     #if ENABLED(ULTIPANEL)
1972
 
1999
 
1973
       // Return to Status Screen after a timeout
2000
       // Return to Status Screen after a timeout
1974
-      if (!defer_return_to_status && currentMenu != lcd_status_screen && millis() > return_to_status_ms) {
2001
+      if (defer_return_to_status)
2002
+        return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
2003
+      else if (currentMenu != lcd_status_screen && millis() > return_to_status_ms) {
1975
         lcd_return_to_status();
2004
         lcd_return_to_status();
1976
-        lcdDrawUpdate = 2;
1977
       }
2005
       }
1978
 
2006
 
1979
     #endif // ULTIPANEL
2007
     #endif // ULTIPANEL
1980
 
2008
 
1981
-    if (lcdDrawUpdate && --lcdDrawUpdate) lcd_implementation_clear();
2009
+    switch (lcdDrawUpdate) {
2010
+      case LCD_DRAW_UPDATE_NONE:
2011
+        // do nothing
2012
+      case LCD_DRAW_UPDATE_CALL_NO_REDRAW:
2013
+        // changes to LCD_DRAW_UPDATE_NONE before call
2014
+        break;
2015
+      case LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW:
2016
+        lcd_implementation_clear();
2017
+        lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
2018
+        break;
2019
+      case LCD_DRAW_UPDATE_CALL_REDRAW:
2020
+        lcdDrawUpdate = LCD_DRAW_UPDATE_NONE;
2021
+        break;
2022
+    }
2023
+
1982
     next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
2024
     next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
1983
   }
2025
   }
1984
 }
2026
 }
1995
       expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
2037
       expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
1996
     #endif
2038
     #endif
1997
   #endif
2039
   #endif
1998
-  lcdDrawUpdate = 2;
2040
+  lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW;
1999
 
2041
 
2000
   #if ENABLED(FILAMENT_LCD_DISPLAY)
2042
   #if ENABLED(FILAMENT_LCD_DISPLAY)
2001
     previous_lcd_status_ms = millis();  //get status message to show up for a while
2043
     previous_lcd_status_ms = millis();  //get status message to show up for a while
2223
   return conv;
2265
   return conv;
2224
 }
2266
 }
2225
 
2267
 
2226
-// Convert signed float to string (len 5 or 6) with 1.234 / -1.234 format
2227
-char* ftostr43(const float& x) {
2268
+// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
2269
+char* ftostr43(const float& x, char plus/*=' '*/) {
2228
   long xx = x * 1000;
2270
   long xx = x * 1000;
2229
-  char *conv_ptr = conv;
2230
-  if (xx >= 0) {
2231
-    conv_ptr++;
2232
-  }
2271
+  if (xx == 0)
2272
+    conv[0] = ' ';
2273
+  else if (xx > 0)
2274
+    conv[0] = plus;
2233
   else {
2275
   else {
2234
     xx = -xx;
2276
     xx = -xx;
2235
     conv[0] = '-';
2277
     conv[0] = '-';
2240
   conv[4] = (xx / 10) % 10 + '0';
2282
   conv[4] = (xx / 10) % 10 + '0';
2241
   conv[5] = (xx) % 10 + '0';
2283
   conv[5] = (xx) % 10 + '0';
2242
   conv[6] = 0;
2284
   conv[6] = 0;
2243
-  return conv_ptr;
2285
+  return conv;
2244
 }
2286
 }
2245
 
2287
 
2246
 // Convert unsigned float to string with 1.23 format
2288
 // Convert unsigned float to string with 1.23 format
2440
    *   - Movement adjusts the Z axis
2482
    *   - Movement adjusts the Z axis
2441
    *   - Click saves the Z and goes to the next mesh point
2483
    *   - Click saves the Z and goes to the next mesh point
2442
    */
2484
    */
2443
-  static void _lcd_level_bed() {
2485
+  static void _lcd_level_bed_procedure() {
2486
+    static bool mbl_wait_for_move = false;
2487
+    // Menu handlers may be called in a re-entrant fashion
2488
+    // if they call st_synchronize or plan_buffer_line. So
2489
+    // while waiting for a move we just ignore new input.
2490
+    if (mbl_wait_for_move) {
2491
+      lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2492
+      return;
2493
+    }
2494
+
2444
     ENCODER_DIRECTION_NORMAL();
2495
     ENCODER_DIRECTION_NORMAL();
2445
-    if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2496
+
2497
+    // Encoder wheel adjusts the Z position
2498
+    if (encoderPosition != 0 && movesplanned() <= 3) {
2446
       refresh_cmd_timeout();
2499
       refresh_cmd_timeout();
2447
       current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
2500
       current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
2448
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
2501
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
2449
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2502
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2450
       encoderPosition = 0;
2503
       encoderPosition = 0;
2451
       line_to_current(Z_AXIS);
2504
       line_to_current(Z_AXIS);
2452
-      lcdDrawUpdate = 1;
2505
+      lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2453
     }
2506
     }
2507
+
2508
+    // Update on first display, then only on updates to Z position
2454
     if (lcdDrawUpdate) {
2509
     if (lcdDrawUpdate) {
2455
       float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
2510
       float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
2456
-      lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001)));
2511
+      lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001), '+'));
2457
     }
2512
     }
2513
+
2514
+    // We want subsequent calls, but don't force redraw
2515
+    // Set here so it can be overridden by lcd_return_to_status below
2516
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2517
+
2518
+    // Click sets the current Z and moves to the next position
2458
     static bool debounce_click = false;
2519
     static bool debounce_click = false;
2459
     if (LCD_CLICKED) {
2520
     if (LCD_CLICKED) {
2460
       if (!debounce_click) {
2521
       if (!debounce_click) {
2461
-        debounce_click = true;
2522
+        debounce_click = true; // ignore multiple "clicks" in a row
2462
         int ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS),
2523
         int ix = _lcd_level_bed_position % (MESH_NUM_X_POINTS),
2463
             iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2524
             iy = _lcd_level_bed_position / (MESH_NUM_X_POINTS);
2464
         if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2525
         if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
2466
         _lcd_level_bed_position++;
2527
         _lcd_level_bed_position++;
2467
         if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2528
         if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2468
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2529
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2530
+          mbl_wait_for_move = true;
2469
           line_to_current(Z_AXIS);
2531
           line_to_current(Z_AXIS);
2470
           st_synchronize();
2532
           st_synchronize();
2471
           mbl.active = 1;
2533
           mbl.active = 1;
2472
           enqueue_and_echo_commands_P(PSTR("G28"));
2534
           enqueue_and_echo_commands_P(PSTR("G28"));
2535
+          mbl_wait_for_move = false;
2473
           lcd_return_to_status();
2536
           lcd_return_to_status();
2537
+          #if ENABLED(NEWPANEL)
2538
+            lcd_quick_feedback();
2539
+          #endif
2540
+          LCD_ALERTMESSAGEPGM(MSG_LEVEL_BED_DONE);
2541
+          #if HAS_BUZZER
2542
+            buzz(200, 659);
2543
+            buzz(200, 698);
2544
+          #endif
2474
         }
2545
         }
2475
         else {
2546
         else {
2476
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2547
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2481
           current_position[X_AXIS] = mbl.get_x(ix);
2552
           current_position[X_AXIS] = mbl.get_x(ix);
2482
           current_position[Y_AXIS] = mbl.get_y(iy);
2553
           current_position[Y_AXIS] = mbl.get_y(iy);
2483
           line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
2554
           line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
2484
-          lcdDrawUpdate = 1;
2485
         }
2555
         }
2486
       }
2556
       }
2487
     }
2557
     }
2490
     }
2560
     }
2491
   }
2561
   }
2492
 
2562
 
2493
-  /**
2494
-   * MBL Move to mesh starting point
2495
-   */
2496
-  static void _lcd_level_bed_homing() {
2497
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2498
-    lcdDrawUpdate = 1;
2499
-    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2563
+  static void _lcd_level_bed_homing_done() {
2564
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING), NULL);
2565
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2566
+    if (LCD_CLICKED) {
2500
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2567
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2501
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2568
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2502
       current_position[X_AXIS] = MESH_MIN_X;
2569
       current_position[X_AXIS] = MESH_MIN_X;
2503
       current_position[Y_AXIS] = MESH_MIN_Y;
2570
       current_position[Y_AXIS] = MESH_MIN_Y;
2504
       line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
2571
       line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
2505
       _lcd_level_bed_position = 0;
2572
       _lcd_level_bed_position = 0;
2506
-      lcd_goto_menu(_lcd_level_bed);
2573
+      lcd_goto_menu(_lcd_level_bed_procedure, true);
2507
     }
2574
     }
2508
   }
2575
   }
2509
 
2576
 
2510
   /**
2577
   /**
2511
-   * MBL entry-point
2578
+   * MBL Move to mesh starting point
2512
    */
2579
    */
2513
-  static void lcd_level_bed() {
2580
+  static void _lcd_level_bed_homing() {
2581
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2582
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2583
+    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])
2584
+      lcd_goto_menu(_lcd_level_bed_homing_done);
2585
+  }
2586
+
2587
+  /**
2588
+   * MBL Continue Bed Leveling...
2589
+   */
2590
+  static void _lcd_level_bed_continue() {
2514
     defer_return_to_status = true;
2591
     defer_return_to_status = true;
2515
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2592
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2516
     mbl.reset();
2593
     mbl.reset();
2517
     enqueue_and_echo_commands_P(PSTR("G28"));
2594
     enqueue_and_echo_commands_P(PSTR("G28"));
2518
-    lcd_goto_menu(_lcd_level_bed_homing);
2595
+    lcd_goto_menu(_lcd_level_bed_homing, true);
2596
+  }
2597
+
2598
+  /**
2599
+   * MBL entry-point
2600
+   */
2601
+  static void lcd_level_bed() {
2602
+    START_MENU();
2603
+    MENU_ITEM(back, "Cancel", lcd_prepare_menu);
2604
+    MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
2605
+    END_MENU();
2519
   }
2606
   }
2520
 
2607
 
2521
 #endif  // MANUAL_BED_LEVELING
2608
 #endif  // MANUAL_BED_LEVELING

+ 1
- 1
Marlin/ultralcd.h View File

156
 char* ftostr31ns(const float& x); // float to string without sign character
156
 char* ftostr31ns(const float& x); // float to string without sign character
157
 char* ftostr31(const float& x);
157
 char* ftostr31(const float& x);
158
 char* ftostr32(const float& x);
158
 char* ftostr32(const float& x);
159
-char* ftostr43(const float& x);
159
+char* ftostr43(const float& x, char plus=' ');
160
 char* ftostr12ns(const float& x);
160
 char* ftostr12ns(const float& x);
161
 char* ftostr32sp(const float& x); // remove zero-padding from ftostr32
161
 char* ftostr32sp(const float& x); // remove zero-padding from ftostr32
162
 char* ftostr5(const float& x);
162
 char* ftostr5(const float& x);

Loading…
Cancel
Save