mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2025-01-08 11:14:28 +01:00
added the 'l=1' switch which provides a limited user-interface
This commit is contained in:
parent
5a91fa480c
commit
4b0fdc1bc1
@ -49,31 +49,31 @@ function initKeyboard() {
|
|||||||
var ch = String.fromCharCode(event.which);
|
var ch = String.fromCharCode(event.which);
|
||||||
|
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'c': newSketch(); break;
|
case '+': case '=': zoomShape(1.05); break;
|
||||||
case 'n': newSketch(); break;
|
|
||||||
case 'p': print(); break;
|
|
||||||
case 'u': oopsUndo(); break;
|
|
||||||
case 'g': settingsWindow.downloadGcode(); break;
|
|
||||||
case 'q': stopPrint(); break;
|
|
||||||
case ',': openSettingsWindow(); break;
|
case ',': openSettingsWindow(); break;
|
||||||
case 'h': previewUp(true); break;
|
case '-': zoomShape(.95); break;
|
||||||
|
case ';': moveShape(-5,0); break;
|
||||||
|
case '[': previewTwistLeft(); break;
|
||||||
|
case '\'': moveShape(5,0); break;
|
||||||
|
case ']': previewTwistRight(); break;
|
||||||
|
case 'c': newSketch(); break;
|
||||||
|
case 'f': showTravelLines=!showTravelLines; redrawDoodle(); break;
|
||||||
|
case 'g': settingsWindow.downloadGcode(); break;
|
||||||
case 'H': previewDown(true); break;
|
case 'H': previewDown(true); break;
|
||||||
case 's': saveSketch(); break;
|
case 'h': previewUp(true); break;
|
||||||
|
case 'i': showShapeDialog(); break;
|
||||||
case 'L': nextSketch(); break;
|
case 'L': nextSketch(); break;
|
||||||
case 'l': prevSketch(); break;
|
case 'l': prevSketch(); break;
|
||||||
case '[': previewTwistLeft(); break;
|
case 'n': newSketch(); break;
|
||||||
case ']': previewTwistRight(); break;
|
case 'p': print(); break;
|
||||||
case '|': resetTwist(); break;
|
case 'q': stopPrint(); break;
|
||||||
case 't': showWordArtDialog(); break;
|
|
||||||
case 'i': showShapeDialog(); break;
|
|
||||||
case 'T': showScanDialog(); break;
|
|
||||||
|
|
||||||
case ';': moveShape(-5,0); break;
|
|
||||||
case '\'': moveShape(5,0); break;
|
|
||||||
case '-': zoomShape(.95); break;
|
|
||||||
case '+': zoomShape(1.05); break;
|
|
||||||
case 'r': rotateShape(.1); break;
|
|
||||||
case 'R': rotateShape(-.1); break;
|
case 'R': rotateShape(-.1); break;
|
||||||
|
case 'r': rotateShape(.1); break;
|
||||||
|
case 's': saveSketch(); break;
|
||||||
|
case 'T': showScanDialog(); break;
|
||||||
|
case 't': showWordArtDialog(); break;
|
||||||
|
case 'u': oopsUndo(); break;
|
||||||
|
case '|': resetTwist(); break;
|
||||||
|
|
||||||
//default: console.log("Key: '" + ch + "' (" + event.which + ")");
|
//default: console.log("Key: '" + ch + "' (" + event.which + ")");
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,8 @@ function Printer() {
|
|||||||
if (completed) {
|
if (completed) {
|
||||||
console.log("Printer:sendPrintPart:gcode sending completed");
|
console.log("Printer:sendPrintPart:gcode sending completed");
|
||||||
this.gcode = [];
|
this.gcode = [];
|
||||||
btnStop.css("display","block"); // hack
|
//btnStop.css("display","block"); // hack
|
||||||
|
btnStop.enable(); //check me
|
||||||
self.removeLeaveWarning();
|
self.removeLeaveWarning();
|
||||||
message.set("Doodle has been 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
|
||||||
|
@ -76,7 +76,7 @@ function initButtonBehavior() {
|
|||||||
btnPrint.on("onButtonClick", print);
|
btnPrint.on("onButtonClick", print);
|
||||||
btnStop.on("onButtonClick", stopPrint);
|
btnStop.on("onButtonClick", stopPrint);
|
||||||
btnSave.on("onButtonClick", saveSketch);
|
btnSave.on("onButtonClick", saveSketch);
|
||||||
btnPrevious.on("onButtonClick", previousSketch);
|
btnPrevious.on("onButtonClick", onPreviousButtonClick);
|
||||||
btnNext.on("onButtonClick", nextSketch);
|
btnNext.on("onButtonClick", nextSketch);
|
||||||
btnOops.on("onButtonHold", onBtnOops);
|
btnOops.on("onButtonHold", onBtnOops);
|
||||||
// vertical shape buttons
|
// vertical shape buttons
|
||||||
@ -98,6 +98,11 @@ function initButtonBehavior() {
|
|||||||
// setSketchModified(false);
|
// setSketchModified(false);
|
||||||
// updateSketchButtonStates();
|
// updateSketchButtonStates();
|
||||||
|
|
||||||
|
function onPreviousButtonClick() {
|
||||||
|
if (!sketchLoaded) loadSketch(curSketch);
|
||||||
|
else previousSketch();
|
||||||
|
}
|
||||||
|
|
||||||
function onBtnToggleVerticalShapes() {
|
function onBtnToggleVerticalShapes() {
|
||||||
var btnImg;
|
var btnImg;
|
||||||
if (buttonGroupVerticalShapes.is(":hidden")) {
|
if (buttonGroupVerticalShapes.is(":hidden")) {
|
||||||
@ -232,7 +237,8 @@ function print(e) {
|
|||||||
//setState(Printer.BUFFERING_STATE,printer.hasControl);
|
//setState(Printer.BUFFERING_STATE,printer.hasControl);
|
||||||
printer.overruleState(Printer.BUFFERING_STATE);
|
printer.overruleState(Printer.BUFFERING_STATE);
|
||||||
|
|
||||||
btnStop.css("display","none"); // hack
|
// btnStop.css("display","none"); // hack
|
||||||
|
btnStop.disable(); //check me
|
||||||
|
|
||||||
// we put the gcode generation in a little delay
|
// we put the gcode generation in a little delay
|
||||||
// so that for example the print button is disabled right away
|
// so that for example the print button is disabled right away
|
||||||
@ -472,3 +478,22 @@ function setState(newState,newHasControl) {
|
|||||||
state = newState;
|
state = newState;
|
||||||
hasControl = newHasControl;
|
hasControl = newHasControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initLimitedInterface() {
|
||||||
|
btnSettings.hide();
|
||||||
|
btnPrint.hide();
|
||||||
|
btnStop.hide();
|
||||||
|
btnInfo.hide();
|
||||||
|
btnPrevious.hide();
|
||||||
|
btnNext.hide();
|
||||||
|
$("#thermometerContainer").hide();
|
||||||
|
$("#progressbarCanvasContainerParent").hide();
|
||||||
|
$("#btnSave").addClass("fake-print-button");
|
||||||
|
$("#btnSave").attr("src","img/buttons/btnPrint.png");
|
||||||
|
$("#btnSave").on("onButtonClick",function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
alert('\nThank you!\n\nYour sketch has been saved on the Doodle3D WiFi-Box and is now ready for 3D-printing.\n\n');
|
||||||
|
},1000);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -67,3 +67,4 @@ function _startOrientationAndChangeEventListening() {
|
|||||||
// is it necessary to call these? Aren't they called by the above eventhandlers?
|
// is it necessary to call these? Aren't they called by the above eventhandlers?
|
||||||
doOnResize();
|
doOnResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
js/main.js
35
js/main.js
@ -27,6 +27,7 @@ var $drawAreaContainer, $doodleCanvas, doodleCanvas, doodleCanvasContext, $previ
|
|||||||
|
|
||||||
var showhideInterval;
|
var showhideInterval;
|
||||||
var showOrHide = false;
|
var showOrHide = false;
|
||||||
|
var limitedFeatures = false;
|
||||||
|
|
||||||
var clientInfo = {};
|
var clientInfo = {};
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ $(function() {
|
|||||||
if (getURLParameter("c") != "null") communicateWithWifibox = (getURLParameter("c") == "1");
|
if (getURLParameter("c") != "null") communicateWithWifibox = (getURLParameter("c") == "1");
|
||||||
if (getURLParameter("r") != "null") wifiboxIsRemote = (getURLParameter("r") == "1");
|
if (getURLParameter("r") != "null") wifiboxIsRemote = (getURLParameter("r") == "1");
|
||||||
if (getURLParameter("u") != "null") autoUpdate = (getURLParameter("u") == "1");
|
if (getURLParameter("u") != "null") autoUpdate = (getURLParameter("u") == "1");
|
||||||
|
if (getURLParameter("l") != "null") limitedFeatures = (getURLParameter("l") == "1");
|
||||||
|
|
||||||
var hostname;
|
var hostname;
|
||||||
if (wifiboxIsRemote) hostname = 'http://192.168.5.1';
|
if (wifiboxIsRemote) hostname = 'http://192.168.5.1';
|
||||||
@ -107,37 +109,11 @@ $(function() {
|
|||||||
$("body").css("overflow", "auto");
|
$("body").css("overflow", "auto");
|
||||||
$("#debug_textArea").css("display", "block");
|
$("#debug_textArea").css("display", "block");
|
||||||
//$("#preview_tmp").css("display", "block");
|
//$("#preview_tmp").css("display", "block");
|
||||||
|
|
||||||
$("#debug_display").css("display", "block");
|
$("#debug_display").css("display", "block");
|
||||||
|
}
|
||||||
|
|
||||||
// show and hide the progressguage and thermometer
|
if (limitedFeatures) {
|
||||||
//showhideInterval = setInterval(showOrHideThermo, 2500);
|
initLimitedInterface();
|
||||||
|
|
||||||
// $("#debugContainer").css("display", "block");
|
|
||||||
|
|
||||||
/* TEMP CODE!! -> artificially populates the startgcode and endgcode textareas in the settings window */
|
|
||||||
// todo remove this temporary code...
|
|
||||||
/*
|
|
||||||
setTimeout(function() {
|
|
||||||
$("#startgcode").text("");
|
|
||||||
$("#startgcode").append("G21 (mm) \n");
|
|
||||||
$("#startgcode").append("G91 (relative) \n");
|
|
||||||
$("#startgcode").append("G28 X0 Y0 Z0 (physical home) \n");
|
|
||||||
$("#startgcode").append("M104 S230 (temperature) \n");
|
|
||||||
$("#startgcode").append("G1 E10 F250 (flow) \n");
|
|
||||||
$("#startgcode").append("G92 X-100 Y-100 Z0 E10 \n");
|
|
||||||
$("#startgcode").append("G1 Z3 F5000 (prevent diagonal line) \n");
|
|
||||||
$("#startgcode").append("G90 (absolute) \n");
|
|
||||||
$("#startgcode").append("M106 (fan on)");
|
|
||||||
console.log("$('#startgcode'): " + $("#startgcode").val());
|
|
||||||
|
|
||||||
$("#endgcode").text("");
|
|
||||||
$("#endgcode").append("G1 X-100 Y-100 F15000 (fast homing) \n");
|
|
||||||
$("#endgcode").append("M107 \n");
|
|
||||||
$("#endgcode").append("M84 (disable axes) \n");
|
|
||||||
console.log("$('#endgcode'): " + $("#endgcode").val());
|
|
||||||
}, 1000);
|
|
||||||
//*/
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -182,4 +158,5 @@ function settingsLoaded() {
|
|||||||
|
|
||||||
function setDebugText(text) {
|
function setDebugText(text) {
|
||||||
$("#debug_display").text(text);
|
$("#debug_display").text(text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
var curSketch = 0;
|
var curSketch = 0;
|
||||||
var sketches = []; //contains fileIDs
|
var sketches = []; //contains fileIDs
|
||||||
|
var sketchLoaded = false;
|
||||||
|
|
||||||
function previousSketch(e) {
|
function previousSketch(e) {
|
||||||
loadSketch(curSketch-1);
|
loadSketch(curSketch-1);
|
||||||
@ -80,6 +81,7 @@ function loadSketch(_curSketch) {
|
|||||||
var svgData = response.data.data;
|
var svgData = response.data.data;
|
||||||
loadFromSvg(svgData);
|
loadFromSvg(svgData);
|
||||||
setSketchModified(false);
|
setSketchModified(false);
|
||||||
|
sketchLoaded = true;
|
||||||
} else {
|
} else {
|
||||||
console.log('error loading sketch: ',response);
|
console.log('error loading sketch: ',response);
|
||||||
listSketches();
|
listSketches();
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
margin-left: -@center-panel-width/2;
|
margin-left: -@center-panel-width/2;
|
||||||
width: @center-panel-width;
|
width: @center-panel-width;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 1%;
|
padding-top: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logopanel {
|
#logopanel {
|
||||||
@ -32,12 +32,13 @@
|
|||||||
#drawareacontainer {
|
#drawareacontainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 79%;
|
// height: 79%;
|
||||||
|
height: 65%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 3px solid black;
|
border: 3px solid black;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-top: 1%;
|
margin-top: 3%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#canvasContainers {
|
#canvasContainers {
|
||||||
|
@ -29,6 +29,15 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#btnSave.fake-print-button {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
left: 880px;
|
||||||
|
width: 125px;
|
||||||
|
max-width: 125px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
#btnStop {
|
#btnStop {
|
||||||
margin: 5% 5% 1% 5%;
|
margin: 5% 5% 1% 5%;
|
||||||
float: right;
|
float: right;
|
||||||
@ -55,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#btnNew {
|
#btnNew {
|
||||||
margin: 5% 0% 1% 5%;
|
margin: 25% 0% 1% 5%;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 130px;
|
max-width: 130px;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
Loading…
Reference in New Issue
Block a user