mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-12-04 14:04:54 +01:00
malyan
This commit is contained in:
parent
c36da87a17
commit
89b57241d3
@ -193,7 +193,7 @@ function InfoReminderTour(_name) {
|
||||
}
|
||||
|
||||
function initHelp() {
|
||||
//console.log("f:initHelp()");
|
||||
console.log("f:initHelp()");
|
||||
|
||||
// track number of visits of this user
|
||||
if ($.cookie("Doodle3DVisitCounter") == null) {
|
||||
@ -203,7 +203,7 @@ function initHelp() {
|
||||
}
|
||||
|
||||
// load the html file which describes the tour contents
|
||||
$("#helpContainer").load("helpcontent.html", function() {
|
||||
$("#helpContainer").load("http://draw.doodle3d.com/helpcontent.html", function() {
|
||||
//console.log("helpContent loaded");
|
||||
|
||||
helpTours = new HelpTours();
|
||||
|
@ -368,6 +368,9 @@ function Printer() {
|
||||
}
|
||||
|
||||
this.checkStatus = function() {
|
||||
//disble printer status check RC: 2-1-2018
|
||||
return;
|
||||
|
||||
//console.log("Printer:checkStatus");
|
||||
this.stateOverruled = false;
|
||||
//console.log(" stateOverruled: ",this.stateOverruled);
|
||||
|
@ -10,9 +10,9 @@ function Progressbar() {
|
||||
this.currProgress = 0; // default val
|
||||
|
||||
this.progressbarFGImg = new Image();
|
||||
this.progressbarFGImgSrc = "img/progress_fg.png";
|
||||
this.progressbarFGImgSrc = "http://draw.doodle3d.com/img/progress_fg.png";
|
||||
this.progressbarBGImg = new Image();
|
||||
this.progressbarBGImgSrc = "img/progress_bg.png";
|
||||
this.progressbarBGImgSrc = "http://draw.doodle3d.com/img/progress_bg.png";
|
||||
|
||||
this.progressWidth= 93;
|
||||
this.progressHeight = 82;
|
||||
|
@ -16,7 +16,7 @@ function Thermometer() {
|
||||
this.targetTemperature = 0; // default val
|
||||
|
||||
this.thermoOverlayImg = new Image();
|
||||
this.thermoOverlayImgSrc = "img/thermometer_fg_overlay.png"; // ../img/thermometer_fg_overlay.png
|
||||
this.thermoOverlayImgSrc = "http://draw.doodle3d.com/img/thermometer_fg_overlay.png"; // ../img/thermometer_fg_overlay.png
|
||||
|
||||
this.thermoWidth= 40;
|
||||
this.thermoHeight = 100;
|
||||
|
@ -2,7 +2,7 @@ var wordArtPopup;
|
||||
|
||||
function initWordArt() {
|
||||
$("body").append('<div id="svgfont" style="display:none"></div>');
|
||||
$("#svgfont").load("img/font.svg?");
|
||||
$("#svgfont").load("http://draw.doodle3d.com/img/font.svg?");
|
||||
|
||||
wordArtPopup = new Popup($("#popupWordArt"),$("#popupMask"));
|
||||
$("#btnWordArtOk").on("onButtonClick",wordArtPopup.commit);
|
||||
|
@ -17,83 +17,73 @@ function ConfigAPI() {
|
||||
|
||||
this.init = function(wifiboxURL,wifiboxCGIBinURL) {
|
||||
//console.log("ConfigAPI:init");
|
||||
|
||||
_wifiboxURL = wifiboxURL;
|
||||
_wifiboxCGIBinURL = wifiboxCGIBinURL;
|
||||
}
|
||||
this.loadAll = function(completeHandler,failedHandler) {
|
||||
//console.log("ConfigAPI:loadAll");
|
||||
$.ajax({
|
||||
url: _wifiboxURL + "/config/all",
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
timeout: _timeoutTime,
|
||||
success: function(response){
|
||||
if(response.status == "error" || response.status == "fail") {
|
||||
if(failedHandler) failedHandler(response);
|
||||
} else {
|
||||
completeHandler(response.data);
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
if(failedHandler) failedHandler();
|
||||
});
|
||||
alert('ConfigAPI.loadAll() deprecated');
|
||||
};
|
||||
|
||||
|
||||
this.load = function(targetSettings,completeHandler,failedHandler) {
|
||||
alert('ConfigAPI.load() deprecated');
|
||||
//console.log("ConfigAPI:load");
|
||||
$.ajax({
|
||||
url: _wifiboxURL + "/config/",
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
data: targetSettings,
|
||||
timeout: _timeoutTime,
|
||||
success: function(response){
|
||||
if(response.status == "error" || response.status == "fail") {
|
||||
if(failedHandler) failedHandler(response);
|
||||
} else {
|
||||
completeHandler(response.data);
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
if(failedHandler) failedHandler();
|
||||
});
|
||||
// $.ajax({
|
||||
// url: _wifiboxURL + "/config/",
|
||||
// type: "GET",
|
||||
// dataType: 'json',
|
||||
// data: targetSettings,
|
||||
// timeout: _timeoutTime,
|
||||
// success: function(response){
|
||||
// if(response.status == "error" || response.status == "fail") {
|
||||
// if(failedHandler) failedHandler(response);
|
||||
// } else {
|
||||
// completeHandler(response.data);
|
||||
// }
|
||||
// }
|
||||
// }).fail(function() {
|
||||
// if(failedHandler) failedHandler();
|
||||
// });
|
||||
};
|
||||
this.save = function(newSettings,completeHandler,failedHandler) {
|
||||
//console.log("ConfigAPI:save");
|
||||
$.ajax({
|
||||
url: _wifiboxCGIBinURL + "/config",
|
||||
type: "POST",
|
||||
data: newSettings,
|
||||
dataType: 'json',
|
||||
timeout: _saveSettingsTimeoutTime,
|
||||
success: function(response){
|
||||
//console.log("ConfigAPI:save response: ",response);
|
||||
if(response.status == "error" || response.status == "fail") {
|
||||
if(failedHandler) failedHandler(response);
|
||||
} else {
|
||||
completeHandler(response.data);
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
if(failedHandler) failedHandler();
|
||||
});
|
||||
alert('ConfigAPI.save() deprecated');
|
||||
// $.ajax({
|
||||
// url: _wifiboxCGIBinURL + "/config",
|
||||
// type: "POST",
|
||||
// data: newSettings,
|
||||
// dataType: 'json',
|
||||
// timeout: _saveSettingsTimeoutTime,
|
||||
// success: function(response){
|
||||
// //console.log("ConfigAPI:save response: ",response);
|
||||
// if(response.status == "error" || response.status == "fail") {
|
||||
// if(failedHandler) failedHandler(response);
|
||||
// } else {
|
||||
// completeHandler(response.data);
|
||||
// }
|
||||
// }
|
||||
// }).fail(function() {
|
||||
// if(failedHandler) failedHandler();
|
||||
// });
|
||||
};
|
||||
this.resetAll = function(completeHandler,failedHandler) {
|
||||
alert('ConfigAPI.resetAll() deprecated');
|
||||
//console.log("ConfigAPI:resetAll");
|
||||
$.ajax({
|
||||
url: _wifiboxCGIBinURL + "/config/resetall",
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
timeout: _timeoutTime,
|
||||
success: function(response){
|
||||
if(response.status == "error" || response.status == "fail") {
|
||||
if(failedHandler) failedHandler(response);
|
||||
} else {
|
||||
completeHandler(response.data);
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
if(failedHandler) failedHandler();
|
||||
});
|
||||
// $.ajax({
|
||||
// url: _wifiboxCGIBinURL + "/config/resetall",
|
||||
// type: "POST",
|
||||
// dataType: 'json',
|
||||
// timeout: _timeoutTime,
|
||||
// success: function(response){
|
||||
// if(response.status == "error" || response.status == "fail") {
|
||||
// if(failedHandler) failedHandler(response);
|
||||
// } else {
|
||||
// completeHandler(response.data);
|
||||
// }
|
||||
// }
|
||||
// }).fail(function() {
|
||||
// if(failedHandler) failedHandler();
|
||||
// });
|
||||
};
|
||||
}
|
@ -202,68 +202,51 @@ function initButtonBehavior() {
|
||||
buttonGroupAdd.fadeOut();
|
||||
}
|
||||
|
||||
// btnSettings.on("onButtonClick", openSettingsWindow);
|
||||
|
||||
// 29-okt-2013 - we're not doing help for smartphones at the moment
|
||||
// if (clientInfo.isSmartphone) {
|
||||
// btnInfo.disable();
|
||||
// } else {
|
||||
// btnInfo.on("onButtonClick", function(e) {
|
||||
// helpTours.startTour(helpTours.WELCOMETOUR);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
function stopPrint() {
|
||||
console.log("stop");
|
||||
// console.log("f:stopPrint() >> sendPrintCommands = " + sendPrintCommands);
|
||||
// if (sendPrintCommands) printer.stop();
|
||||
// //setState(Printer.STOPPING_STATE,printer.hasControl);
|
||||
// printer.overruleState(Printer.STOPPING_STATE);
|
||||
// btnStop.disable();
|
||||
// $.get("/set?code=M104 S200\nG21\nM107\nG28 X0 Y0 Z0\nM109 S200\nG28 Z0\nG1 Z15 F9000\nG92 E0\nG91\nG1 F200 E20\nG92 E0\nG92 E0\nG1 F9000\nG90\n", function() {
|
||||
$.get("/set?cmd={P:X}");
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
function print(e) {
|
||||
console.log("print");
|
||||
// console.log("f:print() >> sendPrintCommands = " + sendPrintCommands);
|
||||
|
||||
// //$(".btnPrint").css("display","none");
|
||||
var gcode = generate_gcode();
|
||||
if (!gcode || gcode=="") {
|
||||
console.log("no gcode to print");
|
||||
return;
|
||||
}
|
||||
|
||||
// if (_points.length > 2) {
|
||||
var blob = new Blob([gcode.join('\n')],{type: "application/octet-stream"});
|
||||
var fd = new FormData();
|
||||
fd.append("blob", blob, "doodle3d.gcode");
|
||||
|
||||
// //setState(Printer.BUFFERING_STATE,printer.hasControl);
|
||||
// printer.overruleState(Printer.BUFFERING_STATE);
|
||||
// $.get("/set?code=M104 S200", function() { //heatup
|
||||
// $.get("/set?code=G28 X0 Y0", function() { //show movement
|
||||
// $.get("/set?code=M563 S5", function() { //speed up Upload via WiFi
|
||||
$.ajax({ //start download
|
||||
type: 'POST',
|
||||
url: '/upload',
|
||||
cache: false,
|
||||
data: fd,
|
||||
processData: false,
|
||||
// contentDisposition: 'form-data; name="file"; filename="doodle.gcode',
|
||||
contentType: false
|
||||
}).done(function(data) {
|
||||
console.log(data);
|
||||
|
||||
// // we put the gcode generation in a little delay
|
||||
// // so that for example the print button is disabled right away
|
||||
// clearTimeout(gcodeGenerateDelayer);
|
||||
// gcodeGenerateDelayer = setTimeout(function() {
|
||||
|
||||
// var gcode = generate_gcode();
|
||||
// if (sendPrintCommands) {
|
||||
// if(gcode.length > 0) {
|
||||
// printer.print(gcode);
|
||||
// } else {
|
||||
// printer.overruleState(Printer.IDLE_STATE);
|
||||
// printer.startStatusCheckInterval();
|
||||
// }
|
||||
// } else {
|
||||
// console.log("sendPrintCommands is false: not sending print command to 3dprinter");
|
||||
// }
|
||||
|
||||
// // if (debugMode) {
|
||||
// // $("#textdump").text("");
|
||||
// // $("#textdump").text(gcode.join("\n"));
|
||||
// // }
|
||||
|
||||
// }, gcodeGenerateDelay);
|
||||
// } else {
|
||||
// console.log("f:print >> not enough points!");
|
||||
// }
|
||||
|
||||
// $.post("/doodle3d.of", { data:output }, function(data) {
|
||||
// btnPrint.disabled = false;
|
||||
// });
|
||||
// setTimeout(function() {
|
||||
// btnStop.enable();
|
||||
// $.get("/set?code=M565"); //start printing cache.gc
|
||||
// },3000)
|
||||
|
||||
});
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@ -421,58 +404,6 @@ function setState(newState,newHasControl) {
|
||||
btnNext.disable()
|
||||
btnSave.disable();
|
||||
|
||||
|
||||
// /* save, next and prev buttons */
|
||||
// switch(newState) {
|
||||
// case Printer.WIFIBOX_DISCONNECTED_STATE:
|
||||
// btnPrevious.disable();
|
||||
// btnNext.disable()
|
||||
// btnSave.disable();
|
||||
// break;
|
||||
// default:
|
||||
// // updatePrevNextButtonState();
|
||||
// updateSketchButtonStates();
|
||||
// if (isModified) btnSave.enable();
|
||||
// break;
|
||||
// }
|
||||
|
||||
// if(connectingHintDelay && newState != Printer.CONNECTING_STATE) {
|
||||
// clearTimeout(connectingHintDelay);
|
||||
// connectingHintDelay = null;
|
||||
// }
|
||||
|
||||
// if(newState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
||||
// message.set("Lost connection to WiFi box",Message.ERROR);
|
||||
// } else if(prevState == Printer.WIFIBOX_DISCONNECTED_STATE) {
|
||||
// message.set("Connected to WiFi box",Message.INFO,true);
|
||||
// } else if(newState == Printer.DISCONNECTED_STATE) {
|
||||
// message.set("Printer disconnected",Message.WARNING,true);
|
||||
// } else if(newState == Printer.CONNECTING_STATE) {
|
||||
// message.set("Printer connecting...",Message.INFO,false);
|
||||
// if (prevState != Printer.CONNECTING_STATE) { //enable 'watchdog' if we entered from a different state
|
||||
// clearTimeout(connectingHintDelay);
|
||||
// connectingHintDelay = setTimeout(function() {
|
||||
// message.set("Printer still not connected, did you<br/>select the correct printer type?", Message.WARNING, false);
|
||||
// connectingHintDelay = null;
|
||||
// }, connectingHintDelayTime);
|
||||
// }
|
||||
// } else if(prevState == Printer.DISCONNECTED_STATE && newState == Printer.IDLE_STATE ||
|
||||
// prevState == Printer.UNKNOWN_STATE && newState == Printer.IDLE_STATE ||
|
||||
// prevState == Printer.CONNECTING_STATE && newState == Printer.IDLE_STATE) {
|
||||
// message.set("Printer connected",Message.INFO,true);
|
||||
// console.log(" preheat: ",settings["printer.heatup.enabled"]);
|
||||
// if(settings["printer.heatup.enabled"]) {
|
||||
// // HACK: we delay the preheat because the makerbot driver needs time to connect
|
||||
// clearTimeout(preheatDelay);
|
||||
// preheatDelay = setTimeout(printer.preheat,preheatDelayTime); // retry after delay
|
||||
// }
|
||||
// } 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;
|
||||
hasControl = newHasControl;
|
||||
|
@ -11,10 +11,8 @@ var gcode = [];
|
||||
|
||||
function generate_gcode() {
|
||||
console.log("f:generategcode()");
|
||||
|
||||
gcode = [];
|
||||
|
||||
console.log("settings: ",settings);
|
||||
var speed = settings["printer.speed"];
|
||||
var normalSpeed = speed;
|
||||
var bottomSpeed = settings["printer.bottomLayerSpeed"];
|
||||
@ -61,6 +59,11 @@ function generate_gcode() {
|
||||
// copy array without reference -> http://stackoverflow.com/questions/9885821/copying-of-an-array-of-objects-to-another-array-without-object-reference-in-java
|
||||
var points = JSON.parse(JSON.stringify(_points));
|
||||
|
||||
if (!points || points.length==0) {
|
||||
console.log("generate_gcode: no points");
|
||||
return gcode;
|
||||
}
|
||||
|
||||
// add gcode begin commands
|
||||
gcode = gcode.concat(startCode);
|
||||
|
||||
@ -109,19 +112,20 @@ function generate_gcode() {
|
||||
pointsScale(p, layerScale, layerScale);
|
||||
pointsRotate(p, rStepGCode * layer);
|
||||
|
||||
if (layer == 0) {
|
||||
//gcode.push("M107"); //fan off
|
||||
if (firstLayerSlow) {
|
||||
//gcode.push("M220 S20"); //slow speed
|
||||
speed = bottomSpeed;
|
||||
//console.log("> speed: ",speed);
|
||||
}
|
||||
} else if (layer == 2) { ////////LET OP, pas bij layer 2 weer op normale snelheid ipv layer 1
|
||||
gcode.push("M106"); //fan on
|
||||
//gcode.push("M220 S100"); //normal speed
|
||||
speed = normalSpeed;
|
||||
//console.log("> speed: ",speed);
|
||||
}
|
||||
speed = layer<3 ? bottomSpeed : normalSpeed;
|
||||
// if (layer == 0) {
|
||||
// //gcode.push("M107"); //fan off
|
||||
// if (firstLayerSlow) {
|
||||
// //gcode.push("M220 S20"); //slow speed
|
||||
// speed = bottomSpeed;
|
||||
// //console.log("> speed: ",speed);
|
||||
// }
|
||||
// } else if (layer == 2) { ////////LET OP, pas bij layer 2 weer op normale snelheid ipv layer 1
|
||||
// gcode.push("M106"); //fan on
|
||||
// //gcode.push("M220 S100"); //normal speed
|
||||
// speed = normalSpeed;
|
||||
// //console.log("> speed: ",speed);
|
||||
// }
|
||||
|
||||
var curLayerCommand = 0;
|
||||
var totalLayerCommands = p.length;
|
||||
@ -250,7 +254,7 @@ function scaleFunction(percent) {
|
||||
r = 1.0 - (percent * .8);
|
||||
break;
|
||||
case verticalShapes.SINUS:
|
||||
r = (Math.cos(percent * Math.PI * 4) * .25) + .75;
|
||||
r = (Math.cos(percent * Math.PI * 12) * .25) + .75;
|
||||
break;
|
||||
}
|
||||
|
||||
|
110
js/main.js
110
js/main.js
@ -33,6 +33,52 @@ var clientInfo = {};
|
||||
var POPUP_SHOW_DURATION = 175;
|
||||
var BUTTON_GROUP_SHOW_DURATION = 80;
|
||||
|
||||
var settings = {
|
||||
"doodle3d.simplify.minDistance": 3,
|
||||
"doodle3d.tour.enabled": true,
|
||||
"doodle3d.update.baseUrl": "http://doodle3d.com/updates",
|
||||
"doodle3d.update.includeBetas": false,
|
||||
"gcode.server": "http://gcodeserver.doodle3d.com",
|
||||
"network.ap.address" : "192.168.10.1",
|
||||
"network.ap.key" : "",
|
||||
"network.ap.netmask" : "255.255.255.0",
|
||||
"network.ap.ssid" : "Doodle3D-%%MAC_ADDR_TAIL%%",
|
||||
"network.cl.wifiboxid": "Doodle3D-%%MAC_ADDR_TAIL%%",
|
||||
"printer.baudrate": "115200",
|
||||
"printer.bed.temperature": 50,
|
||||
"printer.bottomEnableTraveling": true,
|
||||
"printer.bottomFlowRate": 2,
|
||||
"printer.bottomLayerSpeed": 35,
|
||||
"printer.dimensions.x" : 120,
|
||||
"printer.dimensions.y": 120,
|
||||
"printer.dimensions.z": 120,
|
||||
"printer.enableTraveling": true,
|
||||
"printer.startcode": "M104 S220\nG21\nM107\nG28 X0 Y0 Z0\nM109 S220\nG28 Z0\nG1 Z15 F9000\nG92 E0\nG91\nG1 F200 E20\nG92 E0\nG92 E0\nG1 F9000\nG90\n",
|
||||
"printer.endcode": "M107\nG91\nG1 E-1 F300\nG1 Z+0.5 E-5 X-20 Y-20 F9000\nG28 X0 Y0",
|
||||
"printer.filamentThickness": 1.75,
|
||||
"printer.firstLayerSlow": true,
|
||||
"printer.heatedbed": false,
|
||||
"printer.heatup.bed.temperature": 0,
|
||||
"printer.heatup.enabled": false,
|
||||
"printer.heatup.temperature": 0,
|
||||
"printer.layerHeight": 0.2,
|
||||
"printer.retraction.amount": 3,
|
||||
"printer.retraction.enabled": true,
|
||||
"printer.retraction.minDistance": 5,
|
||||
"printer.retraction.speed": 50,
|
||||
"printer.screenToMillimeterScale": .3,
|
||||
"printer.speed": 70,
|
||||
"printer.temperature": 180,
|
||||
"printer.travelSpeed": 200,
|
||||
"printer.type:": "marlin_generic",
|
||||
"printer.useSubLayers": true,
|
||||
"printer.wallThickness": 0.5,
|
||||
"system.log.level": "info"
|
||||
// "M104 S{printingTemp}\n{if heatedBed}M190 S{printingBedTemp}\nG21\nM107\nG28 X0 Y0\nM109 S{printingTemp}\nG28 Z0\nG1 Z15 F9000\nG92 E0\nG91\nG1 F200 E10\nG92 E0\nG92 E0\nG1 F9000\nG90\n"
|
||||
//
|
||||
};
|
||||
|
||||
|
||||
$(function() {
|
||||
console.log("Doodle3D client ready");
|
||||
console.log("Build information - <%= build_info %>)");
|
||||
@ -51,18 +97,15 @@ $(function() {
|
||||
wifiboxURL = hostname+"/d3dapi";
|
||||
wifiboxCGIBinURL = hostname+"/cgi-bin/d3dapi";
|
||||
|
||||
|
||||
//var api = wifiboxURL+'/d3dapi/sketch/';
|
||||
|
||||
// if (wifiboxIsRemote) {
|
||||
// // var hostname = "http://10.0.0.45";
|
||||
// var hostname = "http://192.168.5.1";
|
||||
// wifiboxURL = hostname+"/d3dapi";
|
||||
// wifiboxCGIBinURL = hostname+"/cgi-bin/d3dapi";
|
||||
// } else {
|
||||
// wifiboxURL = "http://" + window.location.host + "/d3dapi";
|
||||
// wifiboxCGIBinURL = "http://" + window.location.host + "/cgi-bin/d3dapi";
|
||||
// }
|
||||
|
||||
// setInterval(function() {
|
||||
// $.get("/inquiry",function(data) {
|
||||
// console.log(data);
|
||||
// })
|
||||
// },2000);
|
||||
|
||||
|
||||
|
||||
if (!communicateWithWifibox) {
|
||||
sendPrintCommands = false; // 'communicateWithWifibox = false' implies this
|
||||
@ -90,56 +133,13 @@ $(function() {
|
||||
|
||||
disableDragging();
|
||||
|
||||
// if (!clientInfo.isSmartphone) initHelp();
|
||||
if (!clientInfo.isSmartphone) initHelp();
|
||||
|
||||
thermometer.init($("#thermometerCanvas"), $("#thermometerContainer"));
|
||||
progressbar.init($("#progressbarCanvas"), $("#progressbarCanvasContainer"));
|
||||
|
||||
message.init($("#message"));
|
||||
|
||||
// printer.init();
|
||||
// $(document).on(Printer.UPDATE,update);
|
||||
|
||||
// settingsWindow.init(wifiboxURL,wifiboxCGIBinURL);
|
||||
// $(document).on(SettingsWindow.SETTINGS_LOADED, settingsLoaded);
|
||||
|
||||
// if(debugMode) {
|
||||
// console.log("debug mode is true");
|
||||
// $("body").css("overflow", "auto");
|
||||
// $("#debug_textArea").css("display", "block");
|
||||
// //$("#preview_tmp").css("display", "block");
|
||||
|
||||
// $("#debug_display").css("display", "block");
|
||||
|
||||
// show and hide the progressguage and thermometer
|
||||
//showhideInterval = setInterval(showOrHideThermo, 2500);
|
||||
|
||||
// $("#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);
|
||||
// //*/
|
||||
// }
|
||||
});
|
||||
|
||||
function disableDragging() {
|
||||
|
22
js/my-new-post.txt
Normal file
22
js/my-new-post.txt
Normal file
File diff suppressed because one or more lines are too long
@ -174,7 +174,11 @@ function SettingsWindow() {
|
||||
|
||||
this.downloadGcode = function() {
|
||||
var gcode = generate_gcode();
|
||||
if (gcode!=undefined) {
|
||||
|
||||
if (!gcode || gcode=="" || gcode.length==0) {
|
||||
console.log("no gcode to download");
|
||||
return;
|
||||
} else {
|
||||
var blob = new Blob([gcode.join("\n")], {type: "text/plain;charset=utf-8"});
|
||||
saveAs(blob, "doodle3d.gcode");
|
||||
}
|
||||
|
106
www/index.html
106
www/index.html
@ -8,12 +8,12 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui">
|
||||
|
||||
<link rel="icon" type="image/ico" href="./favicon_alt.ico"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="./img/webpage_icons/apple-touch-icon-144x144-precomposed.png"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="./img/webpage_icons/apple-touch-icon-144x144-precomposed.png" sizes="144x144" />
|
||||
<link rel="icon" type="image/ico" href="http://draw.doodle3d.com/favicon_alt.ico"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="http://draw.doodle3d.com/img/webpage_icons/apple-touch-icon-144x144-precomposed.png"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="http://draw.doodle3d.com/img/webpage_icons/apple-touch-icon-144x144-precomposed.png" sizes="144x144" />
|
||||
|
||||
<link href="css/styles.min.css" rel="stylesheet" media="screen">
|
||||
<link href="css/debug.min.css" rel="stylesheet" media="screen">
|
||||
<link href="http://draw.doodle3d.com/css/styles.min.css" rel="stylesheet" media="screen">
|
||||
<link href="http://draw.doodle3d.com/css/debug.min.css" rel="stylesheet" media="screen">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
@ -21,34 +21,34 @@
|
||||
|
||||
<!-- background images -->
|
||||
<div class="bgContainer">
|
||||
<img id="bgTop" src="img/bg_top.png" />
|
||||
<img id="bgMiddle" src="img/bg_middle.png" />
|
||||
<img id="bgBottom" src="img/bg_bottom.png" />
|
||||
<img id="bgTop" src="http://draw.doodle3d.com/img/bg_top.png" />
|
||||
<img id="bgMiddle" src="http://draw.doodle3d.com/img/bg_middle.png" />
|
||||
<img id="bgBottom" src="http://draw.doodle3d.com/img/bg_bottom.png" />
|
||||
</div>
|
||||
|
||||
<!-- left panel -->
|
||||
<div id="leftpanel">
|
||||
<img id="btnNew" class="btn" src="img/buttons/btnNew.png" /><br/>
|
||||
<img id="btnNew" class="btn" src="http://draw.doodle3d.com/img/buttons/btnNew.png" /><br/>
|
||||
<div id="btnsPrevNext">
|
||||
<img id="btnPrevious" class="btn disabled" src="img/buttons/btnLeft.png">
|
||||
<img id="btnNext" class="btn disabled" src="img/buttons/btnRight.png">
|
||||
<img id="btnPrevious" class="btn disabled" src="http://draw.doodle3d.com/img/buttons/btnLeft.png">
|
||||
<img id="btnNext" class="btn disabled" src="http://draw.doodle3d.com/img/buttons/btnRight.png">
|
||||
</div>
|
||||
<img id="btnSave" class="btn" src="img/buttons/btnSave.png" /><br/>
|
||||
<img id="btnOops" class="btn" src="img/buttons/btnOops.png" /><br/>
|
||||
<img id="btnAdd" class="btn" src="img/buttons/btnAdd.png" /><br/>
|
||||
<img id="btnSave" class="btn" src="http://draw.doodle3d.com/img/buttons/btnSave.png" /><br/>
|
||||
<img id="btnOops" class="btn" src="http://draw.doodle3d.com/img/buttons/btnOops.png" /><br/>
|
||||
<img id="btnAdd" class="btn" src="http://draw.doodle3d.com/img/buttons/btnAdd.png" /><br/>
|
||||
|
||||
<div id="buttonGroupAdd" class="buttonGroup">
|
||||
<img id="btnWordArt" class="btn" src="img/buttons/btnWordArt.png" />
|
||||
<img id="btnShape" class="btn" src="img/buttons/btnShape.png" />
|
||||
<img id="btnScan" class="btn" src="img/buttons/btnGuide.png" />
|
||||
<img id="btnWordArt" class="btn" src="http://draw.doodle3d.com/img/buttons/btnWordArt.png" />
|
||||
<img id="btnShape" class="btn" src="http://draw.doodle3d.com/img/buttons/btnShape.png" />
|
||||
<img id="btnScan" class="btn" src="http://draw.doodle3d.com/img/buttons/btnGuide.png" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- right panel -->
|
||||
<div id="rightpanel">
|
||||
<img id="btnPrint" class="btn clearfix" src="img/buttons/btnPrint.png" />
|
||||
<img id="btnStop" class="btn clearfix disabled" src="img/buttons/btnStop.png" />
|
||||
<img id="btnPrint" class="btn clearfix" src="http://draw.doodle3d.com/img/buttons/btnPrint.png" />
|
||||
<img id="btnStop" class="btn clearfix" src="http://draw.doodle3d.com/img/buttons/btnStop.png" />
|
||||
|
||||
<div id="progressbarCanvasContainerParent">
|
||||
<div id="progressbarCanvasContainer">
|
||||
@ -61,8 +61,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="btnsSettingsInfo">
|
||||
<img id="btnSettings" class="btn" src="img/buttons/btnSettings.png">
|
||||
<img id="btnInfo" class="btn" src="img/buttons/btnInfo.png">
|
||||
<img id="btnSettings" class="btn" src="http://draw.doodle3d.com/img/buttons/btnSettings.png">
|
||||
<img id="btnInfo" class="btn" src="http://draw.doodle3d.com/img/buttons/btnInfo.png">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -71,8 +71,8 @@
|
||||
<div id="centerpanel">
|
||||
|
||||
<div id="logopanel" class="btn">
|
||||
<img id="pencil" src="img/logo/pencil.png"/>
|
||||
<img id="logo" src="img/logo/doodle3d.png"/>
|
||||
<img id="pencil" src="http://draw.doodle3d.com/img/logo/pencil.png"/>
|
||||
<img id="logo" src="http://draw.doodle3d.com/img/logo/doodle3d.png"/>
|
||||
</div>
|
||||
|
||||
<div id="drawareacontainer">
|
||||
@ -81,33 +81,33 @@
|
||||
<div id="mycanvasContainer">
|
||||
<img id="imgGuide">
|
||||
<canvas id="mycanvas"></canvas>
|
||||
<img id="btnCloseScan" class="btn" src="img/buttons/btnClose.png" />
|
||||
<img id="btnCloseScan" class="btn" src="http://draw.doodle3d.com/img/buttons/btnClose.png" />
|
||||
</div>
|
||||
|
||||
<div id="previewContainer">
|
||||
<canvas id="preview"></canvas>
|
||||
<div id="buttonGroupVerticalShapes" class="buttonGroup">
|
||||
<img id="btnTwist" class="btn" src="img/buttons/btnTwist.png" />
|
||||
<img id="btnHeight" class="btn" src="img/buttons/btnHeight.png" />
|
||||
<img id="btnTwist" class="btn" src="http://draw.doodle3d.com/img/buttons/btnTwist.png" />
|
||||
<img id="btnHeight" class="btn" src="http://draw.doodle3d.com/img/buttons/btnHeight.png" />
|
||||
<div id="verticalShapes">
|
||||
<img id="btnConv" class="btn" src="img/buttons/btnConv.png" />
|
||||
<img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" />
|
||||
<img id="btnSine" class="btn" src="img/buttons/btnSine.png" />
|
||||
<img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" />
|
||||
<img id="btnConv" class="btn" src="http://draw.doodle3d.com/img/buttons/btnConv.png" />
|
||||
<img id="btnDiv" class="btn" src="http://draw.doodle3d.com/img/buttons/btnDiv.png" />
|
||||
<img id="btnSine" class="btn" src="http://draw.doodle3d.com/img/buttons/btnSine.png" />
|
||||
<img id="btnStraight" class="btn" src="http://draw.doodle3d.com/img/buttons/btnStraight.png" />
|
||||
</div>
|
||||
</div>
|
||||
<img id="btnToggleVerticalShapes" class="btn" src="img/buttons/btnArrowClose.png" />
|
||||
<img id="btnToggleVerticalShapes" class="btn" src="http://draw.doodle3d.com/img/buttons/btnArrowClose.png" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<canvas id="preview_tmp"></canvas>
|
||||
|
||||
<div id="buttonGroupEdit" class="buttonGroup">
|
||||
<img id="btnMove" class="btn" src="img/buttons/btnMove.png" />
|
||||
<img id="btnZoom" class="btn" src="img/buttons/btnZoom.png" />
|
||||
<img id="btnRotate" class="btn" src="img/buttons/btnRotate.png" />
|
||||
<img id="btnMove" class="btn" src="http://draw.doodle3d.com/img/buttons/btnMove.png" />
|
||||
<img id="btnZoom" class="btn" src="http://draw.doodle3d.com/img/buttons/btnZoom.png" />
|
||||
<img id="btnRotate" class="btn" src="http://draw.doodle3d.com/img/buttons/btnRotate.png" />
|
||||
</div>
|
||||
<img id="btnToggleEdit" class="btn" src="img/buttons/btnArrowOpen.png" />
|
||||
<img id="btnToggleEdit" class="btn" src="http://draw.doodle3d.com/img/buttons/btnArrowOpen.png" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -125,7 +125,7 @@
|
||||
<h1>Add WordArt</h1>
|
||||
Please enter your text:<br>
|
||||
<input id="txtWordArt" type="text"/>
|
||||
<img id="btnWordArtOk" class="btn" src="img/buttons/btnOk.png">
|
||||
<img id="btnWordArtOk" class="btn" src="http://draw.doodle3d.com/img/buttons/btnOk.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
<h1>Use photo as a guide</h1>
|
||||
<input id="fileScan" type="file"/>
|
||||
<!-- <input id="txtDummy" type="text"/> -->
|
||||
<img id="btnScanOk" class="btn" src="img/buttons/btnOk.png">
|
||||
<img id="btnScanOk" class="btn" src="http://draw.doodle3d.com/img/buttons/btnOk.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -142,11 +142,11 @@
|
||||
<div class="content">
|
||||
<h1>Add a new shape</h1>
|
||||
<div class="columnRight">
|
||||
<img id="iconShapeLessPoints" src="img/shapeLessPoints.gif" />
|
||||
<img class="btn" id="btnShapeMin" src="img/buttons/btnMin.png" />
|
||||
<img class="btn" id="btnShapePlus" src="img/buttons/btnPlus.png" />
|
||||
<img id="iconShapeMorePoints" class="icon" src="img/shapeMorePoints.gif" />
|
||||
<img class="btn" id="btnShapeOk" src="img/buttons/btnOk.png">
|
||||
<img id="iconShapeLessPoints" src="http://draw.doodle3d.com/img/shapeLessPoints.gif" />
|
||||
<img class="btn" id="btnShapeMin" src="http://draw.doodle3d.com/img/buttons/btnMin.png" />
|
||||
<img class="btn" id="btnShapePlus" src="http://draw.doodle3d.com/img/buttons/btnPlus.png" />
|
||||
<img id="iconShapeMorePoints" class="icon" src="http://draw.doodle3d.com/img/shapeMorePoints.gif" />
|
||||
<img class="btn" id="btnShapeOk" src="http://draw.doodle3d.com/img/buttons/btnOk.png">
|
||||
</div>
|
||||
<canvas id="shapePreview" width="150" height="150"></canvas><br/>
|
||||
<div id="lblShapeResolution"></div>
|
||||
@ -155,13 +155,13 @@
|
||||
|
||||
<div id="popupSettings" class="popup">
|
||||
<div class="toppanel">
|
||||
<img class="title" src="img/settings_title.png" alt="settings" />
|
||||
<img class="title" src="http://draw.doodle3d.com/img/settings_title.png" alt="settings" />
|
||||
</div>
|
||||
<div class="bottompanel">
|
||||
<div id="settingsContainer"></div>
|
||||
<div class="right">
|
||||
<div class="btnContainer">
|
||||
<img src="img/buttons/btnOk.png" class="btn btnOK" alt="save"/>
|
||||
<img src="http://draw.doodle3d.com/img/buttons/btnOk.png" class="btn btnOK" alt="save"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -171,19 +171,17 @@
|
||||
</div>
|
||||
|
||||
<div id="portrait">
|
||||
<img id="vertImage" src="img/bg_vertical.png"/>
|
||||
<img id="vertImage" src="http://draw.doodle3d.com/img/bg_vertical.png"/>
|
||||
</div>
|
||||
<div id="helpContainer"></div>
|
||||
|
||||
<script src="js/libs/jquery-1-9-1.min.js"></script>
|
||||
<!-- <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script> -->
|
||||
<script src="js/libs/jquery-cookie.min.js"></script>
|
||||
<script src="js/libs/jquery-joyride-2-1.min.js"></script>
|
||||
<script src="js/libs/jquery-coolfieldset.min.js"></script>
|
||||
<script src="js/libs/FileSaver.min.js"></script>
|
||||
<script src="js/libs/jquery-fastclick.min.js"></script>
|
||||
<!-- <script src="js/doodle3d-client.min.js"></script> -->
|
||||
<script src="js/doodle3d-client.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/jquery-1-9-1.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/jquery-cookie.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/jquery-joyride-2-1.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/jquery-coolfieldset.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/FileSaver.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/libs/jquery-fastclick.min.js"></script>
|
||||
<script src="http://draw.doodle3d.com/js/doodle3d-client.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user