Skip to content

Commit c4497de

Browse files
committed
πŸ§‘β€πŸ’» ExtUI::onLevelingStart/Done for all leveling
1 parent ad23b8c commit c4497de

17 files changed

+47
-28
lines changed

β€ŽMarlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ namespace ExtUI {
104104
// whether successful or not.
105105
}
106106

107-
#if HAS_MESH
107+
#if HAS_LEVELING
108108
void onLevelingStart() {}
109109
void onLevelingDone() {}
110+
#endif
110111

112+
#if HAS_MESH
111113
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
112114
// Called when any mesh points are updated
113115
//SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);

β€ŽMarlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ namespace ExtUI {
9191
// whether successful or not.
9292
}
9393

94-
#if HAS_MESH
95-
94+
#if HAS_LEVELING
9695
void onLevelingStart() {}
9796
void onLevelingDone() {}
97+
#endif
98+
99+
#if HAS_MESH
98100

99101
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
100102
// Called when any mesh points are updated

β€ŽMarlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ namespace ExtUI {
108108
// whether successful or not.
109109
}
110110

111-
#if HAS_MESH
111+
#if HAS_LEVELING
112112
void onLevelingStart() {}
113113
void onLevelingDone() {}
114+
#endif
114115

116+
#if HAS_MESH
115117
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
116118
// Called when any mesh points are updated
117119
//SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);

β€ŽMarlin/src/lcd/extui/dgus/dgus_extui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ namespace ExtUI {
112112
// whether successful or not.
113113
}
114114

115-
#if HAS_MESH
115+
#if HAS_LEVELING
116116
void onLevelingStart() {}
117117
void onLevelingDone() {}
118+
#endif
118119

120+
#if HAS_MESH
119121
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
120122
// Called when any mesh points are updated
121123
}

β€ŽMarlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ void DGUSScreenHandler::Loop() {
118118
}
119119

120120
if (current_screen == DGUS_Screen::WAIT
121-
&& ((wait_continue && !wait_for_user)
122-
|| (!wait_continue && IsPrinterIdle()))
121+
&& ((wait_continue && !wait_for_user) || (!wait_continue && IsPrinterIdle()))
123122
) {
124123
MoveToScreen(wait_return_screen, true);
125124
return;
@@ -128,7 +127,7 @@ void DGUSScreenHandler::Loop() {
128127
if (current_screen == DGUS_Screen::LEVELING_PROBING && IsPrinterIdle()) {
129128
dgus_display.PlaySound(3);
130129

131-
SetStatusMessage(ExtUI::getMeshValid() ? GET_TEXT_F(DGUS_MSG_PROBING_SUCCESS) : GET_TEXT_F(DGUS_MSG_PROBING_FAILED));
130+
SetStatusMessage(ExtUI::getLevelingIsValid() ? GET_TEXT_F(DGUS_MSG_PROBING_SUCCESS) : GET_TEXT_F(DGUS_MSG_PROBING_FAILED));
132131

133132
MoveToScreen(DGUS_Screen::LEVELING_AUTOMATIC);
134133
return;
@@ -190,7 +189,7 @@ void DGUSScreenHandler::StoreSettings(char *buff) {
190189
data.initialized = true;
191190
data.volume = dgus_display.GetVolume();
192191
data.brightness = dgus_display.GetBrightness();
193-
data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getMeshValid());
192+
data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getLevelingIsValid());
194193

195194
memcpy(buff, &data, sizeof(data));
196195
}
@@ -206,7 +205,7 @@ void DGUSScreenHandler::LoadSettings(const char *buff) {
206205
dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS);
207206

208207
if (data.initialized) {
209-
leveling_active = (data.abl_okay && ExtUI::getMeshValid());
208+
leveling_active = (data.abl_okay && ExtUI::getLevelingIsValid());
210209
ExtUI::setLevelingActive(leveling_active);
211210
}
212211
}
@@ -247,7 +246,7 @@ void DGUSScreenHandler::MeshUpdate(const int8_t xpos, const int8_t ypos) {
247246
uint8_t point = ypos * GRID_MAX_POINTS_X + xpos;
248247
probing_icons[point < 16 ? 0 : 1] |= (1U << (point % 16));
249248

250-
if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getMeshValid())
249+
if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getLevelingIsValid())
251250
probing_icons[0] = probing_icons[1] = 0;
252251

253252
TriggerFullUpdate();

β€ŽMarlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ bool DGUSSetupHandler::LevelingOffset() {
136136
}
137137

138138
bool DGUSSetupHandler::LevelingAutomatic() {
139-
if (ExtUI::getMeshValid()) {
139+
if (ExtUI::getLevelingIsValid()) {
140140
dgus_screen_handler.leveling_active = true;
141141

142142
ExtUI::setLevelingActive(true);

β€ŽMarlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ namespace ExtUI {
108108
dgus_screen_handler.ConfigurationStoreRead(success);
109109
}
110110

111-
#if HAS_MESH
111+
#if HAS_LEVELING
112112
void onLevelingStart() {}
113113
void onLevelingDone() {}
114+
#endif
114115

116+
#if HAS_MESH
115117
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
116118
dgus_screen_handler.MeshUpdate(xpos, ypos);
117119
}

β€ŽMarlin/src/lcd/extui/example/example.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ namespace ExtUI {
9898
// whether successful or not.
9999
}
100100

101-
#if HAS_MESH
101+
#if HAS_LEVELING
102102
void onLevelingStart() {}
103103
void onLevelingDone() {}
104+
#endif
104105

106+
#if HAS_MESH
105107
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
106108
// Called when any mesh points are updated
107109
}

β€ŽMarlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ namespace ExtUI {
117117
ConfirmUserRequestAlertBox::hide();
118118
}
119119

120-
#if HAS_LEVELING && HAS_MESH
120+
#if HAS_LEVELING
121121
void onLevelingStart() {}
122122
void onLevelingDone() {}
123+
#endif
124+
125+
#if HAS_MESH
123126
void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) { BedMeshViewScreen::onMeshUpdate(x, y, val); }
124127
void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { BedMeshViewScreen::onMeshUpdate(x, y, state); }
125128
#endif

