Skip to content

Commit

Permalink
map old config names to new split settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mith committed Jul 11, 2017
1 parent f87a9c0 commit cff8dff
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
18 changes: 11 additions & 7 deletions src/GCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ export default class {

unRetract() {
const {
retractionEnabled,
retractionMinDistance,
retractionSpeed
retraction: {
enabled: retractionEnabled,
minDistance: retractionMinDistance,
speed: retractionSpeed
}
} = this._settings.config;

if (this._isRetracted && retractionEnabled) {
Expand All @@ -149,10 +151,12 @@ export default class {

retract() {
const {
retractionAmount,
retractionEnabled,
retractionMinDistance,
retractionSpeed
retraction: {
amount: retractionAmount,
enabled: retractionEnabled,
minDistance: retractionMinDistance,
speed: retractionSpeed
}
} = this._settings.config;

if (!this._isRetracted && retractionEnabled) {
Expand Down
2 changes: 1 addition & 1 deletion src/sliceActions/addBrim.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const offsetOptions = {
export default function addBrim(slices, settings) {
console.log('add brim');

let { brimOffset } = settings.config;
let { brim: { offset: brimOffset } } = settings.config;
brimOffset /= PRECISION;

const [firstLayer] = slices;
Expand Down
8 changes: 4 additions & 4 deletions src/sliceActions/generateInfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default function generateInfills(slices, settings) {

let {
layerHeight,
fillGridSize,
bottomThickness,
topThickness,
fill: { gridSize: fillGridSize },
bottom: { thickness: bottomThickness },
top: { thickness: topThickness },
nozzleDiameter,
infillOverlap
fill: { overlap: infillOverlap }
} = settings.config;

fillGridSize /= PRECISION;
Expand Down
2 changes: 1 addition & 1 deletion src/sliceActions/generateInnerLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function generateInnerLines(slices, settings) {
console.log('generating outer lines and inner lines');

// need to scale up everything because of clipper rounding errors
let { layerHeight, nozzleDiameter, shellThickness } = settings.config;
let { layerHeight, nozzleDiameter, shell: { thickness: shellThickness } } = settings.config;
nozzleDiameter /= PRECISION;
shellThickness /= PRECISION;
const nozzleRadius = nozzleDiameter / 2;
Expand Down
12 changes: 7 additions & 5 deletions src/sliceActions/generateSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import { PRECISION } from '../constants.js';
export default function generateSupport(slices, settings) {
console.log('generating support');

if (!settings.config.supportEnabled) return;
if (!settings.config.support.enabled) return;

let {
layerHeight,
supportGridSize,
supportAcceptanceMargin,
supportPlateSize: plateSize,
supportDistanceY,
support: {
gridSize: supportGridSize,
margin: AcceptanceMargin,
plateSize: plateSize,
distanceY: DistanceY
},
nozzleDiameter
} = settings.config;

Expand Down

0 comments on commit cff8dff

Please sign in to comment.