|
|
@ -179,6 +179,15 @@ void DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send the current print progress to the display.
|
|
|
|
|
|
|
|
void DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) {
|
|
|
|
|
|
|
|
//DEBUG_ECHOPAIR(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
|
|
|
|
|
|
|
|
uint16_t tmp = ExtUI::getProgress_percent();
|
|
|
|
|
|
|
|
//DEBUG_ECHOLNPAIR(" data ", tmp);
|
|
|
|
|
|
|
|
uint16_t data_to_send = swap16(tmp);
|
|
|
|
|
|
|
|
dgusdisplay.WriteVariable(var.VP, data_to_send);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Send the current print time to the display.
|
|
|
|
// Send the current print time to the display.
|
|
|
|
// It is using a hex display for that: It expects BSD coded data in the format xxyyzz
|
|
|
|
// It is using a hex display for that: It expects BSD coded data in the format xxyyzz
|
|
|
|
void DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
|
|
|
|
void DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
|
|
|
@ -465,7 +474,7 @@ void DGUSScreenVariableHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *v
|
|
|
|
const uint16_t* DGUSLCD_FindScreenVPMapList(uint8_t screen) {
|
|
|
|
const uint16_t* DGUSLCD_FindScreenVPMapList(uint8_t screen) {
|
|
|
|
const uint16_t *ret;
|
|
|
|
const uint16_t *ret;
|
|
|
|
const struct VPMapping *map = VPMap;
|
|
|
|
const struct VPMapping *map = VPMap;
|
|
|
|
while (ret = (uint16_t*) pgm_read_word(&(map->VPList))) {
|
|
|
|
while (ret = (uint16_t*) pgm_read_ptr(&(map->VPList))) {
|
|
|
|
if (pgm_read_byte(&(map->screen)) == screen) return ret;
|
|
|
|
if (pgm_read_byte(&(map->screen)) == screen) return ret;
|
|
|
|
map++;
|
|
|
|
map++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -846,8 +855,8 @@ void DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable
|
|
|
|
void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
|
|
|
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");
|
|
|
|
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t value = swap16(*(uint16_t*)val_ptr)/100;
|
|
|
|
const float offset = float(swap16(*(uint16_t*)val_ptr)) / 100.0f;
|
|
|
|
ExtUI::setZOffset_mm(value);
|
|
|
|
ExtUI::setZOffset_mm(offset);
|
|
|
|
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
|
|
|
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -858,7 +867,7 @@ void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var,
|
|
|
|
|
|
|
|
|
|
|
|
int16_t flag = swap16(*(uint16_t*)val_ptr);
|
|
|
|
int16_t flag = swap16(*(uint16_t*)val_ptr);
|
|
|
|
int16_t steps = flag ? -20 : 20;
|
|
|
|
int16_t steps = flag ? -20 : 20;
|
|
|
|
ExtUI::smartAdjustAxis_steps(steps,ExtUI::axis_t::Z,true);
|
|
|
|
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
|
|
|
|
ScreenHandler.ForceCompleteUpdate();
|
|
|
|
ScreenHandler.ForceCompleteUpdate();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1307,11 +1316,8 @@ void DGUSDisplay::ProcessRx() {
|
|
|
|
//DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
|
|
|
|
//DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
|
|
|
|
DGUS_VP_Variable ramcopy;
|
|
|
|
DGUS_VP_Variable ramcopy;
|
|
|
|
if (populate_VPVar(vp, &ramcopy)) {
|
|
|
|
if (populate_VPVar(vp, &ramcopy)) {
|
|
|
|
if (!(dlen == ramcopy.size || (dlen == 2 && ramcopy.size == 1)))
|
|
|
|
if (ramcopy.set_by_display_handler)
|
|
|
|
DEBUG_ECHOLNPGM("SIZE MISMATCH");
|
|
|
|
|
|
|
|
else if (ramcopy.set_by_display_handler) {
|
|
|
|
|
|
|
|
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
|
|
|
|
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
|
|
|
|
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|