β€ŽMarlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void BedMeshEditScreen::setHighlightedValue(float value) {
9595
}
9696

9797
void BedMeshEditScreen::moveToHighlightedValue() {
98-
if (ExtUI::getMeshValid()) {
98+
if (ExtUI::getLevelingIsValid()) {
9999
ExtUI::setLevelingActive(true);
100100
ExtUI::setSoftEndstopState(false);
101101
ExtUI::moveToMeshPoint(mydata.highlight, gaugeThickness + mydata.zAdjustment);

β€ŽMarlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void BedMeshViewScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI
125125
mydata.count = 0;
126126
break;
127127
case ExtUI::G29_FINISH:
128-
if (mydata.count == GRID_MAX_POINTS && ExtUI::getMeshValid())
128+
if (mydata.count == GRID_MAX_POINTS && ExtUI::getLevelingIsValid())
129129
mydata.message = GET_TEXT_F(MSG_BED_MAPPING_DONE);
130130
else
131131
mydata.message = GET_TEXT_F(MSG_BED_MAPPING_INCOMPLETE);

β€ŽMarlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void onSettingsStored(const bool success) {
311311

312312
void onSettingsLoaded(const bool success) {
313313
#if HAS_MESH
314-
if (ExtUI::getMeshValid()) {
314+
if (ExtUI::getLevelingIsValid()) {
315315
uint8_t abl_probe_index = 0;
316316
for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++)
317317
for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) {
@@ -371,7 +371,7 @@ void onLevelingStart() {}
371371

372372
void onLevelingDone() {
373373
#if HAS_MESH
374-
if (ExtUI::getMeshValid()) {
374+
if (ExtUI::getLevelingIsValid()) {
375375
uint8_t abl_probe_index = 0;
376376
for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++)
377377
for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) {

β€ŽMarlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ void RTS::handleData() {
10431043
#if HAS_MESH
10441044
sendData(getLevelingActive() ? 3 : 2, AutoLevelIcon);
10451045

1046-
if (ExtUI::getMeshValid()) {
1046+
if (ExtUI::getLevelingIsValid()) {
10471047
uint8_t abl_probe_index = 0;
10481048
for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++)
10491049
for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) {

β€ŽMarlin/src/lcd/extui/malyan/malyan_extui.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,14 @@ namespace ExtUI {
150150
void onSettingsStored(const bool) {}
151151
void onSettingsLoaded(const bool) {}
152152

153-
#if HAS_MESH
153+
#if HAS_LEVELING
154154
void onLevelingStart() {}
155155
void onLevelingDone() {}
156-
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {}
157-
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
156+
#endif
157+
158+
#if HAS_MESH
159+
void onMeshUpdate(const int8_t, const int8_t, const_float_t) {}
160+
void onMeshUpdate(const int8_t, const int8_t, const ExtUI::probe_state_t) {}
158161
#endif
159162

160163
#if ENABLED(POWER_LOSS_RECOVERY)

β€ŽMarlin/src/lcd/extui/nextion/nextion_extui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ namespace ExtUI {
8989
// whether successful or not.
9090
}
9191

92-
#if HAS_MESH
92+
#if HAS_LEVELING
9393
void onLevelingStart() {}
9494
void onLevelingDone() {}
95+
#endif
9596

97+
#if HAS_MESH
9698
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
9799
// Called when any mesh points are updated
98100
}

β€ŽMarlin/src/lcd/extui/ui_api.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ namespace ExtUI {
919919

920920
bool getLevelingActive() { return planner.leveling_active; }
921921
void setLevelingActive(const bool state) { set_bed_leveling_enabled(state); }
922-
bool getMeshValid() { return leveling_is_valid(); }
922+
bool getLevelingIsValid() { return leveling_is_valid(); }
923923

924924
#if HAS_MESH
925925

β€ŽMarlin/src/lcd/extui/ui_api.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ namespace ExtUI {
172172
#if HAS_LEVELING
173173
bool getLevelingActive();
174174
void setLevelingActive(const bool);
175-
bool getMeshValid();
175+
bool getLevelingIsValid();
176+
void onLevelingStart();
177+
void onLevelingDone();
176178
#if HAS_MESH
177179
bed_mesh_t& getMeshArray();
178180
float getMeshPoint(const xy_uint8_t &pos);
179181
void setMeshPoint(const xy_uint8_t &pos, const_float_t zval);
180182
void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z);
181-
void onLevelingStart();
182-
void onLevelingDone();
183183
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval);
184184
inline void onMeshUpdate(const xy_int8_t &pos, const_float_t zval) { onMeshUpdate(pos.x, pos.y, zval); }
185185

0 commit comments

Comments
Β (0)