Show clock when printer is idle
parent
3ce8238993
commit
aa3bba84a0
|
|
@ -209,6 +209,8 @@ void OctoPrintClient::getPrinterJobResults() {
|
||||||
|
|
||||||
if (isOperational()) {
|
if (isOperational()) {
|
||||||
Serial.println("Status: " + printerData.state);
|
Serial.println("Status: " + printerData.state);
|
||||||
|
} else if (isIdle()) {
|
||||||
|
Serial.println("Printer Is Idle");
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Printer Not Operational");
|
Serial.println("Printer Not Operational");
|
||||||
}
|
}
|
||||||
|
|
@ -353,6 +355,10 @@ boolean OctoPrintClient::isPrinting() {
|
||||||
return printerData.isPrinting;
|
return printerData.isPrinting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean OctoPrintClient::isIdle() {
|
||||||
|
return isOperational() && !isPrinting();
|
||||||
|
}
|
||||||
|
|
||||||
boolean OctoPrintClient::isPSUoff() {
|
boolean OctoPrintClient::isPSUoff() {
|
||||||
return printerData.isPSUoff;
|
return printerData.isPSUoff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ public:
|
||||||
String getState();
|
String getState();
|
||||||
boolean isPrinting();
|
boolean isPrinting();
|
||||||
boolean isOperational();
|
boolean isOperational();
|
||||||
|
boolean isIdle();
|
||||||
boolean isPSUoff();
|
boolean isPSUoff();
|
||||||
String getTempBedActual();
|
String getTempBedActual();
|
||||||
String getTempBedTarget();
|
String getTempBedTarget();
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ void findMDNS() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//************************************************************
|
//************************************************************
|
||||||
// Main Looop
|
// Main Loop
|
||||||
//************************************************************
|
//************************************************************
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
|
|
@ -981,12 +981,16 @@ void drawClockHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) {
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||||
if (printerClient.isPSUoff()) {
|
if (printerClient.isPSUoff()) {
|
||||||
display->drawString(64, 47, "psu off");
|
display->drawString(64, 47, "psu off");
|
||||||
|
} else if (printerClient.isIdle()) {
|
||||||
|
display->drawString(64, 47, "idle");
|
||||||
} else {
|
} else {
|
||||||
display->drawString(64, 47, "offline");
|
display->drawString(64, 47, "offline");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (printerClient.isPSUoff()) {
|
if (printerClient.isPSUoff()) {
|
||||||
display->drawString(0, 47, "psu off");
|
display->drawString(0, 47, "psu off");
|
||||||
|
} else if (printerClient.isIdle()) {
|
||||||
|
display->drawString(0, 47, "idle");
|
||||||
} else {
|
} else {
|
||||||
display->drawString(0, 47, "offline");
|
display->drawString(0, 47, "offline");
|
||||||
}
|
}
|
||||||
|
|
@ -1218,7 +1222,7 @@ void checkDisplay() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (DISPLAYCLOCK) {
|
} else if (DISPLAYCLOCK) {
|
||||||
if ((!printerClient.isOperational() || printerClient.isPSUoff()) && !isClockOn) {
|
if ((!printerClient.isOperational() || printerClient.isIdle() || printerClient.isPSUoff()) && !isClockOn) {
|
||||||
Serial.println("Clock Mode is turned on.");
|
Serial.println("Clock Mode is turned on.");
|
||||||
if (!DISPLAYWEATHER) {
|
if (!DISPLAYWEATHER) {
|
||||||
ui.disableAutoTransition();
|
ui.disableAutoTransition();
|
||||||
|
|
@ -1232,7 +1236,7 @@ void checkDisplay() {
|
||||||
}
|
}
|
||||||
ui.setOverlays(clockOverlay, numberOfOverlays);
|
ui.setOverlays(clockOverlay, numberOfOverlays);
|
||||||
isClockOn = true;
|
isClockOn = true;
|
||||||
} else if (printerClient.isOperational() && !printerClient.isPSUoff() && isClockOn) {
|
} else if (printerClient.isOperational() && !printerClient.isIdle() && !printerClient.isPSUoff() && isClockOn) {
|
||||||
Serial.println("Printer Monitor is active.");
|
Serial.println("Printer Monitor is active.");
|
||||||
ui.setFrames(frames, numberOfFrames);
|
ui.setFrames(frames, numberOfFrames);
|
||||||
ui.setOverlays(overlays, numberOfOverlays);
|
ui.setOverlays(overlays, numberOfOverlays);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue