mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 04:27:55 +01:00
simplified add gcode
This commit is contained in:
parent
4747d072b9
commit
8fb0c6090a
16
src/gcode.js
16
src/gcode.js
@ -13,19 +13,21 @@ export default class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addGCode (command) {
|
_addGCode (command) {
|
||||||
var str = '';
|
let str = '';
|
||||||
var first = true;
|
let first = true;
|
||||||
|
|
||||||
for (var i in command) {
|
for (const action in command) {
|
||||||
|
const value = command[action];
|
||||||
|
const currentValue = this.current[action];
|
||||||
if (first) {
|
if (first) {
|
||||||
str = i + command[i];
|
str = action + value;
|
||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
else if (this.current[i] !== command[i]) {
|
else if (currentValue !== value) {
|
||||||
str += ' ' + i + command[i];
|
str += ` ${action}${value}`;
|
||||||
|
|
||||||
this.current[i] = command[i];
|
this.current[action] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user