mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 09:17:56 +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 = [];
|
||||
btnStop.css("display","block"); // hack
|
||||
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
|
||||
} else {
|
||||
// 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() {
|
||||
this.wifiboxURL;
|
||||
this.wifiboxCGIBinURL
|
||||
|
@ -160,11 +160,8 @@ function initButtonBehavior() {
|
||||
loadSettings();
|
||||
});
|
||||
}*/
|
||||
btnSettings.bind('touchstart mousedown',function () {
|
||||
//e.preventDefault();
|
||||
//console.log("btnSettings clicked");
|
||||
settingsWindow.showSettings();
|
||||
});
|
||||
enableButton(btnSettings, openSettingsWindow);
|
||||
|
||||
// btnSettings.on('touchend', function(e) {
|
||||
// e.preventDefault();
|
||||
// console.log("btnSettings touchend");
|
||||
@ -350,9 +347,9 @@ function setState(newState,newHasControl) {
|
||||
|
||||
// thermometer
|
||||
switch(newState) {
|
||||
case Printer.IDLE_STATE:
|
||||
case Printer.BUFFERING_STATE:
|
||||
case Printer.PRINTING_STATE:
|
||||
case Printer.IDLE_STATE: /* fall-through */
|
||||
case Printer.BUFFERING_STATE: /* fall-through */
|
||||
case Printer.PRINTING_STATE: /* fall-through */
|
||||
case Printer.STOPPING_STATE:
|
||||
thermometer.show();
|
||||
break;
|
||||
@ -371,6 +368,22 @@ function setState(newState,newHasControl) {
|
||||
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) {
|
||||
message.set("Lost connection to WiFi box",Message.ERROR);
|
||||
} 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 ||
|
||||
prevState == Printer.UNKNOWN_STATE && newState == Printer.IDLE_STATE) {
|
||||
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;
|
||||
|
@ -142,7 +142,7 @@ function generate_gcode() {
|
||||
console.log("pointsToPrint: ",pointsToPrint);
|
||||
|
||||
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");
|
||||
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() {
|
||||
console.log("f:showOrHideThermo()");
|
||||
if (showOrHide) {
|
||||
|
Loading…
Reference in New Issue
Block a user