Browse Source

Merge pull request #7098 from thinkyhead/bf_ubl_steps

Step-by-Step Menu addition
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
d5368461f9
  1. 3
      Marlin/language_en.h
  2. 194
      Marlin/ultralcd.cpp
  3. 17
      Marlin/ultralcd_impl_DOGM.h
  4. 4
      Marlin/ultralcd_impl_HD44780.h

3
Marlin/language_en.h

@ -334,6 +334,9 @@
#ifndef MSG_UBL_Z_OFFSET_STOPPED #ifndef MSG_UBL_Z_OFFSET_STOPPED
#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped")
#endif #endif
#ifndef MSG_UBL_STEP_BY_STEP_MENU
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL")
#endif
#ifndef MSG_MOVING #ifndef MSG_MOVING
#define MSG_MOVING _UxGT("Moving...") #define MSG_MOVING _UxGT("Moving...")

194
Marlin/ultralcd.cpp

@ -1754,15 +1754,16 @@ void kill_screen(const char* lcd_msg) {
/** /**
* Step 1: Bed Level entry-point * Step 1: Bed Level entry-point
* - Cancel *
* - Auto Home (if homing needed) * << Prepare
* - Leveling On/Off (if data exists, and homed) * Auto Home (if homing needed)
* - Level Bed > * Leveling On/Off (if data exists, and homed)
* - Fade Height (Req: ENABLE_LEVELING_FADE_HEIGHT) * Level Bed
* - Mesh Z Offset (Req: MESH_BED_LEVELING) * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT)
* - Z Probe Offset (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) * Mesh Z Offset: --- (Req: MESH_BED_LEVELING)
* - Load Settings (Req: EEPROM_SETTINGS) * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
* - Save Settings (Req: EEPROM_SETTINGS) * Load Settings (Req: EEPROM_SETTINGS)
* Save Settings (Req: EEPROM_SETTINGS)
*/ */
void lcd_bed_leveling() { void lcd_bed_leveling() {
START_MENU(); START_MENU();
@ -1833,6 +1834,11 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Custom Mesh submenu * UBL Custom Mesh submenu
*
* << Build Mesh
* Hotend Temp: ---
* Bed Temp: ---
* Build Custom Mesh
*/ */
void _lcd_ubl_custom_mesh() { void _lcd_ubl_custom_mesh() {
START_MENU(); START_MENU();
@ -1858,6 +1864,11 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Adjust Mesh Height submenu * UBL Adjust Mesh Height submenu
*
* << Edit Mesh
* Height Amount: ---
* Adjust Mesh Height
* << Info Screen
*/ */
void _lcd_ubl_height_adjust_menu() { void _lcd_ubl_height_adjust_menu() {
START_MENU(); START_MENU();
@ -1870,6 +1881,12 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Edit Mesh submenu * UBL Edit Mesh submenu
*
* << UBL Tools
* Fine Tune All
* Fine Tune Closest
* - Adjust Mesh Height >>
* << Info Screen
*/ */
void _lcd_ubl_edit_mesh() { void _lcd_ubl_edit_mesh() {
START_MENU(); START_MENU();
@ -1899,6 +1916,12 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Validate Mesh submenu * UBL Validate Mesh submenu
*
* << UBL Tools
* PLA Mesh Validation
* ABS Mesh Validation
* Validate Custom Mesh
* << Info Screen
*/ */
void _lcd_ubl_validate_mesh() { void _lcd_ubl_validate_mesh() {
START_MENU(); START_MENU();
@ -1926,6 +1949,10 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Grid Leveling submenu * UBL Grid Leveling submenu
*
* << UBL Tools
* Side points: ---
* Level Mesh
*/ */
void _lcd_ubl_grid_level() { void _lcd_ubl_grid_level() {
START_MENU(); START_MENU();
@ -1937,6 +1964,11 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Mesh Leveling submenu * UBL Mesh Leveling submenu
*
* << UBL Tools
* 3-Point Mesh Leveling
* - Grid Mesh Leveling >>
* << Info Screen
*/ */
void _lcd_ubl_mesh_leveling() { void _lcd_ubl_mesh_leveling() {
START_MENU(); START_MENU();
@ -1967,6 +1999,13 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Fill-in Mesh submenu * UBL Fill-in Mesh submenu
*
* << Build Mesh
* Fill-in Amount: ---
* Fill-in Mesh
* Smart Fill-in
* Manual Fill-in
* << Info Screen
*/ */
void _lcd_ubl_fillin_menu() { void _lcd_ubl_fillin_menu() {
START_MENU(); START_MENU();
@ -1986,6 +2025,17 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Build Mesh submenu * UBL Build Mesh submenu
*
* << UBL Tools
* Build PLA Mesh
* Build ABS Mesh
* - Build Custom Mesh >>
* Build Cold Mesh
* - Fill-in Mesh >>
* Continue Bed Mesh
* Invalidate All
* Invalidate Closest
* << Info Screen
*/ */
void _lcd_ubl_build_mesh() { void _lcd_ubl_build_mesh() {
START_MENU(); START_MENU();
@ -2051,6 +2101,11 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Mesh Storage submenu * UBL Mesh Storage submenu
*
* << Unified Bed Leveling
* Memory Slot: ---
* Load Bed Mesh
* Save Bed Mesh
*/ */
void _lcd_ubl_storage_mesh() { void _lcd_ubl_storage_mesh() {
START_MENU(); START_MENU();
@ -2278,6 +2333,12 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Output map submenu * UBL Output map submenu
*
* << Unified Bed Leveling
* Output for Host
* Output for CSV
* Off Printer Backup
* Output Mesh Map
*/ */
void _lcd_ubl_output_map() { void _lcd_ubl_output_map() {
START_MENU(); START_MENU();
@ -2291,6 +2352,12 @@ void kill_screen(const char* lcd_msg) {
/** /**
* UBL Tools submenu * UBL Tools submenu
*
* << Unified Bed Leveling
* - Build Mesh >>
* - Validate Mesh >>
* - Edit Mesh >>
* - Mesh Leveling >>
*/ */
void _lcd_ubl_tools_menu() { void _lcd_ubl_tools_menu() {
START_MENU(); START_MENU();
@ -2302,63 +2369,43 @@ void kill_screen(const char* lcd_msg) {
END_MENU(); END_MENU();
} }
/**
* UBL Step-By-Step submenu
*
* << Unified Bed Leveling
* 1 Build Cold Mesh
* 2 Smart Fill-in
* - 3 Validate Mesh >>
* 4 Fine Tune All
* - 5 Validate Mesh >>
* 6 Fine Tune All
* 7 Save Bed Mesh
*/
void _lcd_ubl_step_by_step() {
START_MENU();
MENU_BACK(MSG_UBL_LEVEL_BED);
MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1"));
MENU_ITEM(function, "2 " MSG_UBL_SMART_FILLIN, _lcd_ubl_smart_fillin_cmd);
MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T"));
MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh);
MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T"));
MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd);
END_MENU();
}
/** /**
* UBL System submenu * UBL System submenu
* *
* Prepare * << Prepare
* - Unified Bed Leveling * - Manually Build Mesh >>
* - Manually Build Mesh * - Activate UBL >>
* - Activate UBL * - Deactivate UBL >>
* - Deactivate UBL * - Step-By-Step UBL >>
* - Mesh Storage * - Mesh Storage >>
* Memory Slot: * - Output Map >>
* Load Bed Mesh * - UBL Tools >>
* Save Bed Mesh * - Output UBL Info >>
* - Output Map
* Topography to Host
* CSV for Spreadsheet
* Mesh Output Backup
* Output to LCD Grid
* - UBL Tools
* - Build Mesh
* Build PLA Mesh
* Build ABS Mesh
* - Build Custom Mesh
* Hotend Temp:
* Bed Temp:
* Build Custom Mesh
* Info Screen
* - Build Cold Mesh
* - Fill-in Mesh
* Fill-in Mesh
* Smart Fill-in
* Manual Fill-in
* Info Screen
* Continue Bed Mesh
* Invalidate All
* Invalidate Closest
* - Validate Mesh
* PLA Mesh Validation
* ABS Mesh Validation
* - Custom Mesh Validation
* Hotend Temp:
* Bed Temp:
* Validate Mesh
* Info Screen
* - Edit Mesh
* Fine Tune All
* Fine Tune Closest
* - Adjust Mesh Height
* Height Amount:
* Adjust Mesh Height
* Info Screen
* - Mesh Leveling
* 3-Point Mesh Leveling
* - Grid Mesh Leveling
* Side points:
* Level Mesh
* Info Screen
* - Output UBL Info
*/ */
void _lcd_ubl_level_bed() { void _lcd_ubl_level_bed() {
@ -2367,6 +2414,7 @@ void kill_screen(const char* lcd_msg) {
MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0"));
MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A"));
MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D"));
MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step);
MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh);
MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map);
MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu);
@ -3263,25 +3311,25 @@ void kill_screen(const char* lcd_msg) {
START_MENU(); START_MENU();
MENU_BACK(MSG_MOTION); MENU_BACK(MSG_MOTION);
MENU_ITEM_EDIT_CALLBACK(float62, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning);
MENU_ITEM_EDIT_CALLBACK(float62, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning);
MENU_ITEM_EDIT_CALLBACK(float62, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning);
#if ENABLED(DISTINCT_E_FACTORS) #if ENABLED(DISTINCT_E_FACTORS)
MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning);
MENU_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning);
MENU_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning);
#if E_STEPPERS > 2 #if E_STEPPERS > 2
MENU_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning);
#if E_STEPPERS > 3 #if E_STEPPERS > 3
MENU_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning);
#if E_STEPPERS > 4 #if E_STEPPERS > 4
MENU_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning);
#endif // E_STEPPERS > 4 #endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#else #else
MENU_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
#endif #endif
END_MENU(); END_MENU();

17
Marlin/ultralcd_impl_DOGM.h

@ -871,7 +871,7 @@ static void lcd_implementation_status_screen() {
#if ENABLED(USE_BIG_EDIT_FONT) #if ENABLED(USE_BIG_EDIT_FONT)
uint8_t lcd_width, char_width; uint8_t lcd_width, char_width;
if (labellen <= LCD_WIDTH_EDIT - 1) { if (labellen <= LCD_WIDTH_EDIT - 1) {
if (labellen >= LCD_WIDTH_EDIT - vallen) rows = 2; if (labellen + vallen + 2 >= LCD_WIDTH_EDIT) rows = 2;
lcd_width = LCD_WIDTH_EDIT + 1; lcd_width = LCD_WIDTH_EDIT + 1;
char_width = DOG_CHAR_WIDTH_EDIT; char_width = DOG_CHAR_WIDTH_EDIT;
lcd_setFont(FONT_MENU_EDIT); lcd_setFont(FONT_MENU_EDIT);
@ -890,16 +890,21 @@ static void lcd_implementation_status_screen() {
const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3 const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3
uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2; uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2;
if (PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline)) { bool onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline);
if (onpage) {
u8g.setPrintPos(0, baseline); u8g.setPrintPos(0, baseline);
lcd_printPGM(pstr); lcd_printPGM(pstr);
} }
if (value != NULL) { if (value != NULL) {
baseline += (rows - 1) * segmentHeight; u8g.print(':');
if (PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline)) { if (rows == 2) {
u8g.print(':'); baseline += segmentHeight;
u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, baseline); onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline);
}
if (onpage) {
u8g.setPrintPos(((lcd_width - 1) - (vallen + 1)) * char_width, baseline); // Right-justified, leaving padded by spaces
u8g.print(' '); // overwrite char if value gets shorter
lcd_print(value); lcd_print(value);
} }
} }

4
Marlin/ultralcd_impl_HD44780.h

@ -978,7 +978,9 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(pstr); lcd_printPGM(pstr);
if (value != NULL) { if (value != NULL) {
lcd.print(':'); lcd.print(':');
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); const uint8_t valrow = (lcd_strlen_P(pstr) + 1 + lcd_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit
lcd.setCursor((LCD_WIDTH - 1) - (lcd_strlen(value) + 1), valrow); // Right-justified, padded by spaces
lcd.print(' '); // overwrite char if value gets shorter
lcd_print(value); lcd_print(value);
} }
} }

Loading…
Cancel
Save