move set settings to constructor

This commit is contained in:
casperlamboo 2016-05-08 10:31:00 +02:00 committed by Simon Voordouw
parent be1d1bbac3
commit 726b30621c
2 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,7 @@ const POSITION_Y = 'Y';
const POSITION_Z = 'Z';
export default class {
constructor () {
constructor (settings) {
this.gcode = '';
this.current = {};
@ -19,6 +19,10 @@ export default class {
this.isRetracted = false;
this.isFanOn = false;
this._nozzlePosition = new THREE.Vector2(0, 0);
if (settings !== undefined) {
this.setSettings(settings);
}
}
_addGCode (command) {

View File

@ -3,7 +3,7 @@ import GCode from '../gcode.js';
export default function slicesToGCode(slices, settings) {
console.log('slices to gcode');
const gcode = new GCode().setSettings(settings);
const gcode = new GCode(settings);
for (let layer = 0; layer < slices.length; layer ++) {
const slice = slices[layer];