commit
b1fa89a492
|
|
@ -287,3 +287,9 @@ String OctoPrintClient::getFilamentLength() {
|
||||||
String OctoPrintClient::getError() {
|
String OctoPrintClient::getError() {
|
||||||
return printerData.error;
|
return printerData.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String OctoPrintClient::getValueRounded(String value) {
|
||||||
|
float f = value.toFloat();
|
||||||
|
int rounded = (int)(f+0.5f);
|
||||||
|
return String(rounded);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ public:
|
||||||
String getTempToolActual();
|
String getTempToolActual();
|
||||||
String getTempToolTarget();
|
String getTempToolTarget();
|
||||||
String getFilamentLength();
|
String getFilamentLength();
|
||||||
|
String getValueRounded(String value);
|
||||||
String getError();
|
String getError();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ const boolean INVERT_DISPLAY = false; // true = pins at top | false = pins at th
|
||||||
//#define DISPLAY_SH1106 // Uncomment this line to use the SH1106 display -- SSD1306 is used by default and is most common
|
//#define DISPLAY_SH1106 // Uncomment this line to use the SH1106 display -- SSD1306 is used by default and is most common
|
||||||
|
|
||||||
boolean ENABLE_OTA = true; // this will allow you to load firmware to the device over WiFi (see OTA for ESP8266)
|
boolean ENABLE_OTA = true; // this will allow you to load firmware to the device over WiFi (see OTA for ESP8266)
|
||||||
|
String OTA_Password = ""; // Set an OTA password here -- leave blank if you don't want to be prompted for password
|
||||||
//******************************
|
//******************************
|
||||||
// End Settings
|
// End Settings
|
||||||
//******************************
|
//******************************
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#define VERSION "1.6"
|
#define VERSION "1.7"
|
||||||
|
|
||||||
#define HOSTNAME "OctMon-"
|
#define HOSTNAME "OctMon-"
|
||||||
#define CONFIG "/conf.txt"
|
#define CONFIG "/conf.txt"
|
||||||
|
|
@ -229,6 +229,9 @@ void setup() {
|
||||||
else if (error == OTA_END_ERROR) Serial.println("End Failed");
|
else if (error == OTA_END_ERROR) Serial.println("End Failed");
|
||||||
});
|
});
|
||||||
ArduinoOTA.setHostname((const char *)hostname.c_str());
|
ArduinoOTA.setHostname((const char *)hostname.c_str());
|
||||||
|
if (OTA_Password != "") {
|
||||||
|
ArduinoOTA.setPassword(((const char *)OTA_Password.c_str()));
|
||||||
|
}
|
||||||
ArduinoOTA.begin();
|
ArduinoOTA.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -630,10 +633,10 @@ void drawScreen1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int
|
||||||
display->drawString(64 + x, 0 + y, "Bed / Tool Temp");
|
display->drawString(64 + x, 0 + y, "Bed / Tool Temp");
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
display->setFont(ArialMT_Plain_24);
|
display->setFont(ArialMT_Plain_24);
|
||||||
int bed = printerClient.getTempBedActual().toInt();
|
String bed = printerClient.getValueRounded(printerClient.getTempBedActual());
|
||||||
int tool = printerClient.getTempToolActual().toInt();
|
String tool = printerClient.getValueRounded(printerClient.getTempToolActual());
|
||||||
display->drawString(2 + x, 14 + y, String(bed) + "°");
|
display->drawString(2 + x, 14 + y, bed + "°");
|
||||||
display->drawString(64 + x, 14 + y, String(tool) + "°");
|
display->drawString(64 + x, 14 + y, tool + "°");
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawScreen2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
|
void drawScreen2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue