mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 17:27:57 +01:00
Merge branch 'feature/printerdriver' of https://github.com/Doodle3D/doodle3d-client into feature/printerdriver
# By Wouter R (2) and peteruithoven (1) # Via Wouter R (2) and peteruithoven (1) * 'feature/printerdriver' of https://github.com/Doodle3D/doodle3d-client: Warning text improvement Fix spelling error. Disable settings button if printer is busy or no control access.
This commit is contained in:
commit
7057a92da6
@ -173,7 +173,7 @@ function Printer() {
|
|||||||
this.gcode = [];
|
this.gcode = [];
|
||||||
btnStop.css("display","block"); // hack
|
btnStop.css("display","block"); // hack
|
||||||
self.removeLeaveWarning();
|
self.removeLeaveWarning();
|
||||||
message.set("Doodle is sent to printer...",Message.INFO,true);
|
message.set("Doodle has been sent to printer...",Message.INFO,true);
|
||||||
//self.targetTemperature = settings["printer.temperature"]; // slight hack
|
//self.targetTemperature = settings["printer.temperature"]; // slight hack
|
||||||
} else {
|
} else {
|
||||||
// only if the state hasn't bin changed (by for example pressing stop) we send more gcode
|
// only if the state hasn't bin changed (by for example pressing stop) we send more gcode
|
||||||
|
@ -26,6 +26,11 @@ var settings = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//wrapper to prevent scoping issues in showSettings()
|
||||||
|
function openSettingsWindow() {
|
||||||
|
settingsWindow.showSettings();
|
||||||
|
}
|
||||||
|
|
||||||
function SettingsWindow() {
|
function SettingsWindow() {
|
||||||
this.wifiboxURL;
|
this.wifiboxURL;
|
||||||
this.wifiboxCGIBinURL
|
this.wifiboxCGIBinURL
|
||||||
|
@ -160,11 +160,8 @@ function initButtonBehavior() {
|
|||||||
loadSettings();
|
loadSettings();
|
||||||
});
|
});
|
||||||
}*/
|
}*/
|
||||||
btnSettings.bind('touchstart mousedown',function () {
|
enableButton(btnSettings, openSettingsWindow);
|
||||||
//e.preventDefault();
|
|
||||||
//console.log("btnSettings clicked");
|
|
||||||
settingsWindow.showSettings();
|
|
||||||
});
|
|
||||||
// btnSettings.on('touchend', function(e) {
|
// btnSettings.on('touchend', function(e) {
|
||||||
// e.preventDefault();
|
// e.preventDefault();
|
||||||
// console.log("btnSettings touchend");
|
// console.log("btnSettings touchend");
|
||||||
@ -350,9 +347,9 @@ function setState(newState,newHasControl) {
|
|||||||
|
|
||||||
// thermometer
|
// thermometer
|
||||||
switch(newState) {
|
switch(newState) {
|
||||||
case Printer.IDLE_STATE:
|
case Printer.IDLE_STATE: /* fall-through */
|
||||||
case Printer.BUFFERING_STATE:
|
case Printer.BUFFERING_STATE: /* fall-through */
|
||||||
case Printer.PRINTING_STATE:
|
case Printer.PRINTING_STATE: /* fall-through */
|
||||||
case Printer.STOPPING_STATE:
|
case Printer.STOPPING_STATE:
|
||||||
thermometer.show();
|
thermometer.show();
|
||||||
break;
|
break;
|
||||||
@ -371,6 +368,22 @@ function setState(newState,newHasControl) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* settings button */
|
||||||
|
switch(newState) {
|
||||||
|
case Printer.IDLE_STATE:
|
||||||
|
enableButton(btnSettings, openSettingsWindow);
|
||||||
|
break;
|
||||||
|
case Printer.WIFIBOX_DISCONNECTED_STATE: /* fall-through */
|
||||||
|
case Printer.BUFFERING_STATE: /* fall-through */
|
||||||
|
case Printer.PRINTING_STATE: /* fall-through */
|
||||||
|
case Printer.STOPPING_STATE:
|
||||||
|
disableButton(btnSettings);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
enableButton(btnSettings, openSettingsWindow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(newState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
if(newState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
||||||
message.set("Lost connection to WiFi box",Message.ERROR);
|
message.set("Lost connection to WiFi box",Message.ERROR);
|
||||||
} else if(prevState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
} else if(prevState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
||||||
@ -380,6 +393,12 @@ 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);
|
||||||
|
} else if(prevState == Printer.PRINTING_STATE && newState == Printer.STOPPING_STATE) {
|
||||||
|
console.log("stopmsg show");
|
||||||
|
message.set("Printer stopping",Message.INFO,false);
|
||||||
|
} else if(prevState == Printer.STOPPING_STATE && newState == Printer.IDLE_STATE) {
|
||||||
|
console.log("stopmsg hide");
|
||||||
|
message.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
state = newState;
|
state = newState;
|
||||||
|
@ -142,7 +142,7 @@ function generate_gcode() {
|
|||||||
console.log("pointsToPrint: ",pointsToPrint);
|
console.log("pointsToPrint: ",pointsToPrint);
|
||||||
|
|
||||||
if(pointsToPrint > MAX_POINTS_TO_PRINT) {
|
if(pointsToPrint > MAX_POINTS_TO_PRINT) {
|
||||||
alert("Sorry, your doodle too complex and / or to high");
|
alert("Sorry, your doodle is too complex or too high. Please try to simplify it.");
|
||||||
console.log("ERROR: to many points too convert to gcode");
|
console.log("ERROR: to many points too convert to gcode");
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,19 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function enableButton(elem, handler) {
|
||||||
|
//var elem = $('#'+domId);
|
||||||
|
elem.removeClass("disabled");
|
||||||
|
elem.unbind('touchstart mousedown');
|
||||||
|
elem.bind('touchstart mousedown', handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
function disableButton(elem) {
|
||||||
|
//var elem = $('#'+domId);
|
||||||
|
elem.addClass("disabled");
|
||||||
|
elem.unbind('touchstart mousedown');
|
||||||
|
}
|
||||||
|
|
||||||
function showOrHideThermo() {
|
function showOrHideThermo() {
|
||||||
console.log("f:showOrHideThermo()");
|
console.log("f:showOrHideThermo()");
|
||||||
if (showOrHide) {
|
if (showOrHide) {
|
||||||
|
Loading…
Reference in New Issue
Block a user