mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-12-26 14:43:49 +01:00
Merge branch 'master' of https://github.com/Doodle3D/doodle3d-client
# By peteruithoven (3) and Wouter R (1) # Via peteruithoven * 'master' of https://github.com/Doodle3D/doodle3d-client: Properly reading all the values from the form when saving Settings improvements Settings refactoring Add redirect.html (only used as 404 page in captive portal mode).
This commit is contained in:
commit
44c46b47b8
@ -16,8 +16,10 @@ body,th,td {
|
||||
}
|
||||
fieldset {
|
||||
width: 600px;
|
||||
border: 1px solid black;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgb(187, 187, 187);
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
/*padding-left: 20px;*/
|
||||
}
|
||||
@ -29,16 +31,22 @@ label {
|
||||
display: inline-block;
|
||||
}
|
||||
textarea {
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgb(144, 192, 255);
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
input[type="text"] {
|
||||
border: 1px solid black;
|
||||
input[type="text"], input[type="number"] {
|
||||
border: 1px solid rgb(144, 192, 255);
|
||||
margin-right: 5px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
input[type="text"].small {
|
||||
input[type="text"].small, input[type="number"].small {
|
||||
width: 50px;
|
||||
}
|
||||
input[type="text"].large {
|
||||
input[type="text"].large,input[type="number"].large {
|
||||
width: 250px;
|
||||
}
|
||||
legend {
|
||||
@ -58,3 +66,7 @@ textarea.gcode {
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
}
|
||||
form small {
|
||||
margin: 3px 0 0 0;
|
||||
display: block;
|
||||
}
|
||||
|
@ -47,7 +47,11 @@ div.content > div {
|
||||
}
|
||||
|
||||
div.content > div.settings {
|
||||
border: 1px solid #333;
|
||||
border: 1px solid rgb(187, 187, 187);
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
width: 660px;
|
||||
overflow: scroll;
|
||||
max-height: 368px;
|
||||
|
@ -84,7 +84,7 @@
|
||||
</div>
|
||||
<script src="js/libs/jquery-1.8.3.min.js"></script>
|
||||
<!--<script src="js/libs/bootstrap.min.js"></script>-->
|
||||
<script src="js/settings.js"></script>
|
||||
<script src="js/SettingsWindow.js"></script>
|
||||
<script src="js/d3dServerInterfacing.js"></script>
|
||||
<script src="js/buttonbehaviors.js"></script>
|
||||
<script src="js/canvasDrawing_v01.js"></script>
|
||||
|
@ -38,8 +38,10 @@ function Printer() {
|
||||
//this.wifiboxURL = "proxy5.php";
|
||||
console.log(" wifiboxURL: ",this.wifiboxURL);
|
||||
|
||||
this.checkTemperature();
|
||||
this.checkProgress();
|
||||
if(autoUpdate) {
|
||||
this.checkTemperature();
|
||||
this.checkProgress();
|
||||
}
|
||||
}
|
||||
|
||||
this.preheat = function() {
|
||||
|
259
js/SettingsWindow.js
Normal file
259
js/SettingsWindow.js
Normal file
@ -0,0 +1,259 @@
|
||||
//these settings are defined in the firmware (conf_defaults.lua) and will be initialized in loadSettings()
|
||||
var settings = {
|
||||
"network.ap.ssid": "d3d-ap-%%MAC_ADDR_TAIL%%",
|
||||
"network.ap.address": "192.168.10.1",
|
||||
"network.ap.netmask": "255.255.255.0",
|
||||
"printer.temperature": 220,
|
||||
"printer.objectHeight": '???',
|
||||
"printer.layerHeight": 0.2,
|
||||
"printer.wallThickness": 0.7,
|
||||
"printer.speed": 50,
|
||||
"printer.travelSpeed": 200,
|
||||
"printer.filamentThickness": 2.85,
|
||||
"printer.useSubLayers": true,
|
||||
"printer.firstLayerSlow": true,
|
||||
"printer.autoWarmUp": true,
|
||||
"printer.simplify.iterations": 10,
|
||||
"printer.simplify.minNumPoints": 15,
|
||||
"printer.simplify.minDistance": 3,
|
||||
"printer.retraction.enabled": true,
|
||||
"printer.retraction.speed": 250,
|
||||
"printer.retraction.minDistance": 1,
|
||||
"printer.retraction.amount": 2,
|
||||
"printer.autoWarmUpCommand": "M104 S220 (hardcoded temperature)"
|
||||
}
|
||||
|
||||
function SettingsWindow() {
|
||||
this.wifiboxURL;
|
||||
this.window;
|
||||
this.form;
|
||||
this.timeoutTime = 3000;
|
||||
this.retryDelay = 2000; // retry setTimout delay
|
||||
this.retryLoadSettingsDelay; // retry setTimout instance
|
||||
this.retrySaveSettingsDelay; // retry setTimout instance
|
||||
|
||||
// Events
|
||||
SettingsWindow.SETTINGS_LOADED = "settingsLoaded";
|
||||
|
||||
var self = this;
|
||||
|
||||
this.init = function(wifiboxURL) {
|
||||
this.wifiboxURL = wifiboxURL;
|
||||
|
||||
this.window = $("#settings");
|
||||
this.window.find(".btnOK").click(this.submitwindow);
|
||||
this.window.find(".settings").load("settings.html", function() {
|
||||
console.log("Settings:finished loading settings.html, now loading settings...");
|
||||
|
||||
self.form = self.window.find("form");
|
||||
self.form.submit(function (e) { self.submitwindow(e) });
|
||||
|
||||
self.loadSettings();
|
||||
});
|
||||
}
|
||||
this.submitwindow = function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
self.saveSettings();
|
||||
self.hideSettings();
|
||||
}
|
||||
|
||||
this.showSettings = function() {
|
||||
console.log("f:showSettings()");
|
||||
|
||||
this.loadSettings(); // reload settings
|
||||
|
||||
$("#contentOverlay").fadeIn(375, function() {
|
||||
document.body.removeEventListener('touchmove',prevent,false);
|
||||
});
|
||||
}
|
||||
this.hideSettings = function() {
|
||||
$("#contentOverlay").fadeOut(375, function() {
|
||||
document.body.addEventListener('touchmove',prevent,false);
|
||||
});
|
||||
}
|
||||
|
||||
this.loadSettings = function() {
|
||||
if (!communicateWithWifibox) {
|
||||
console.log(" communicateWithWifibox is false: settings aren't being loaded from wifibox...")
|
||||
return;
|
||||
}
|
||||
console.log("Settings:loadSettings() >> getting new data...");
|
||||
|
||||
$.ajax({
|
||||
url: this.wifiboxURL + "/config/all",
|
||||
dataType: 'json',
|
||||
timeout: this.timeoutTime,
|
||||
success: function(data){
|
||||
console.log("Settings:loadSettings response: ",data);
|
||||
// TODO: no request status?
|
||||
settings = data.data;
|
||||
console.log(" settings: ",settings);
|
||||
self.fillForm();
|
||||
$(document).trigger(SettingsWindow.SETTINGS_LOADED);
|
||||
}
|
||||
}).fail(function() {
|
||||
console.log("Settings:loadSettings: failed");
|
||||
clearTimeout(self.retryLoadSettingsDelay);
|
||||
self.retryLoadSettingsDelay = setTimeout(function() { self.loadSettings() },self.retryDelay); // retry after delay
|
||||
});
|
||||
}
|
||||
|
||||
this.saveSettings = function(callback) {
|
||||
console.log("Settings:saveSettings");
|
||||
|
||||
this.readForm();
|
||||
|
||||
if (communicateWithWifibox) {
|
||||
$.ajax({
|
||||
url: this.wifiboxURL + "/config",
|
||||
type: "POST",
|
||||
data: settings,
|
||||
dataType: 'json',
|
||||
timeout: this.timeoutTime,
|
||||
success: function(data){
|
||||
console.log("Settings:saveSettings response: ",data);
|
||||
if(data.status == "error") {
|
||||
clearTimeout(self.retrySaveSettingsDelay);
|
||||
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings() },self.retryDelay); // retry after delay
|
||||
} else {
|
||||
var savedSettings = data.data;
|
||||
$.each(savedSettings, function(index, val) {
|
||||
if (val != "ok") {
|
||||
console.log("ERROR: value '" + index + "' not successfully set. Message: " + val);
|
||||
}
|
||||
});
|
||||
// TODO something like a callback or feedback that saving went well / or failed
|
||||
if (callback != undefined) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
console.log("Settings:saveSettings: failed");
|
||||
clearTimeout(self.retrySaveSettingsDelay);
|
||||
self.retrySaveSettingsDelay = setTimeout(function() { self.saveSettings() },self.retryDelay); // retry after delay
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.fillForm = function() {
|
||||
console.log("SettingsWindow:fillForm");
|
||||
//fill form with loaded settings
|
||||
var selects = this.form.find("select");
|
||||
selects.each( function(index,element) {
|
||||
var element = $(element);
|
||||
element.val(settings[element.attr('name')]);
|
||||
});
|
||||
|
||||
var inputs = this.form.find("input");
|
||||
inputs.each( function(index,element) {
|
||||
var element = $(element);
|
||||
//console.log("printer setting input: ",index,element.attr("type"),element.attr('name')); //,element);
|
||||
switch(element.attr("type")) {
|
||||
case "text":
|
||||
case "number":
|
||||
element.val(settings[element.attr('name')]);
|
||||
break;
|
||||
case "checkbox":
|
||||
element.prop('checked', settings[element.attr('name')]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
var textareas = this.form.find("textarea");
|
||||
console.log(textareas);
|
||||
textareas.each( function(index,element) {
|
||||
var element = $(element);
|
||||
|
||||
console.log("printer setting textarea: ",index,element.attr('name')); //,element);
|
||||
var value = settings[element.attr('name')];
|
||||
element.val(value);
|
||||
console.log(" value: ",value);
|
||||
});
|
||||
}
|
||||
|
||||
this.readForm = function() {
|
||||
console.log("SettingsWindow:readForm");
|
||||
var selects = this.form.find("select");
|
||||
selects.each( function(index,element) {
|
||||
var element = $(element);
|
||||
settings[element.attr('name')] = element.val();
|
||||
});
|
||||
|
||||
var inputs = this.form.find("input");
|
||||
inputs.each( function(index,element) {
|
||||
var element = $(element);
|
||||
switch(element.attr("type")) {
|
||||
case "text":
|
||||
case "number":
|
||||
settings[element.attr('name')] = element.val();
|
||||
break;
|
||||
case "checkbox":
|
||||
settings[element.attr('name')] = element.prop('checked')
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
var textareas = this.form.find("textarea");
|
||||
textareas.each( function(index,element) {
|
||||
var element = $(element);
|
||||
settings[element.attr('name')] = element.val();
|
||||
});
|
||||
console.log(settings);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************
|
||||
*
|
||||
*
|
||||
* FROM DOODLE3D.INI
|
||||
*
|
||||
*/
|
||||
//TODO: find all references to these variables, replace them and finally remove these.
|
||||
var objectHeight = 20;
|
||||
var layerHeight = .2;
|
||||
//var wallThickness = .5;
|
||||
var hop = 0;
|
||||
//var speed = 70;
|
||||
//var travelSpeed = 200;
|
||||
var enableTraveling = true;
|
||||
//var filamentThickness = 2.89;
|
||||
var minScale = .3;
|
||||
var maxScale = 1;
|
||||
var shape = "%";
|
||||
var twists = 0;
|
||||
var useSubLayers = true;
|
||||
//var debug = false; // debug moved to main.js
|
||||
var loglevel = 2;
|
||||
var zOffset = 0;
|
||||
var serverport = 8888;
|
||||
var autoLoadImage = "hand.txt";
|
||||
var loadOffset = [0, 0]; // x en y ?
|
||||
var showWarmUp = true;
|
||||
var loopAlways = false;
|
||||
var firstLayerSlow = true;
|
||||
var useSubpathColors = false;
|
||||
var autoWarmUp = true;
|
||||
var maxObjectHeight = 150;
|
||||
var maxScaleDifference = .1;
|
||||
var frameRate = 60;
|
||||
var quitOnEscape = true;
|
||||
var screenToMillimeterScale = .3; // 0.3
|
||||
var targetTemperature = 230;
|
||||
var simplifyiterations = 10;
|
||||
var simplifyminNumPoints = 15;
|
||||
var simplifyminDistance = 3;
|
||||
var retractionspeed = 50;
|
||||
var retractionminDistance = 5;
|
||||
var retractionamount = 3;
|
||||
var sideis3D = true;
|
||||
var sidevisible = true;
|
||||
var sidebounds = [900, 210, 131, 390];
|
||||
var sideborder = [880, 169, 2, 471];
|
||||
var windowbounds = [0, 0, 800, 500];
|
||||
var windowcenter = true;
|
||||
var windowfullscreen = false;
|
||||
var autoWarmUpCommand = "M104 S230";
|
||||
//var checkTemperatureInterval = 3;
|
||||
var autoWarmUpDelay = 3;
|
@ -165,7 +165,7 @@ function initButtonBehavior() {
|
||||
btnSettings.bind('touchstart mousedown',function () {
|
||||
//e.preventDefault();
|
||||
//console.log("btnSettings clicked");
|
||||
showSettings();
|
||||
settingsWindow.showSettings();
|
||||
});
|
||||
// btnSettings.on('touchend', function(e) {
|
||||
// e.preventDefault();
|
||||
|
@ -301,7 +301,7 @@ function onCanvasMouseMove(e) {
|
||||
|
||||
if (prevPoint.x != -1 || prevPoint.y != -1) {
|
||||
var dist = Math.sqrt(Math.pow((prevPoint.x - x), 2) + Math.pow((prevPoint.y - y), 2));
|
||||
if (dist > 5) {
|
||||
if (dist > 5) { // replace by setting: doodle3d.simplify.minDistance
|
||||
_points.push([x, y, false]);
|
||||
adjustBounds(x, y)
|
||||
adjustPreviewTransformation();
|
||||
|
42
js/main.js
42
js/main.js
@ -2,9 +2,10 @@ var debugMode = false; // debug mode
|
||||
var sendPrintCommands = true; // if Doodle3d should send print commands to the 3d printer
|
||||
var communicateWithWifibox = true; // if Doodle3d should try interfacing with the wifibox (in case one is not connected)
|
||||
var wifiboxIsRemote = false; // when you want to run the client on a computer and have it remotely connect to the wifibox
|
||||
var autoUpdate = true; // auto retrieve updates about temperature and progress from printer
|
||||
|
||||
var printer = new Printer();
|
||||
|
||||
var settingsWindow = new SettingsWindow();
|
||||
$(function() {
|
||||
console.log("ready");
|
||||
|
||||
@ -12,7 +13,7 @@ $(function() {
|
||||
if (getURLParameter("p") != "null") sendPrintCommands = (getURLParameter("p") == "1");
|
||||
if (getURLParameter("c") != "null") communicateWithWifibox = (getURLParameter("c") == "1");
|
||||
if (getURLParameter("r") != "null") wifiboxIsRemote = (getURLParameter("r") == "1");
|
||||
|
||||
if (getURLParameter("u") != "null") autoUpdate = (getURLParameter("u") == "1");
|
||||
|
||||
if (wifiboxIsRemote) {
|
||||
wifiboxURL = "http://192.168.5.1/cgi-bin/d3dapi";
|
||||
@ -30,34 +31,27 @@ $(function() {
|
||||
console.log("wifibox URL: " + wifiboxURL);
|
||||
|
||||
initLayouting();
|
||||
|
||||
initDoodleDrawing();
|
||||
initPreviewRendering();
|
||||
|
||||
|
||||
initButtonBehavior();
|
||||
|
||||
initSettingsPopup(wifiboxURL);
|
||||
|
||||
$("#settings .settings").load("settings.html", function() {
|
||||
if (communicateWithWifibox) {
|
||||
console.log("finished loading settings.html, now loading settings...");
|
||||
loadSettings();
|
||||
} else {
|
||||
console.log("finished loading settings.html >> communicateWithWifibox is false: not loading settings");
|
||||
}
|
||||
});
|
||||
|
||||
if(debugMode) {
|
||||
printer.init();
|
||||
$(document).on(Printer.UPDATE,update);
|
||||
|
||||
settingsWindow.init(wifiboxURL);
|
||||
$(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");
|
||||
}
|
||||
|
||||
printer.init();
|
||||
if (communicateWithWifibox) printer.preheat();
|
||||
|
||||
$(document).on(Printer.UPDATE,update);
|
||||
|
||||
})
|
||||
})
|
||||
function settingsLoaded() {
|
||||
console.log("settingsLoaded");
|
||||
console.log("autoWarmUp: ",settings["printer.autoWarmUp"]);
|
||||
if(settings["printer.autoWarmUp"]) {
|
||||
printer.preheat();
|
||||
}
|
||||
}
|
192
js/settings.js
192
js/settings.js
@ -1,192 +0,0 @@
|
||||
var wifiboxURL;//"http://192.168.5.1/cgi-bin/d3dapi";
|
||||
|
||||
//these settings are defined in the firmware (conf_defaults.lua) and will be initialized in loadSettings()
|
||||
var settings = {
|
||||
"network.ap.ssid": "d3d-ap-%%MAC_ADDR_TAIL%%",
|
||||
"network.ap.address": "192.168.10.1",
|
||||
"network.ap.netmask": "255.255.255.0",
|
||||
"printer.temperature": 220,
|
||||
"printer.objectHeight": '???',
|
||||
"printer.layerHeight": 0.2,
|
||||
"printer.wallThickness": 0.7,
|
||||
"printer.speed": 50,
|
||||
"printer.travelSpeed": 200,
|
||||
"printer.filamentThickness": 2.85,
|
||||
"printer.useSubLayers": true,
|
||||
"printer.firstLayerSlow": true,
|
||||
"printer.autoWarmUp": true,
|
||||
"printer.simplify.iterations": 10,
|
||||
"printer.simplify.minNumPoints": 15,
|
||||
"printer.simplify.minDistance": 3,
|
||||
"printer.retraction.enabled": true,
|
||||
"printer.retraction.speed": 250,
|
||||
"printer.retraction.minDistance": 1,
|
||||
"printer.retraction.amount": 2,
|
||||
"printer.autoWarmUpCommand": "M104 S220 (hardcoded temperature)"
|
||||
}
|
||||
|
||||
var settingsForm = $("#settingsForm");
|
||||
settingsForm.submit(function(e) {
|
||||
e.preventDefault();
|
||||
saveSettings();
|
||||
return false;
|
||||
})
|
||||
|
||||
function initSettingsPopup(apiURL) {
|
||||
console.log("f:initSettingsPopup()");
|
||||
wifiboxURL = apiURL;
|
||||
|
||||
if (communicateWithWifibox) loadSettings();
|
||||
|
||||
$("#contentOverlay").hide();
|
||||
|
||||
$("div.content .btnOK").click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// TODO something like a callback or feedback that saving went well / or failed
|
||||
|
||||
if (communicateWithWifibox) saveSettings();
|
||||
|
||||
$("#contentOverlay").fadeOut(375, function() {
|
||||
document.body.addEventListener('touchmove',prevent,false);
|
||||
});
|
||||
|
||||
console.log("button OK in settings popup pressed");
|
||||
});
|
||||
}
|
||||
|
||||
function showSettings() {
|
||||
console.log("f:showSettings()");
|
||||
if (!communicateWithWifibox) console.log(" communicateWithWifibox is false: settings aren't being loaded from wifibox...")
|
||||
$("#contentOverlay").fadeIn(375, function() {
|
||||
console.log("#contentOverlay faded in...");
|
||||
if (communicateWithWifibox) loadSettings();
|
||||
document.body.removeEventListener('touchmove',prevent,false);
|
||||
});
|
||||
}
|
||||
|
||||
function loadSettings() {
|
||||
console.log("f:loadSettings() >> getting new data...");
|
||||
$.get(wifiboxURL + "/config/all", {}, function(data) {
|
||||
settings = JSON.parse(data).data;
|
||||
|
||||
// // var printer_layerHeight = settings["printer.layerHeight"];
|
||||
// // var printer_autoWarmup = settings["printer.autoWarmUp"];
|
||||
// console.log("print_layerHeight = " + settings["printer.layerHeight"]);
|
||||
// console.log("printer_autoWarmup = " + settings["printer.autoWarmUp"] + ", type: " + (typeof settings["printer.autoWarmUp"]));
|
||||
// console.log("printer_useSubLayers = " + settings["printer.useSubLayers"] + " type: " + (typeof settings["printer.useSubLayers"]));
|
||||
// $("#formpje input[name='printer.layerHeight']").attr('value', settings["printer.layerHeight"]);
|
||||
|
||||
|
||||
//update html with loaded wifi settings
|
||||
$("#ipaddress").attr('value', settings["network.ap.address"]);
|
||||
$("#netmask").attr('value', settings["network.ap.netmask"]);
|
||||
$("#ssid").attr('value', settings["network.ap.ssid"]);
|
||||
|
||||
//update html with loaded printer settings
|
||||
|
||||
$("#printersettings input").each( function(index,element) {
|
||||
var element = $(element);
|
||||
//console.log("printer setting input: ",index,element.attr("type"),element.attr('name')); //,element);
|
||||
if(element.attr("type") == "text") {
|
||||
element.val(settings[element.attr('name')]);
|
||||
} else if(element.attr("type") == "checkbox") {
|
||||
element.prop('checked', settings[element.attr('name')]);
|
||||
}
|
||||
|
||||
//console.log(" val: ",$(element).val(),element);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function saveSettings(callback) {
|
||||
console.log("settings form submitted");
|
||||
// console.log(" printer.layerHeight:" + $("#formpje input[name='printer.layerHeight']").attr('value'));
|
||||
// console.log(" first layer slow (checkbox):" + $('#firstLayerSlow').prop('checked'));
|
||||
// console.log(" use sublayers (checkbox):" + $('#useSubLayers').prop('checked'));
|
||||
|
||||
//var printerSettings = {};
|
||||
$("#printersettings input").each( function(index,element) {
|
||||
var element = $(element);
|
||||
//populate settings are with values from html
|
||||
if(element.attr("type") == "text") {
|
||||
settings[element.attr('name')] = element.val();
|
||||
} else if(element.attr("type") == "checkbox") {
|
||||
settings[element.attr('name')] = element.prop('checked')
|
||||
}
|
||||
});
|
||||
|
||||
$.post(
|
||||
wifiboxURL + "/config",
|
||||
settings,
|
||||
function(data) {
|
||||
var res = JSON.parse(data).data;
|
||||
$.each(res, function(index, val) {
|
||||
if (val != "ok") {
|
||||
console.log("ERROR: value '" + index + "' not successfully set. Message: " + val);
|
||||
}
|
||||
});
|
||||
if (callback != undefined) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************
|
||||
*
|
||||
*
|
||||
* FROM DOODLE3D.INI
|
||||
*
|
||||
*/
|
||||
//TODO: find all references to these variables, replace them and finally remove these.
|
||||
var objectHeight = 20;
|
||||
var layerHeight = .2;
|
||||
//var wallThickness = .5;
|
||||
var hop = 0;
|
||||
//var speed = 70;
|
||||
//var travelSpeed = 200;
|
||||
var enableTraveling = true;
|
||||
//var filamentThickness = 2.89;
|
||||
var minScale = .3;
|
||||
var maxScale = 1;
|
||||
var shape = "%";
|
||||
var twists = 0;
|
||||
var useSubLayers = true;
|
||||
//var debug = false; // debug moved to main.js
|
||||
var loglevel = 2;
|
||||
var zOffset = 0;
|
||||
var serverport = 8888;
|
||||
var autoLoadImage = "hand.txt";
|
||||
var loadOffset = [0, 0]; // x en y ?
|
||||
var showWarmUp = true;
|
||||
var loopAlways = false;
|
||||
var firstLayerSlow = true;
|
||||
var useSubpathColors = false;
|
||||
var autoWarmUp = true;
|
||||
var maxObjectHeight = 150;
|
||||
var maxScaleDifference = .1;
|
||||
var frameRate = 60;
|
||||
var quitOnEscape = true;
|
||||
var screenToMillimeterScale = .3; // 0.3
|
||||
var targetTemperature = 230;
|
||||
var simplifyiterations = 10;
|
||||
var simplifyminNumPoints = 15;
|
||||
var simplifyminDistance = 3;
|
||||
var retractionspeed = 50;
|
||||
var retractionminDistance = 5;
|
||||
var retractionamount = 3;
|
||||
var sideis3D = true;
|
||||
var sidevisible = true;
|
||||
var sidebounds = [900, 210, 131, 390];
|
||||
var sideborder = [880, 169, 2, 471];
|
||||
var windowbounds = [0, 0, 800, 500];
|
||||
var windowcenter = true;
|
||||
var windowfullscreen = false;
|
||||
var autoWarmUpCommand = "M104 S230";
|
||||
//var checkTemperatureInterval = 3;
|
||||
var autoWarmUpDelay = 3;
|
13
redirect.html
Normal file
13
redirect.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="1; url=http://draw.doodle3d.com">
|
||||
|
||||
<script>
|
||||
window.location.href = "http://draw.doodle3d.com"
|
||||
</script>
|
||||
|
||||
<title>Page Redirection</title>
|
||||
|
||||
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
|
||||
If you are not redirected automatically, follow the <a href='http://draw.doodle3d.com'>link to the Doodle3D webapp</a>.
|
233
settings.html
233
settings.html
@ -9,216 +9,109 @@
|
||||
<link href="css/settings.css" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<!--<div>-->
|
||||
<!--<button id="loadBtn">load</button> - load data-->
|
||||
<!--</div>-->
|
||||
<!--<div>-->
|
||||
<!--<form action="http://192.168.5.1/cgi-bin/d3dapi/config" method="POST" id="formpje">-->
|
||||
<!--printer.layerHeight: <input type="text" name="printer.layerHeight" value="0.1"><br>-->
|
||||
<!--<input type="submit" value="Submit">-->
|
||||
<!--</form>-->
|
||||
<!--</div>-->
|
||||
<div>
|
||||
<h3 style="font-weight:bold">
|
||||
Not all fields are saveable at the moment
|
||||
</h3>
|
||||
|
||||
<form id="settingsForm">
|
||||
<fieldset>
|
||||
<legend>3D printer</legend>
|
||||
<label for="deviceType">Type:</label>
|
||||
<select id="deviceType">
|
||||
<option value="ultimaker">Ultimaker</option>
|
||||
<option value="ultimaker">Makerbot CupCake</option>
|
||||
<option value="reprap">Prusa Mendel</option>
|
||||
<label for="printerType">Type:</label>
|
||||
<select id="printerType" name="printer.type">
|
||||
<option value="rigidbot">Rigidbot</option>
|
||||
<option value="ultimaker">Ultimaker</option>
|
||||
<option value="makerbot_replicator2">MakerBot Replicator2</option>
|
||||
<option value="makerbot_thingomatic">MakerBot Thing-o-matic</option>
|
||||
<option value="printrbot">Printrbot</option>
|
||||
<option value="bukobot">Bukobot</option>
|
||||
<option value="cartesio">Cartesio</option>
|
||||
<option value="cyrus">Cyrus</option>
|
||||
<option value="delta_rostockmax">Delta RostockMax</option>
|
||||
<option value="deltamaker">Deltamaker</option>
|
||||
<option value="eventorbot">EventorBot</option>
|
||||
<option value="felix">Felix</option>
|
||||
<option value="gigabot">Gigabot</option>
|
||||
<option value="kossel">Kossel</option>
|
||||
<option value="leapfrog_creatr">LeapFrog Creatr</option>
|
||||
<option value="lulzbot_aO_101">LulzBot AO-101</option>
|
||||
<option value="makergear_m2">MakerGear M2</option>
|
||||
<option value="makergear_prusa">MakerGear Prusa</option>
|
||||
<option value="makibox">Makibox</option>
|
||||
<option value="orca_0_3">Orca 0.3</option>
|
||||
<option value="ord_bot_hadron">ORD Bot Hadron</option>
|
||||
<option value="printxel_3d">Printxel 3D</option>
|
||||
<option value="prusa_i3">Prusa I3</option>
|
||||
<option value="prusa_iteration_2">Prusa Iteration 2</option>
|
||||
<option value="rapman">RapMan</option>
|
||||
<option value="reprappro_huxley">RepRapPro Huxley</option>
|
||||
<option value="reprappro_mendel">RepRapPro Mendel</option>
|
||||
<option value="robo_3d_printer">RoBo 3D Printer</option>
|
||||
<option value="shapercube">ShaperCube</option>
|
||||
<option value="tantillus">Tantillus</option>
|
||||
<option value="vision_3d_printer">Vision 3D Printer</option>
|
||||
</select>
|
||||
<br>
|
||||
<label for="deviceSpeed">Speed:</label>
|
||||
<select id="deviceSpeed">
|
||||
<label for="printerBaudrate">Baud rate:</label>
|
||||
<select id="printerBaudrate" name="printer.baudrate">
|
||||
<option value="115200">115200 bps</option>
|
||||
<option value="2500000">2500000 bps</option>
|
||||
</select>
|
||||
<br>
|
||||
<label for="devicePort">Port:</label>
|
||||
<select id="devicePort">
|
||||
<option value="/dev/tty.usbmodem411">/dev/tty.usbmodem411</option>
|
||||
<option value="/dev/tty.usbmodem602">/dev/tty.usbmodem621</option>
|
||||
</select>
|
||||
<button>Check connection...</button>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="printersettings">
|
||||
|
||||
<fieldset id="printersettings">
|
||||
<legend>Print settings</legend>
|
||||
<label for="layerHeight">Layer height:</label><input id="layerHeight" type="text" class="small" name="printer.layerHeight">mm<br>
|
||||
<label for="wallThickness">Wall thickness:</label><input id="wallThickness" type="text" class="small" name="printer.wallThickness">mm<br>
|
||||
<label for="filamentThickness">Filament thickness:</label><input id="filamentThickness" type="text" class="small" name="printer.filamentThickness">mm<br>
|
||||
<label for="temperature">Temperature:</label><input id="temperature" type="text" class="small" name="printer.temperature">degrees C<br>
|
||||
<label for="layerHeight">Layer height:</label><input id="layerHeight" type="number" step="0.01" class="small" name="printer.layerHeight">mm<br>
|
||||
<label for="wallThickness">Wall thickness:</label><input id="wallThickness" type="number" step="0.1" class="small" name="printer.wallThickness">mm<br>
|
||||
<label for="filamentThickness">Filament thickness:</label><input id="filamentThickness" step="0.01" type="number" class="small" name="printer.filamentThickness">mm<br>
|
||||
<label for="temperature">Temperature:</label><input id="temperature" type="number" class="small" name="printer.temperature">degrees C<br>
|
||||
<br>
|
||||
<label for="speed">Speed:</label><input id="speed" type="text" name="printer.speed" class="small">mm/s<br>
|
||||
<label for="travelSpeed">Travel speed:</label><input id="travelSpeed" type="text" name="printer.travelSpeed" class="small">mm/s<br>
|
||||
<label for="speed">Speed:</label><input id="speed" type="number" name="printer.speed" class="small">mm/s<br>
|
||||
<label for="travelSpeed">Travel speed:</label><input id="travelSpeed" type="number" name="printer.travelSpeed" class="small">mm/s<br>
|
||||
<br>
|
||||
<label for="autoWarmUp">Auto warm-up:</label><input id="autoWarmUp" type="checkbox" name="printer.autoWarmUp" value="autoWarmUp"><br>
|
||||
<label for="firstLayerSlow">First layer slow:</label><input id="firstLayerSlow" type="checkbox" name="printer.firstLayerSlow" value="firstLayerSlow"><br>
|
||||
<label for="useSubLayers">Use sub-layers:</label><input id="useSubLayers" type="checkbox" name="printer.useSubLayers" value="firstLayerSlow"><br>
|
||||
<label for="useRetraction">Use retraction:</label><input id="useRetraction" type="checkbox" name="printer.retraction.enabled" value="useRetraction"><br>
|
||||
<label for="useSubLayers">Use sub-layers*:</label><input id="useSubLayers" type="checkbox" name="printer.useSubLayers" value="firstLayerSlow"><br>
|
||||
<small>* Continuously move platform while printing instead of once per layer</small>
|
||||
<br>
|
||||
<label for="retractionAmount">Retraction amount:</label><input id="retractionAmount" type="text" class="small" name="printer.retraction.amount">mm<br>
|
||||
<label for="retractionMinDistance">Retraction min distance:</label><input id="retractionMinDistance" type="text" class="small" name="printer.retraction.minDistance">mm<br>
|
||||
<label for="retractionSpeed">Retraction speed:</label><input id="retractionSpeed" type="text" class="small" name="printer.retraction.speed">mm/s<br>
|
||||
<label for="useRetraction">Use retraction:</label><input id="useRetraction" type="checkbox" name="printer.retraction.enabled" value="useRetraction"><br>
|
||||
<label for="retractionAmount">Retraction amount:</label><input id="retractionAmount" type="number" class="small" name="printer.retraction.amount">mm<br>
|
||||
<label for="retractionMinDistance">Retraction min distance:</label><input id="retractionMinDistance" type="number" class="small" name="printer.retraction.minDistance">mm<br>
|
||||
<label for="retractionSpeed">Retraction speed:</label><input id="retractionSpeed" type="number" class="small" name="printer.retraction.speed">mm/s<br>
|
||||
<br>
|
||||
<label for="autoWarmUp">Auto warm-up:</label><input id="autoWarmUp" type="checkbox" name="printer.autoWarmUp" value="autoWarmUp"><br>
|
||||
<label for="autoWarmUpCommand">Auto Warm up command:</label><input id="autoWarmUpCommand" type="text" name="printer.autoWarmUpCommand"><br>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="doodlesettings">
|
||||
<legend>Doodle3D settings</legend>
|
||||
<label for="objectHeight">Max object height:</label><input id="objectHeight" type="number" class="small" name="doodle3d.objectHeight">mm<br>
|
||||
<label for="simplifyMinDistance">Minimal line distance:</label><input id="simplifyMinDistance" type="number" class="small" name="doodle3d.simplify.minDistance">px<br>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Access point settings</legend>
|
||||
<label for="ipaddress">Wi-Fi box IP address:</label><input type="text" name="ipaddress" id="ipaddress" value="0.3"><br>
|
||||
<label for="netmask">Wi-Fi box netmask:</label><input type="text" name="netmask" id="netmask" value="0.8"><br>
|
||||
<label for="ssid">Wi-Fi box ssid*:</label><input type="text" class="large" name="ssid" id="ssid" value="d3d-ap-%%MAC_ADDR_TAIL%%"> <br>
|
||||
<br>
|
||||
* The macro <em>%%MAC_ADDR_TAIL%%</em> will be replaced by the last 6 digits of your Doodle3D Wi-Fi box's MAC address.<br>
|
||||
<label for="ipaddress">Wi-Fi box IP address:</label><input type="text" name="network.ap.address" id="ipaddress"><br>
|
||||
<label for="netmask">Wi-Fi box netmask:</label><input type="text" name="network.ap.netmask" id="netmask"><br>
|
||||
<label for="ssid">Wi-Fi box ssid*:</label><input type="text" class="large" name="network.ap.ssid" id="ssid"> <br>
|
||||
<small>* The text <em>%%MAC_ADDR_TAIL%%</em> will be replaced by the last 6 digits of your Doodle3D Wi-Fi box's MAC address.</small>
|
||||
</fieldset>
|
||||
|
||||
<!--<fieldset>-->
|
||||
<!--<legend>Doodle3D shape settings</legend>-->
|
||||
|
||||
<!--<label for="minScale">Minimum scale:</label><input type="text" class="small" name="minScale" id="minScale" value="0.3"><br>-->
|
||||
<!--<label for="maxScale">Maximum scale:</label><input type="text" class="small" name="maxScale" id="maxScale" value="0.8"><br>-->
|
||||
<!--<label for="twists">Twists:</label><input type="text" class="small" name="twists" id="twists" value="1.5"><br>-->
|
||||
|
||||
<!--<label for="shape">Vertical shape:</label>-->
|
||||
<!--<select id="shape">-->
|
||||
<!--<option value="/">/</option>-->
|
||||
<!--<option value="|">|</option>-->
|
||||
<!--<option value="/">\</option>-->
|
||||
<!--<option value="#">#</option>-->
|
||||
<!--<option value="$">$</option>-->
|
||||
<!--<option value="%">%</option>-->
|
||||
<!--<option value="^">^</option>-->
|
||||
<!--<option value="*">*</option>-->
|
||||
<!--</select>-->
|
||||
|
||||
<!--<br>-->
|
||||
<!--<label for="simplifyShape">Simplify shape:</label>-->
|
||||
<!--<select id="simplifyShape">-->
|
||||
<!--<option value="strong">strong</option>-->
|
||||
<!--<option value="normal" selected>normal</option>-->
|
||||
<!--<option value="less">less</option>-->
|
||||
<!--<option value="none">no</option>-->
|
||||
<!--</fieldset>-->
|
||||
|
||||
<!--<fieldset>-->
|
||||
<!--<legend>Webserver</legend>-->
|
||||
<!--<label for="serverPort">Port:</label><input type="text" class="small" name="serverPort" id="serverPort" value="8888"><br>-->
|
||||
<!--<label for="serverIP">IP-address:</label><input readonly type="text" name="serverPort" id="serverIP" value="192.168.2.1"><br>-->
|
||||
<!--</fieldset>-->
|
||||
|
||||
<!--<fieldset>-->
|
||||
<!--<legend>Application settings</legend>-->
|
||||
<!--<label for="fullscreen">Start fullscreen:</label><input type="checkbox" name="fullscreen" id="fullscreen" value="fullscreen" checked><br>-->
|
||||
<!--<label for="centerWindow">Center window:</label><input type="checkbox" name="centerWindow" id="centerWindow" value="centerWindow" checked><br>-->
|
||||
<!--<label for="windowWidth">Window width:</label><input type="text" class="small" name="layerHeight" id="windowWidth" value="1120">px<br>-->
|
||||
<!--<label for="windowHeight">Window height:</label><input type="text" class="small" name="layerHeight" id="windowHeight" value="700">px<br>-->
|
||||
<!--</fieldset>-->
|
||||
|
||||
<fieldset>
|
||||
<legend>GCODE settings</legend><br>
|
||||
|
||||
<legend>GCODE settings</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="startgcode">Start:</label><br>
|
||||
<textarea id="startgcode" class="gcode">
|
||||
G21 (mm)
|
||||
G91 (relative)
|
||||
G28 X0 Y0 Z0 (physical home)
|
||||
M104 S230 (temperature)
|
||||
G1 E10 F250 (flow)
|
||||
G92 X-100 Y-100 Z0 E10
|
||||
G1 Z3 F5000 (prevent diagonal line)
|
||||
G90 (absolute)
|
||||
M106 (fan on)
|
||||
<textarea id="startgcode" class="gcode" name="printer.startgcode">
|
||||
</textarea>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<label for="endgcode">End:</label><br>
|
||||
<textarea id="endgcode" class="gcode">
|
||||
G1 X-100 Y-100 F15000 (fast homing)
|
||||
M107
|
||||
M84 (disable axes)
|
||||
<textarea id="endgcode" class="gcode" name="printer.endgcode">
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Advanced settings</legend>
|
||||
<textarea id="advancedSettings">
|
||||
zOffset=0
|
||||
loadOffset=0,0
|
||||
showWarmUp=true
|
||||
loopAlways=false
|
||||
maxObjectHeight=200
|
||||
maxScaleDifference=.1
|
||||
quitOnEscape=true
|
||||
screenToMillimeterScale=.3
|
||||
targetTemperature=230
|
||||
</textarea>
|
||||
</fieldset>
|
||||
<!--<br>-->
|
||||
<!--<input type="submit" value="Save settings">-->
|
||||
</form>
|
||||
</div>
|
||||
<!--<script src="js/jquery-1.8.3.min.js"></script>-->
|
||||
<!--<script src="js/bootstrap.min.js"></script>-->
|
||||
<script src="js/settings.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
// var btnLoad = $("#loadBtn");
|
||||
|
||||
// var myForm = $("#formpje");
|
||||
// myForm.submit(function(e) {
|
||||
// e.preventDefault();
|
||||
// console.log("form submitted");
|
||||
// console.log(" printer.layerHeight:" + $("#formpje input[name='printer.layerHeight']").attr('value'));
|
||||
// $.post(
|
||||
// wifiboxURL + "/config",
|
||||
// {
|
||||
// "printer.layerHeight": $("#formpje input[name='printer.layerHeight']").attr('value')
|
||||
// },
|
||||
// function(data) {
|
||||
// console.log(JSON.stringify(data));
|
||||
// });
|
||||
// return false;
|
||||
// })
|
||||
|
||||
|
||||
|
||||
var sendIndex;
|
||||
var sendLength;
|
||||
$(function() {
|
||||
console.log("ready");
|
||||
|
||||
// if ($("#useRetraction").prop('checked') == true) $(".retractionSettings").show(500);
|
||||
// $("#useRetraction").click(function(e) {
|
||||
// if ($(this).prop('checked')) {
|
||||
// $(".retractionSettings").show(350);
|
||||
// } else {
|
||||
// $(".retractionSettings").hide(350);
|
||||
// }
|
||||
// });
|
||||
|
||||
// btnLoad.click(function(e) {
|
||||
// e.preventDefault();
|
||||
// console.log("load");
|
||||
// });
|
||||
// if (communicateWithWifibox) loadSettings();
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user