0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 17:27:57 +01:00

Only attempt preheat when printer is in idle mode and also preheat when new printer is connected

This commit is contained in:
peteruithoven 2014-01-27 13:19:20 +01:00
parent eef5307464
commit 8a4ab7c519
2 changed files with 10 additions and 2 deletions

View File

@ -331,6 +331,8 @@ function resetTwist() {
} }
function update() { function update() {
setState(printer.state,printer.hasControl); setState(printer.state,printer.hasControl);
thermometer.update(printer.temperature, printer.targetTemperature); thermometer.update(printer.temperature, printer.targetTemperature);
@ -422,6 +424,10 @@ function setState(newState,newHasControl) {
} else if(prevState == Printer.DISCONNECTED_STATE && newState == Printer.IDLE_STATE || } else if(prevState == Printer.DISCONNECTED_STATE && newState == Printer.IDLE_STATE ||
prevState == Printer.UNKNOWN_STATE && newState == Printer.IDLE_STATE) { prevState == Printer.UNKNOWN_STATE && newState == Printer.IDLE_STATE) {
message.set("Printer connected",Message.INFO,true); 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) { } else if(prevState == Printer.PRINTING_STATE && newState == Printer.STOPPING_STATE) {
console.log("stopmsg show"); console.log("stopmsg show");
message.set("Printer stopping",Message.INFO,false); message.set("Printer stopping",Message.INFO,false);

View File

@ -164,9 +164,11 @@ function showOrHideThermo() {
function settingsLoaded() { function settingsLoaded() {
console.log("settingsLoaded"); console.log("settingsLoaded");
console.log("autoHeatup: ",settings["printer.heatup.enabled"]);
if(firstTimeSettingsLoaded) { 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(); printer.preheat();
} }
console.log("doodle3d.tour.enabled: ",settings["doodle3d.tour.enabled"]); console.log("doodle3d.tour.enabled: ",settings["doodle3d.tour.enabled"]);