Browse Source

Add zero point offset information support menu.

Note: XYZ menu is shown only if not printing and printer must me homed to show non-zero value.
Marek Bel 7 years ago
parent
commit
1a80fc28e8
4 changed files with 30 additions and 0 deletions
  1. 5 0
      Firmware/language_all.cpp
  2. 2 0
      Firmware/language_all.h
  3. 1 0
      Firmware/language_en.h
  4. 22 0
      Firmware/ultralcd.cpp

+ 5 - 0
Firmware/language_all.cpp

@@ -1161,6 +1161,11 @@ const char * const MSG_MAX_LANG_TABLE[1] PROGMEM = {
 	MSG_MAX_EN
 };
 
+const char MSG_MEASURED_OFFSET_EN[] PROGMEM = "[0;0] point offset";
+const char * const MSG_MEASURED_OFFSET_LANG_TABLE[1] PROGMEM = {
+	MSG_MEASURED_OFFSET_EN
+};
+
 const char MSG_MEASURED_SKEW_EN[] PROGMEM = "Measured skew:";
 const char MSG_MEASURED_SKEW_CZ[] PROGMEM = "Merene zkoseni:";
 const char * const MSG_MEASURED_SKEW_LANG_TABLE[LANG_NUM] PROGMEM = {

+ 2 - 0
Firmware/language_all.h

@@ -392,6 +392,8 @@ extern const char* const MSG_MARK_FIL_LANG_TABLE[LANG_NUM];
 #define MSG_MARK_FIL LANG_TABLE_SELECT(MSG_MARK_FIL_LANG_TABLE)
 extern const char* const MSG_MAX_LANG_TABLE[1];
 #define MSG_MAX LANG_TABLE_SELECT_EXPLICIT(MSG_MAX_LANG_TABLE, 0)
+extern const char* const MSG_MEASURED_OFFSET_LANG_TABLE[1];
+#define MSG_MEASURED_OFFSET LANG_TABLE_SELECT_EXPLICIT(MSG_MEASURED_OFFSET_LANG_TABLE, 0)
 extern const char* const MSG_MEASURED_SKEW_LANG_TABLE[LANG_NUM];
 #define MSG_MEASURED_SKEW LANG_TABLE_SELECT(MSG_MEASURED_SKEW_LANG_TABLE)
 extern const char* const MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1_LANG_TABLE[LANG_NUM];

+ 1 - 0
Firmware/language_en.h

@@ -218,6 +218,7 @@
 #define(length=17,lines=1) MSG_SHOW_END_STOPS					"Show end stops"
 #define MSG_CALIBRATE_BED					"Calibrate XYZ"
 #define MSG_CALIBRATE_BED_RESET				"Reset XYZ calibr."
+#define MSG_MEASURED_OFFSET                 "[0;0] point offset"
 
 #define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP 	"Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."
 #define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP_Z 	"Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."

+ 22 - 0
Firmware/ultralcd.cpp

@@ -226,6 +226,7 @@ static void lcd_farm_no();
 static void lcd_menu_extruder_info();
 static void lcd_menu_xyz_y_min();
 static void lcd_menu_xyz_skew();
+static void lcd_menu_xyz_offset();
 #if defined(TMC2130) || defined(PAT9125)
 static void lcd_menu_fails_stats();
 #endif //TMC2130 or PAT9125
@@ -2336,6 +2337,27 @@ static void lcd_menu_xyz_skew()
     lcd.print(bed_skew_angle_extreme * 180 / M_PI);
     lcd.print(LCD_STR_DEGREE);
 
+    if (lcd_clicked())
+    {
+        lcd_quick_feedback();
+        lcd_goto_menu(lcd_menu_xyz_offset);
+    }
+}
+
+static void lcd_menu_xyz_offset()
+{
+    lcd.setCursor(0,0);
+    lcd_printPGM(MSG_MEASURED_OFFSET);
+    lcd_print_at_PGM(0, 1, separator);
+    lcd_print_at_PGM(0, 2, PSTR("X"));
+    lcd_print_at_PGM(0, 3, PSTR("Y"));
+
+    for (int i = 0; i < 2; i++)
+    {
+        lcd_print_at_PGM(11, i + 2, PSTR(""));
+        lcd.print(world2machine_shift[i]);
+        lcd_print_at_PGM((world2machine_shift[i] < 0) ? 17 : 16, i + 2, PSTR("mm"));
+    }
     if (lcd_clicked())
     {
         lcd_quick_feedback();