add optional gcode post proc func
This commit is contained in:
parent
8fe4a45f19
commit
5f3926d35b
3 changed files with 13 additions and 1 deletions
10
js/kiri.js
10
js/kiri.js
|
|
@ -36,6 +36,8 @@ self.kiri.license = exports.LICENSE;
|
|||
nozzleSize: 1,
|
||||
gcodePre: 1,
|
||||
gcodePost: 1,
|
||||
gcodeProc: 1,
|
||||
gcodeFExt: 1,
|
||||
gcodeFan: 1,
|
||||
gcodeTrack: 1,
|
||||
gcodeLayer: 1
|
||||
|
|
@ -226,6 +228,7 @@ self.kiri.license = exports.LICENSE;
|
|||
spindleMax: 0, // CAM
|
||||
gcodePre: [], // FDM/CAM header script
|
||||
gcodePost: [], // FDM/CAM footer script
|
||||
gcodeProc: "", // FDM post processor script
|
||||
gcodeFan: "", // FDM fan command
|
||||
gcodeTrack: "", // FDM progress command
|
||||
gcodeLayer: "", // FDM layer output
|
||||
|
|
@ -952,12 +955,18 @@ self.kiri.license = exports.LICENSE;
|
|||
var pre = (MODE === MODES.CAM ? "cnc-" : "print-") + (printSeq.toString().padStart(3,"0")),
|
||||
filename = pre,// + (new Date().getTime().toString(36)),
|
||||
fileext = settings.device.gcodeFExt || "gcode",
|
||||
codeproc = settings.device.gcodeProc,
|
||||
octo_host,
|
||||
octo_apik,
|
||||
grid_host,
|
||||
grid_apik,
|
||||
grid_target;
|
||||
|
||||
// run gcode post processor function (when supplied and valid)
|
||||
if (codeproc && self[codeproc]) {
|
||||
gcode = self[codeproc](gcode);
|
||||
}
|
||||
|
||||
function getBlob() {
|
||||
return new Blob(
|
||||
[gcode],
|
||||
|
|
@ -2806,6 +2815,7 @@ self.kiri.license = exports.LICENSE;
|
|||
gcodeLayer: valueOf(cmd.layer, []),
|
||||
gcodePre: valueOf(code.pre, []),
|
||||
gcodePost: valueOf(code.post, []),
|
||||
gcodeProc: valueOf(code.proc, ''),
|
||||
gcodeDwell: valueOf(code.dwell, []),
|
||||
gcodeChange: valueOf(code['tool-change'], []),
|
||||
gcodeFExt: valueOf(code['file-ext'], 'gcode'),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var exports = {
|
||||
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
|
||||
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
|
||||
VERSION:"1.0.78"
|
||||
VERSION:"1.0.79"
|
||||
};
|
||||
if (!module) var module = {};
|
||||
module.exports = exports;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
"cmd":{
|
||||
"fan_power": "M106 S{fan_speed}"
|
||||
},
|
||||
"proc": "btoa",
|
||||
"file-ext": "3w",
|
||||
"settings":{
|
||||
"origin_center": false,
|
||||
"extrude_abs": true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue