mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-12-22 13:13:48 +01:00
Only attempt preheat when printer is in idle mode and also preheat when new printer is connected
This commit is contained in:
parent
eef5307464
commit
8a4ab7c519
@ -331,6 +331,8 @@ function resetTwist() {
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
setState(printer.state,printer.hasControl);
|
||||
|
||||
thermometer.update(printer.temperature, printer.targetTemperature);
|
||||
@ -422,6 +424,10 @@ function setState(newState,newHasControl) {
|
||||
} else if(prevState == Printer.DISCONNECTED_STATE && newState == Printer.IDLE_STATE ||
|
||||
prevState == Printer.UNKNOWN_STATE && newState == Printer.IDLE_STATE) {
|
||||
message.set("Printer connected",Message.INFO,true);
|
||||
console.log(" preheat: ",settings["printer.heatup.enabled"]);
|
||||
if(settings["printer.heatup.enabled"]) {
|
||||
printer.preheat();
|
||||
}
|
||||
} else if(prevState == Printer.PRINTING_STATE && newState == Printer.STOPPING_STATE) {
|
||||
console.log("stopmsg show");
|
||||
message.set("Printer stopping",Message.INFO,false);
|
||||
|
@ -164,9 +164,11 @@ function showOrHideThermo() {
|
||||
|
||||
function settingsLoaded() {
|
||||
console.log("settingsLoaded");
|
||||
console.log("autoHeatup: ",settings["printer.heatup.enabled"]);
|
||||
|
||||
if(firstTimeSettingsLoaded) {
|
||||
if(settings["printer.heatup.enabled"]) {
|
||||
console.log(" preheat: ",settings["printer.heatup.enabled"]);
|
||||
console.log(" state: ",state);
|
||||
if(state == Printer.IDLE_STATE && settings["printer.heatup.enabled"]) {
|
||||
printer.preheat();
|
||||
}
|
||||
console.log("doodle3d.tour.enabled: ",settings["doodle3d.tour.enabled"]);
|
||||
|
Loading…
Reference in New Issue
Block a user