Added Update info & Layer / Time info on webpage
Added Time till next update Added Layer & Estimated Time in webpagepull/136/head
parent
1109ef250f
commit
de1c6a100d
|
|
@ -64,12 +64,13 @@ void drawScreen5(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int
|
|||
void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state);
|
||||
void drawClock(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
|
||||
void drawWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
|
||||
void drawUpdate(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);
|
||||
void drawClockHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state);
|
||||
|
||||
// Set the number of Frames supported
|
||||
const int numberOfFrames = 5;
|
||||
FrameCallback frames[numberOfFrames];
|
||||
FrameCallback clockFrame[2];
|
||||
FrameCallback clockFrame[3];
|
||||
boolean isClockOn = false;
|
||||
|
||||
OverlayCallback overlays[] = { drawHeaderOverlay };
|
||||
|
|
@ -265,6 +266,7 @@ void setup() {
|
|||
frames[4] = drawScreen5;
|
||||
clockFrame[0] = drawClock;
|
||||
clockFrame[1] = drawWeather;
|
||||
clockFrame[2] = drawUpdate;
|
||||
ui.setOverlays(overlays, numberOfOverlays);
|
||||
|
||||
// Inital UI takes care of initalising the display too.
|
||||
|
|
@ -755,7 +757,7 @@ String getFooter() {
|
|||
if (lastReportStatus != "") {
|
||||
html += "<i class='fa fa-external-link'></i> Report Status: " + lastReportStatus + "<br>";
|
||||
}
|
||||
html += "<i class='fa fa-paper-plane-o'></i> Version: " + String(VERSION) + "<br>";
|
||||
html += "<i class='fa fa-paper-plane-o'></i> Version: " + String(VERSION) + " Next Update: " + getTimeTillUpdate() + "<br>";
|
||||
html += "<i class='fa fa-rss'></i> Signal Strength: ";
|
||||
html += String(rssi) + "%";
|
||||
html += "</footer>";
|
||||
|
|
@ -810,6 +812,12 @@ void displayPrinterStatus() {
|
|||
float fLength = float(filamentLength) / 1000;
|
||||
html += "Filament: " + String(fLength) + "m<br>";
|
||||
}
|
||||
if (printerClient.isPrinting()) {
|
||||
html += "Layer: " + printerClient.getCurrentLayer() + " / " + printerClient.getTotalLayers() + "<br>";
|
||||
}
|
||||
if (printerClient.isPrinting()) {
|
||||
html += "Estimated Finish Time: " + printerClient.getEstimatedEndTime() + "<br>";
|
||||
}
|
||||
|
||||
html += "Tool Temperature: " + printerClient.getTempToolActual() + "° C<br>";
|
||||
if ( printerClient.getTempBedActual() != 0 ) {
|
||||
|
|
@ -1025,6 +1033,39 @@ void drawWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int
|
|||
display->drawString(86 + x, 0 + y, weatherClient.getWeatherIcon(0));
|
||||
}
|
||||
|
||||
void drawUpdate(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
|
||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||
display->setFont(ArialMT_Plain_16);
|
||||
|
||||
display->drawString(64 + x, 0 + y, "Next Update:");
|
||||
//display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
display->setFont(ArialMT_Plain_24);
|
||||
|
||||
display->drawString(64 + x, 14 + y, getTimeTillUpdate());
|
||||
}
|
||||
|
||||
String getTimeTillUpdate() {
|
||||
String rtnValue = "";
|
||||
|
||||
long timeToUpdate = (((minutesBetweenDataRefresh * 60) + lastEpoch) - timeClient.getCurrentEpoch());
|
||||
|
||||
int hours = numberOfHours(timeToUpdate);
|
||||
int minutes = numberOfMinutes(timeToUpdate);
|
||||
int seconds = numberOfSeconds(timeToUpdate);
|
||||
|
||||
rtnValue += String(hours) + ":";
|
||||
if (minutes < 10) {
|
||||
rtnValue += "0";
|
||||
}
|
||||
rtnValue += String(minutes) + ":";
|
||||
if (seconds < 10) {
|
||||
rtnValue += "0";
|
||||
}
|
||||
rtnValue += String(seconds);
|
||||
|
||||
return rtnValue;
|
||||
}
|
||||
|
||||
String getTempSymbol() {
|
||||
return getTempSymbol(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue