Qrome - updated to only display print status when printing
parent
f3fe61eac9
commit
6e3ce067f6
|
|
@ -236,6 +236,8 @@ void OctoPrintClient::getPrinterJobResults() {
|
||||||
String printing = (const char*)root2["state"]["flags"]["printing"];
|
String printing = (const char*)root2["state"]["flags"]["printing"];
|
||||||
if (printing == "true") {
|
if (printing == "true") {
|
||||||
printerData.isPrinting = true;
|
printerData.isPrinting = true;
|
||||||
|
} else {
|
||||||
|
printerData.isPrinting = false;
|
||||||
}
|
}
|
||||||
printerData.toolTemp = (const char*)root2["temperature"]["tool0"]["actual"];
|
printerData.toolTemp = (const char*)root2["temperature"]["tool0"]["actual"];
|
||||||
printerData.toolTargetTemp = (const char*)root2["temperature"]["tool0"]["target"];
|
printerData.toolTargetTemp = (const char*)root2["temperature"]["tool0"]["target"];
|
||||||
|
|
|
||||||
|
|
@ -293,9 +293,9 @@ String RepetierClient::getProgressPrintTimeLeft() {
|
||||||
}
|
}
|
||||||
|
|
||||||
String RepetierClient::getState() {
|
String RepetierClient::getState() {
|
||||||
String rtnValue = "Printer is OFF";
|
String rtnValue = "Offline";
|
||||||
if (printerData.state == "1") {
|
if (printerData.state == "1") {
|
||||||
rtnValue = "Printer is ON";
|
rtnValue = "Operational";
|
||||||
}
|
}
|
||||||
return rtnValue;
|
return rtnValue;
|
||||||
}
|
}
|
||||||
|
|
@ -310,7 +310,7 @@ boolean RepetierClient::isPSUoff() {
|
||||||
|
|
||||||
boolean RepetierClient::isOperational() {
|
boolean RepetierClient::isOperational() {
|
||||||
boolean operational = false;
|
boolean operational = false;
|
||||||
if (printerData.state == "Operational" || isPrinting()) {
|
if (printerData.state == "1" || isPrinting()) {
|
||||||
operational = true;
|
operational = true;
|
||||||
}
|
}
|
||||||
return operational;
|
return operational;
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ void setup() {
|
||||||
display.drawString(64, 20, "Enable in Settings.h");
|
display.drawString(64, 20, "Enable in Settings.h");
|
||||||
display.display();
|
display.display();
|
||||||
}
|
}
|
||||||
flashLED(5, 500);
|
flashLED(5, 100);
|
||||||
findMDNS(); //go find Printer Server by the hostname
|
findMDNS(); //go find Printer Server by the hostname
|
||||||
Serial.println("*** Leaving setup()");
|
Serial.println("*** Leaving setup()");
|
||||||
}
|
}
|
||||||
|
|
@ -912,7 +912,8 @@ void drawScreen1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||||
display->setFont(ArialMT_Plain_16);
|
display->setFont(ArialMT_Plain_16);
|
||||||
if (bed != "0") {
|
if (bed != "0") {
|
||||||
display->drawString(64 + x, 0 + y, "Bed / Tool Temp");
|
display->drawString(29 + x, 0 + y, "Tool");
|
||||||
|
display->drawString(89 + x, 0 + y, "Bed");
|
||||||
} else {
|
} else {
|
||||||
display->drawString(64 + x, 0 + y, "Tool Temp");
|
display->drawString(64 + x, 0 + y, "Tool Temp");
|
||||||
}
|
}
|
||||||
|
|
@ -920,8 +921,8 @@ void drawScreen1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int
|
||||||
display->setFont(ArialMT_Plain_24);
|
display->setFont(ArialMT_Plain_24);
|
||||||
if (bed != "0") {
|
if (bed != "0") {
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
display->drawString(2 + x, 14 + y, bed + "°");
|
display->drawString(12 + x, 14 + y, tool + "°");
|
||||||
display->drawString(64 + x, 14 + y, tool + "°");
|
display->drawString(74 + x, 14 + y, bed + "°");
|
||||||
} else {
|
} else {
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||||
display->drawString(64 + x, 14 + y, tool + "°");
|
display->drawString(64 + x, 14 + y, tool + "°");
|
||||||
|
|
@ -1064,12 +1065,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.getState() == "Operational") {
|
||||||
|
display->drawString(64, 47, "online");
|
||||||
} 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.getState() == "Operational") {
|
||||||
|
display->drawString(0, 47, "online");
|
||||||
} else {
|
} else {
|
||||||
display->drawString(0, 47, "offline");
|
display->drawString(0, 47, "offline");
|
||||||
}
|
}
|
||||||
|
|
@ -1284,7 +1289,7 @@ void checkDisplay() {
|
||||||
if (!displayOn && DISPLAYCLOCK) {
|
if (!displayOn && DISPLAYCLOCK) {
|
||||||
enableDisplay(true);
|
enableDisplay(true);
|
||||||
}
|
}
|
||||||
if (displayOn && !(printerClient.isOperational() || printerClient.isPrinting()) && !DISPLAYCLOCK) {
|
if (displayOn && !printerClient.isPrinting() && !DISPLAYCLOCK) {
|
||||||
// Put Display to sleep
|
// Put Display to sleep
|
||||||
display.clear();
|
display.clear();
|
||||||
display.display();
|
display.display();
|
||||||
|
|
@ -1313,7 +1318,7 @@ void checkDisplay() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (DISPLAYCLOCK) {
|
} else if (DISPLAYCLOCK) {
|
||||||
if ((!printerClient.isOperational() || printerClient.isPSUoff()) && !isClockOn) {
|
if ((!printerClient.isPrinting() || 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();
|
||||||
|
|
@ -1327,7 +1332,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.isPrinting() && !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