Encapsulate probe as singleton class (#16751)

This commit is contained in:
Scott Lahteine
2020-02-01 04:21:36 -06:00
committed by GitHub
parent 43d3463d5d
commit 90b6324563
33 changed files with 341 additions and 303 deletions

View File

@@ -406,7 +406,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
ui.encoderPosition = 0;
const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
new_probe_offset = probe_offset.z + diff,
new_probe_offset = probe.offset.z + diff,
new_offs =
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff
@@ -418,7 +418,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
babystep.add_steps(Z_AXIS, babystep_increment);
if (do_probe) probe_offset.z = new_offs;
if (do_probe) probe.offset.z = new_offs;
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
else hotend_offset[active_extruder].z = new_offs;
#endif
@@ -432,10 +432,10 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), LCD_Z_OFFSET_FUNC(hotend_offset[active_extruder].z));
else
#endif
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), LCD_Z_OFFSET_FUNC(probe_offset.z));
MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), LCD_Z_OFFSET_FUNC(probe.offset.z));
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset.z);
if (do_probe) _lcd_zoffset_overlay_gfx(probe.offset.z);
#endif
}
}