@@ -46,17 +46,22 @@ void ZOffsetScreen::onRedraw(draw_mode_t what) {
46
46
w.heading ( GET_TEXT_F (MSG_ZPROBE_ZOFFSET));
47
47
w.color (z_axis).adjuster (4 , GET_TEXT_F (MSG_ZPROBE_ZOFFSET), getZOffset_mm ());
48
48
w.increments ();
49
- w.button ( 2 , GET_TEXT_F (MSG_PROBE_WIZARD));
49
+ w.button (2 , GET_TEXT_F (MSG_PROBE_WIZARD), ! isPrinting ( ));
50
50
}
51
51
52
- void ZOffsetScreen::move (float inc ) {
52
+ void ZOffsetScreen::move (float mm, int16_t steps ) {
53
53
// We can't store state after the call to the AlertBox, so
54
54
// check whether the current position equal mydata.z in order
55
55
// to know whether the user started the wizard.
56
56
if (getAxisPosition_mm (Z) == mydata.z ) {
57
- mydata.z += inc;
57
+ // In the wizard
58
+ mydata.z += mm;
58
59
setAxisPosition_mm (mydata.z , Z);
59
60
}
61
+ else {
62
+ // Otherwise doing a manual adjustment, possibly during a print.
63
+ babystepAxis_steps (steps, Z);
64
+ }
60
65
}
61
66
62
67
void ZOffsetScreen::runWizard () {
@@ -80,11 +85,12 @@ void ZOffsetScreen::runWizard() {
80
85
}
81
86
82
87
bool ZOffsetScreen::onTouchHeld (uint8_t tag) {
83
- const float increment = getIncrement ();
88
+ const int16_t steps = mmToWholeSteps (getIncrement (), Z);
89
+ const float increment = mmFromWholeSteps (steps, Z);
84
90
switch (tag) {
85
91
case 2 : runWizard (); break ;
86
- case 4 : UI_DECREMENT (ZOffset_mm); move (-increment); break ;
87
- case 5 : UI_INCREMENT (ZOffset_mm); move ( increment); break ;
92
+ case 4 : UI_DECREMENT (ZOffset_mm); move (-increment, -steps ); break ;
93
+ case 5 : UI_INCREMENT (ZOffset_mm); move ( increment, steps ); break ;
88
94
default :
89
95
return false ;
90
96
}
0 commit comments