diff --git a/css/fixedPosInterface.css b/css/fixedPosInterface.css index c63af8e..6b41cb7 100644 --- a/css/fixedPosInterface.css +++ b/css/fixedPosInterface.css @@ -261,8 +261,8 @@ body { /* THERMOMETER */ #thermometerContainer { position: absolute; - right: 30px; - top: 410px; + right: 25px; + top: 370px; } #thermometerCanvas { /*background: #59b2b8;*/ diff --git a/css/settingsPopup.css b/css/settingsPopup.css index 29eb141..f2800c0 100644 --- a/css/settingsPopup.css +++ b/css/settingsPopup.css @@ -70,4 +70,5 @@ div.content .btnOK { height: 86px; background: url('../img/buttons/btnOk_settings.png') no-repeat; margin: 0 0 0 10px; + cursor: pointer; } diff --git a/favicon_alt.ico b/favicon_alt.ico new file mode 100644 index 0000000..57eb4b4 Binary files /dev/null and b/favicon_alt.ico differ diff --git a/img/webpage_icons/apple-touch-icon-114x114-precomposed.png b/img/webpage_icons/apple-touch-icon-114x114-precomposed.png new file mode 100644 index 0000000..50e1053 Binary files /dev/null and b/img/webpage_icons/apple-touch-icon-114x114-precomposed.png differ diff --git a/img/webpage_icons/apple-touch-icon-144x144-precomposed.png b/img/webpage_icons/apple-touch-icon-144x144-precomposed.png new file mode 100644 index 0000000..585036f Binary files /dev/null and b/img/webpage_icons/apple-touch-icon-144x144-precomposed.png differ diff --git a/img/webpage_icons/apple-touch-icon-72x72-precomposed.png b/img/webpage_icons/apple-touch-icon-72x72-precomposed.png new file mode 100644 index 0000000..f422615 Binary files /dev/null and b/img/webpage_icons/apple-touch-icon-72x72-precomposed.png differ diff --git a/img/webpage_icons/apple-touch-icon-precomposed.png b/img/webpage_icons/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..333520f Binary files /dev/null and b/img/webpage_icons/apple-touch-icon-precomposed.png differ diff --git a/js/Printer.js b/js/Printer.js index 8a089d1..6368615 100644 --- a/js/Printer.js +++ b/js/Printer.js @@ -106,6 +106,8 @@ function Printer() { return; } + this.targetTemperature = settings["printer.temperature"]; // slight hack + this.sendPrintPart(this.sendIndex, this.sendLength); } this.byteSize = function(s){ @@ -139,6 +141,7 @@ function Printer() { if (lastOne) { console.log("Printer:sendPrintPart:gcode sending completed"); this.gcode = []; + self.targetTemperature = settings["printer.temperature"]; // slight hack } else { self.sendPrintPart(sendIndex + sendLength, sendLength); } diff --git a/js/Thermometer.js b/js/Thermometer.js index c69ea38..1595ff8 100644 --- a/js/Thermometer.js +++ b/js/Thermometer.js @@ -24,9 +24,11 @@ function Thermometer() { [244, 50, 50] // 'ready / hot' ]; - this.init = function(targCanvas) { + this.init = function(targCanvas, targCanvasContainer) { console.log("Thermometer.init()"); + $displayThermometer = targCanvasContainer; + this.$canvas = targCanvas; this.canvas = this.$canvas[0]; this.context = this.canvas.getContext('2d'); diff --git a/js/buttonbehaviors.js b/js/buttonbehaviors.js index 83fadb3..a335815 100644 --- a/js/buttonbehaviors.js +++ b/js/buttonbehaviors.js @@ -311,7 +311,7 @@ function update() { thermometer.update(printer.temperature, printer.targetTemperature); } - setPrintprogress(printer.currentLine/printer.num_lines); + //setPrintprogress(printer.currentLine/printer.num_lines); var btnPrint= $("#btnPrint"); diff --git a/js/draw_logic.js b/js/draw_logic.js deleted file mode 100644 index ebabbe0..0000000 --- a/js/draw_logic.js +++ /dev/null @@ -1,277 +0,0 @@ -var oopsTimer; -var dragging; -var path; -var svg; -var preview; -var previewCtx; - -var svgPathRegExp = /[LM]\d* \d*/ig; -var svgPathParamsRegExp = /([LM])(\d*) (\d*)/; - -var svgTopLeftCoords = []; -function initDrawing() { - - path = document.getElementById('path'); - svg = document.getElementById('svg'); - - svgTopLeftCoords[0] = $("#drawAreaContainer").css("left").match(/[0-9]/g).join(""); - svgTopLeftCoords[1] = $("#drawAreaContainer").css("top").match(/[0-9]/g).join(""); - - svg.addEventListener('mousedown',onMouseDown,false); - svg.addEventListener('mousemove',onMouseMove,false); - svg.addEventListener('mouseup',onMouseUp,false); - svg.addEventListener('touchstart',onTouchDown,false); - svg.addEventListener('touchmove',onTouchMove,false); - btnNew.addEventListener('mousedown',clear,false); - btnNew.addEventListener('touchstart',clear,false); - btnOops.addEventListener('touchstart',startOops,false); - btnOops.addEventListener('touchend',stopOops,false); - btnOops.addEventListener('mousedown',startOops,false); - btnOops.addEventListener('mouseup',stopOops,false); - btnPrint.addEventListener('mousedown',print,false); - btnPrint.addEventListener('touchstart',print,false); - btnSave.addEventListener('mousedown',print,false); - btnSave.addEventListener('touchstart',print,false); - - document.body.addEventListener('touchmove',prevent,false); - - preview = document.getElementById('preview'); - previewCtx = preview.getContext('2d'); - redrawPreview(); -}; - -function prevent(e) { - e.preventDefault(); -} - -function clear() { - path.attributes.d.nodeValue = "M0 0"; - redrawPreview(); -} - -function startOops() { - oopsTimer = setInterval("oops()",1000/30); -} - -function stopOops() { - clearInterval(oopsTimer); -} - -function oops() { - str = path.attributes.d.nodeValue; - n = str.lastIndexOf(" L"); - if(n != -1) { - path.attributes.d.nodeValue = str.substr(0,n); - redrawPreview(); - //requestAnimationFrame(updatePreview); - } -} - -function moveTo(x,y) { - if (path.attributes.d.nodeValue=="M0 0") { - path.attributes.d.nodeValue = "M" + x + " " + y; - } else { - path.attributes.d.nodeValue += " M" + x + " " + y; - } - updatePreview(x,y,true) - //redrawPreview(); -} - -function lineTo(x,y) { - path.attributes.d.nodeValue += " L" + x + " " + y; - //updatePreview(); - //requestAnimationFrame(updatePreview); - updatePreview(x,y,false); -} - -function onTouchDown(e) { - var x = e.touches[0].pageX - svgTopLeftCoords[0]; - var y = e.touches[0].pageY - svgTopLeftCoords[1]; - moveTo(x,y); -} - -function onTouchMove(e) { - e.preventDefault(); - var x = e.touches[0].pageX - svgTopLeftCoords[0]; - var y = e.touches[0].pageY - svgTopLeftCoords[1]; - lineTo(x,y); -} - -function onMouseDown(e) { - dragging = true; - moveTo(e.offsetX,e.offsetY); -} - -function onMouseMove(e) { - if (!dragging) return; - lineTo(e.offsetX,e.offsetY); -} - -function onMouseUp(e) { - dragging = false; -} - -function print(e) { - - output = path.attributes.d.nodeValue; - console.log(output); - - output = output.split("M").join("\n"); - output = output.split(" L").join("_"); - output = output.split(" ").join(","); - output = output.split("_").join(" "); - - output = "\nBEGIN\n" + output + "\n\nEND\n"; - - console.log("output :" + output ); - - $.post("/doodle3d.of", { data:output }, function(data) { - btnPrint.disabled = false; - }); -} - -var numLayers = 100; //50 -var globalScale = 0.20; // global scale of preview -var globalAlpha = 0.20; // global alpha of preview -var scaleY = 0.4; // additional vertical scale per path for 3d effect -var strokeWidth = 2; //4; -var rStep = Math.PI/40; //Math.PI/40; // -var yStep = 3; //6; -var svgWidth = 650; //parseInt($(svg).css("width")); -var svgHeight = 450; //parseInt($(svg).css("height")); -var layerCX = svgWidth/2*globalScale; -var layerCY = svgHeight/2*globalScale; -var layerOffsetY= 360; -var prevX = 0; -var prevY = 0; -var highlight = true; //highlight bottom, middle and top layers - -function redrawPreview() { - var svgData = path.attributes.d.nodeValue; - var linesRaw = svgData.match(svgPathRegExp); - console.log("svgData: " + svgData); - console.log("linesRaw: " + linesRaw); - console.log(""); -// console.log(""); - var lines = new Array(); - for(var i=0;i http://stackoverflow.com/questions/9885821/copying-of-an-array-of-objects-to-another-array-without-object-reference-in-java @@ -146,10 +156,9 @@ function generate_gcode(callback) { // sort-of in de buurt van (360/2.5) // // -> aight.. er zijn 750 lines vs 1000 in de d3d app. 135 = .75 * 180... dit kan je nog rechttrekken als je NET wat slimmer nadenkt :) - // update: NEE, het is niet .75 * 180 want 135 was niet de beste value. //TODO dus. - var radToDeg = 180/Math.PI; - //pointsRotate(p, (rStep * radToDeg) * progress); - pointsRotate(p, (rStep * 139) * progress); + // update: NEE, het is niet .75 * 180 want 135 was niet de beste value. + //pointsRotate(p, rStep * progress * 139); + pointsRotate(p, rStepGCode * layer); if (layer == 0) { //gcode.push("M107"); //fan off @@ -226,8 +235,6 @@ function generate_gcode(callback) { console.log("f:generategcode() >> (layer/layers) > (objectHeight/maxObjectHeight) is true -> breaking at layer " + (layer + 1)); break; } - - } // add gcode end commands diff --git a/js/main.js b/js/main.js index 2c8dd6d..6de3776 100644 --- a/js/main.js +++ b/js/main.js @@ -45,7 +45,7 @@ $(function() { initPreviewRendering(); initButtonBehavior(); - thermometer.init($("#thermometerCanvas")); + thermometer.init($("#thermometerCanvas"), $("#thermometerContainer")); printer.init(); $(document).on(Printer.UPDATE,update); diff --git a/settings.html b/settings.html index 3a80414..5d5c826 100755 --- a/settings.html +++ b/settings.html @@ -82,7 +82,7 @@ Doodle3D settings px
mm
- px
+