|
@@ -45,19 +45,19 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
|
45
|
45
|
widgets_t w(what);
|
46
|
46
|
w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM));
|
47
|
47
|
|
48
|
|
- w.heading( GET_TEXT_F(MSG_NUDGE_NOZZLE));
|
|
48
|
+ w.heading(GET_TEXT_F(MSG_NUDGE_NOZZLE));
|
49
|
49
|
#if ENABLED(BABYSTEP_XY)
|
50
|
|
- w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X));
|
51
|
|
- w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y));
|
|
50
|
+ w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X));
|
|
51
|
+ w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y));
|
52
|
52
|
#endif
|
53
|
|
- w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z));
|
|
53
|
+ w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z));
|
54
|
54
|
w.increments();
|
55
|
55
|
#if EXTRUDERS > 1
|
56
|
|
- w.toggle (8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles);
|
|
56
|
+ w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles);
|
57
|
57
|
#endif
|
58
|
58
|
|
59
|
59
|
#if EXTRUDERS > 1 || HAS_BED_PROBE
|
60
|
|
- w.toggle (9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets);
|
|
60
|
+ w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets);
|
61
|
61
|
|
62
|
62
|
if (screen_data.NudgeNozzleScreen.show_offsets) {
|
63
|
63
|
char str[19];
|
|
@@ -69,38 +69,37 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
|
69
|
69
|
dtostrf(getZOffset_mm(), 4, 2, str);
|
70
|
70
|
strcat(str, " ");
|
71
|
71
|
strcat_P(str, GET_TEXT(MSG_UNITS_MM));
|
72
|
|
- w.text_field (0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str);
|
|
72
|
+ w.text_field(0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str);
|
73
|
73
|
#endif
|
74
|
74
|
|
75
|
|
- #if EXTRUDERS > 1
|
|
75
|
+ #if HOTENDS > 1
|
76
|
76
|
format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1));
|
77
|
|
- w.text_field (0, GET_TEXT_F(MSG_OFFSETS_MENU), str);
|
|
77
|
+ w.text_field(0, GET_TEXT_F(MSG_OFFSETS_MENU), str);
|
78
|
78
|
#endif
|
79
|
79
|
}
|
80
|
80
|
#endif
|
81
|
81
|
}
|
82
|
82
|
|
83
|
83
|
bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) {
|
84
|
|
- const float inc = getIncrement();
|
|
84
|
+ const float inc = getIncrement();
|
85
|
85
|
#if EXTRUDERS > 1
|
86
|
|
- const bool link = screen_data.NudgeNozzleScreen.link_nozzles;
|
|
86
|
+ const bool link = screen_data.NudgeNozzleScreen.link_nozzles;
|
87
|
87
|
#else
|
88
|
88
|
constexpr bool link = true;
|
89
|
89
|
#endif
|
90
|
90
|
int16_t steps;
|
91
|
91
|
switch (tag) {
|
92
|
|
- case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break;
|
93
|
|
- case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break;
|
94
|
|
- case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break;
|
95
|
|
- case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break;
|
96
|
|
- case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break;
|
97
|
|
- case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break;
|
|
92
|
+ case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break;
|
|
93
|
+ case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break;
|
|
94
|
+ case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break;
|
|
95
|
+ case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break;
|
|
96
|
+ case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break;
|
|
97
|
+ case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break;
|
98
|
98
|
#if EXTRUDERS > 1
|
99
|
|
- case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break;
|
|
99
|
+ case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break;
|
100
|
100
|
#endif
|
101
|
|
- case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break;
|
102
|
|
- default:
|
103
|
|
- return false;
|
|
101
|
+ case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break;
|
|
102
|
+ default: return false;
|
104
|
103
|
}
|
105
|
104
|
#if EXTRUDERS > 1 || HAS_BED_PROBE
|
106
|
105
|
SaveSettingsDialogBox::settingsChanged();
|
|
@@ -112,9 +111,9 @@ bool NudgeNozzleScreen::onTouchEnd(uint8_t tag) {
|
112
|
111
|
if (tag == 1) {
|
113
|
112
|
SaveSettingsDialogBox::promptToSaveSettings();
|
114
|
113
|
return true;
|
115
|
|
- } else {
|
116
|
|
- return BaseNumericAdjustmentScreen::onTouchEnd(tag);
|
117
|
114
|
}
|
|
115
|
+ else
|
|
116
|
+ return BaseNumericAdjustmentScreen::onTouchEnd(tag);
|
118
|
117
|
}
|
119
|
118
|
|
120
|
119
|
void NudgeNozzleScreen::onIdle() {
|