|
@@ -179,6 +179,15 @@ void DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable
|
179
|
179
|
}
|
180
|
180
|
}
|
181
|
181
|
|
|
182
|
+// Send the current print progress to the display.
|
|
183
|
+void DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) {
|
|
184
|
+ //DEBUG_ECHOPAIR(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
|
|
185
|
+ uint16_t tmp = ExtUI::getProgress_percent();
|
|
186
|
+ //DEBUG_ECHOLNPAIR(" data ", tmp);
|
|
187
|
+ uint16_t data_to_send = swap16(tmp);
|
|
188
|
+ dgusdisplay.WriteVariable(var.VP, data_to_send);
|
|
189
|
+}
|
|
190
|
+
|
182
|
191
|
// Send the current print time to the display.
|
183
|
192
|
// It is using a hex display for that: It expects BSD coded data in the format xxyyzz
|
184
|
193
|
void DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
|
|
@@ -465,7 +474,7 @@ void DGUSScreenVariableHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *v
|
465
|
474
|
const uint16_t* DGUSLCD_FindScreenVPMapList(uint8_t screen) {
|
466
|
475
|
const uint16_t *ret;
|
467
|
476
|
const struct VPMapping *map = VPMap;
|
468
|
|
- while (ret = (uint16_t*) pgm_read_word(&(map->VPList))) {
|
|
477
|
+ while (ret = (uint16_t*) pgm_read_ptr(&(map->VPList))) {
|
469
|
478
|
if (pgm_read_byte(&(map->screen)) == screen) return ret;
|
470
|
479
|
map++;
|
471
|
480
|
}
|
|
@@ -846,8 +855,8 @@ void DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable
|
846
|
855
|
void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
847
|
856
|
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");
|
848
|
857
|
|
849
|
|
- uint16_t value = swap16(*(uint16_t*)val_ptr)/100;
|
850
|
|
- ExtUI::setZOffset_mm(value);
|
|
858
|
+ const float offset = float(swap16(*(uint16_t*)val_ptr)) / 100.0f;
|
|
859
|
+ ExtUI::setZOffset_mm(offset);
|
851
|
860
|
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
852
|
861
|
return;
|
853
|
862
|
}
|
|
@@ -858,7 +867,7 @@ void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var,
|
858
|
867
|
|
859
|
868
|
int16_t flag = swap16(*(uint16_t*)val_ptr);
|
860
|
869
|
int16_t steps = flag ? -20 : 20;
|
861
|
|
- ExtUI::smartAdjustAxis_steps(steps,ExtUI::axis_t::Z,true);
|
|
870
|
+ ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
|
862
|
871
|
ScreenHandler.ForceCompleteUpdate();
|
863
|
872
|
return;
|
864
|
873
|
}
|
|
@@ -1307,11 +1316,8 @@ void DGUSDisplay::ProcessRx() {
|
1307
|
1316
|
//DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
|
1308
|
1317
|
DGUS_VP_Variable ramcopy;
|
1309
|
1318
|
if (populate_VPVar(vp, &ramcopy)) {
|
1310
|
|
- if (!(dlen == ramcopy.size || (dlen == 2 && ramcopy.size == 1)))
|
1311
|
|
- DEBUG_ECHOLNPGM("SIZE MISMATCH");
|
1312
|
|
- else if (ramcopy.set_by_display_handler) {
|
|
1319
|
+ if (ramcopy.set_by_display_handler)
|
1313
|
1320
|
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
|
1314
|
|
- }
|
1315
|
1321
|
else
|
1316
|
1322
|
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
|
1317
|
1323
|
}
|