mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 01:07:56 +01:00
Makerbot start- and endcode settings
This commit is contained in:
parent
636d00370a
commit
96a48b38d9
@ -44,8 +44,7 @@ function SettingsWindow() {
|
|||||||
this.retryLoadSettingsDelay; // retry setTimout instance
|
this.retryLoadSettingsDelay; // retry setTimout instance
|
||||||
this.retrySaveSettingsDelay; // retry setTimout instance
|
this.retrySaveSettingsDelay; // retry setTimout instance
|
||||||
this.retryRetrieveNetworkStatusDelay;// retry setTimout instance
|
this.retryRetrieveNetworkStatusDelay;// retry setTimout instance
|
||||||
|
|
||||||
|
|
||||||
this.apFieldSet;
|
this.apFieldSet;
|
||||||
this.clientFieldSet;
|
this.clientFieldSet;
|
||||||
this.networks;
|
this.networks;
|
||||||
@ -108,7 +107,8 @@ function SettingsWindow() {
|
|||||||
self.form.submit(function (e) { self.submitwindow(e) });
|
self.form.submit(function (e) { self.submitwindow(e) });
|
||||||
|
|
||||||
self.loadSettings();
|
self.loadSettings();
|
||||||
|
|
||||||
|
self.printerSelector = self.form.find("#printerType");
|
||||||
var btnAP = self.form.find("label[for='ap']");
|
var btnAP = self.form.find("label[for='ap']");
|
||||||
var btnClient = self.form.find("label[for='client']");
|
var btnClient = self.form.find("label[for='client']");
|
||||||
var btnRefresh = self.form.find("#refreshNetworks");
|
var btnRefresh = self.form.find("#refreshNetworks");
|
||||||
@ -117,14 +117,17 @@ function SettingsWindow() {
|
|||||||
var networkSelector = self.form.find("#network");
|
var networkSelector = self.form.find("#network");
|
||||||
self.apFieldSet = self.form.find("#apSettings");
|
self.apFieldSet = self.form.find("#apSettings");
|
||||||
self.clientFieldSet = self.form.find("#clientSettings");
|
self.clientFieldSet = self.form.find("#clientSettings");
|
||||||
|
self.gcodeSettings = self.form.find("#gcodeSettings");
|
||||||
|
self.x3gSettings = self.form.find("#x3gSettings");
|
||||||
|
|
||||||
btnAP.on('touchstart mousedown',self.showAPSettings);
|
btnAP.on('touchstart mousedown',self.showAPSettings);
|
||||||
btnClient.on('touchstart mousedown',self.showClientSettings);
|
btnClient.on('touchstart mousedown',self.showClientSettings);
|
||||||
btnRefresh.on('touchstart mousedown',self.refreshNetworks);
|
btnRefresh.on('touchstart mousedown',self.refreshNetworks);
|
||||||
btnConnect.on('touchstart mousedown',self.connectToNetwork);
|
btnConnect.on('touchstart mousedown',self.connectToNetwork);
|
||||||
btnCreate.on('touchstart mousedown',self.createAP);
|
btnCreate.on('touchstart mousedown',self.createAP);
|
||||||
|
self.printerSelector.change(self.printerSelectorChanged);
|
||||||
networkSelector.change(self.networkSelectorChanged);
|
networkSelector.change(self.networkSelectorChanged);
|
||||||
|
|
||||||
// update panel
|
// update panel
|
||||||
var $updatePanelElement = self.form.find("#updatePanel");
|
var $updatePanelElement = self.form.find("#updatePanel");
|
||||||
self.updatePanel.init(wifiboxURL,$updatePanelElement);
|
self.updatePanel.init(wifiboxURL,$updatePanelElement);
|
||||||
@ -220,6 +223,7 @@ function SettingsWindow() {
|
|||||||
var value = settings[element.attr('name')];
|
var value = settings[element.attr('name')];
|
||||||
element.val(value);
|
element.val(value);
|
||||||
});
|
});
|
||||||
|
self.printerSelectorChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveSettings = function(newSettings,complete) {
|
this.saveSettings = function(newSettings,complete) {
|
||||||
@ -303,6 +307,22 @@ function SettingsWindow() {
|
|||||||
//console.log(settings);
|
//console.log(settings);
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.printerSelectorChanged = function(e) {
|
||||||
|
var selectedOption = self.printerSelector.find("option:selected");
|
||||||
|
switch(selectedOption.val()) {
|
||||||
|
case "makerbot_generic":
|
||||||
|
case "makerbot_replicator2":
|
||||||
|
case "makerbot_thingomatic":
|
||||||
|
self.gcodeSettings.hide();
|
||||||
|
self.x3gSettings.show();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
self.x3gSettings.hide();
|
||||||
|
self.gcodeSettings.show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Networks ui
|
* Networks ui
|
||||||
|
@ -35,6 +35,7 @@ function generate_gcode() {
|
|||||||
gcode = [];
|
gcode = [];
|
||||||
|
|
||||||
console.log("settings: ",settings);
|
console.log("settings: ",settings);
|
||||||
|
var printerType = settings["printer.type"];
|
||||||
var speed = settings["printer.speed"]
|
var speed = settings["printer.speed"]
|
||||||
var normalSpeed = speed;
|
var normalSpeed = speed;
|
||||||
var bottomSpeed = speed*0.5;
|
var bottomSpeed = speed*0.5;
|
||||||
@ -60,13 +61,28 @@ function generate_gcode() {
|
|||||||
var gCodeOffsetX = printerBedWidth/2; //110; // mm
|
var gCodeOffsetX = printerBedWidth/2; //110; // mm
|
||||||
var gCodeOffsetY = printerBedHeight/2; //110; // mm
|
var gCodeOffsetY = printerBedHeight/2; //110; // mm
|
||||||
|
|
||||||
var startGcode = settings["printer.startgcode"];
|
|
||||||
startGcode = subsituteVariables(startGcode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
|
var startCode = "";
|
||||||
startGcode = startGcode.split("\n");
|
var endCode = "";
|
||||||
|
|
||||||
|
switch(printerType) {
|
||||||
|
case "makerbot_generic":
|
||||||
|
case "makerbot_replicator2":
|
||||||
|
case "makerbot_thingomatic":
|
||||||
|
startCode = settings["printer.startcode.x3g"];
|
||||||
|
endCode = settings["printer.endcode.x3g"];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
startCode = settings["printer.startcode.marlin"];
|
||||||
|
endCode = settings["printer.endcode.marlin"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
startCode = subsituteVariables(startCode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
|
||||||
|
startCode = startCode.split("\n");
|
||||||
|
|
||||||
var endGcode = settings["printer.endgcode"];
|
endCode = subsituteVariables(endCode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
|
||||||
endGcode = subsituteVariables(endGcode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
|
endCode = endCode.split("\n");
|
||||||
endGcode = endGcode.split("\n");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
console.log("f:generate_gcode >> EFFE CHECKEN:");
|
console.log("f:generate_gcode >> EFFE CHECKEN:");
|
||||||
@ -114,7 +130,7 @@ function generate_gcode() {
|
|||||||
//gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it
|
//gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it
|
||||||
|
|
||||||
// add gcode begin commands
|
// add gcode begin commands
|
||||||
gcode = gcode.concat(startGcode);
|
gcode = gcode.concat(startCode);
|
||||||
|
|
||||||
//gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it
|
//gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it
|
||||||
|
|
||||||
@ -258,7 +274,7 @@ function generate_gcode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add gcode end commands
|
// add gcode end commands
|
||||||
gcode = gcode.concat(endGcode);
|
gcode = gcode.concat(endCode);
|
||||||
|
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,12 @@ form .errorMsg {
|
|||||||
color: #f00;
|
color: #f00;
|
||||||
margin: 0 0 0 1em;
|
margin: 0 0 0 1em;
|
||||||
}
|
}
|
||||||
|
form .intro {
|
||||||
|
margin: 0 0 0.5em 0;
|
||||||
|
}
|
||||||
|
form dl {
|
||||||
|
margin: 0.5em 0 0 0;
|
||||||
|
}
|
||||||
form dl dt {
|
form dl dt {
|
||||||
float: left;
|
float: left;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<option value="tantillus">Tantillus</option>
|
<option value="tantillus">Tantillus</option>
|
||||||
<option value="vision_3d_printer">Vision 3D Printer</option>
|
<option value="vision_3d_printer">Vision 3D Printer</option>
|
||||||
<option value="marlin_generic">Generic Marlin Printer</option>
|
<option value="marlin_generic">Generic Marlin Printer</option>
|
||||||
|
<option value="makerbot_generic">Generic Makerbot Printer</option>
|
||||||
</select><br/>
|
</select><br/>
|
||||||
<label for="printerBedWidth">Bed width:</label><input id="printerBedWidth" type="number" class="small" name="printer.bed.width">mm<br>
|
<label for="printerBedWidth">Bed width:</label><input id="printerBedWidth" type="number" class="small" name="printer.bed.width">mm<br>
|
||||||
<label for="printerBedHeight">Bed height:</label><input id="printerBedHeight" type="number" class="small" name="printer.bed.height">mm<br>
|
<label for="printerBedHeight">Bed height:</label><input id="printerBedHeight" type="number" class="small" name="printer.bed.height">mm<br>
|
||||||
@ -132,15 +133,16 @@
|
|||||||
<small id="updateInfo"></small>
|
<small id="updateInfo"></small>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset id="gcodeSettings">
|
||||||
<legend>GCODE settings</legend>
|
<legend>GCODE settings</legend>
|
||||||
<div class="startgcode_left">
|
<small class="intro">GCode settings for all printers that use Marlin firmware</small>
|
||||||
<label for="startgcode">Start:</label><br/>
|
<div class="startgcode_left">
|
||||||
<textarea id="startgcode" class="gcode" name="printer.startgcode"></textarea>
|
<label for="startgcodeMarlin">Start:</label><br/>
|
||||||
|
<textarea id="startgcodeMarlin" class="gcode" name="printer.startcode.marlin"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="endgcode">End:</label><br/>
|
<label for="endgcodeMarlin">End:</label><br/>
|
||||||
<textarea id="endgcode" class="gcode" name="printer.endgcode"></textarea>
|
<textarea id="endcodeMarlin" class="gcode" name="printer.endcode.marlin"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
The following texts are replaced:
|
The following texts are replaced:
|
||||||
@ -152,6 +154,28 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</small>
|
</small>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<fieldset id="x3gSettings">
|
||||||
|
<legend>X3G settings</legend>
|
||||||
|
<small class="intro">X3G settings for all printers that use Sailfish firmware, like Makerbots.</small>
|
||||||
|
<div class="startgcode_left">
|
||||||
|
<label for="startgcodeX3G">Start:</label><br/>
|
||||||
|
<textarea id="startcodeX3G" class="gcode" name="printer.startcode.x3g"></textarea>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="endgcodeX3G">End:</label><br/>
|
||||||
|
<textarea id="endcodeX3G" class="gcode" name="printer.endcode.x3g"></textarea>
|
||||||
|
</div>
|
||||||
|
<small>
|
||||||
|
The following texts are replaced:
|
||||||
|
<dl>
|
||||||
|
<dt>{printingTemp}</dt><dd>Printing temperature</dd>
|
||||||
|
<dt>{printingBedTemp}</dt><dd>Printing bed temperature</dd>
|
||||||
|
<dt>{preheatTemp}</dt><dd>Preheat temperature</dd>
|
||||||
|
<dt>{preheatBedTemp}</dt><dd>Preheat bed temperature</dd>
|
||||||
|
</dl>
|
||||||
|
</small>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
</form><br/>
|
</form><br/>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user