invalidate slice, preview, export on settings changes. fixes #145
This commit is contained in:
parent
886199ff0c
commit
702f9c3a2b
1 changed files with 9 additions and 4 deletions
|
|
@ -91,8 +91,9 @@ function showSettings() {
|
||||||
function updateSettings(opt = {}) {
|
function updateSettings(opt = {}) {
|
||||||
const { controller, device, process, mode, sproc, cproc } = settings;
|
const { controller, device, process, mode, sproc, cproc } = settings;
|
||||||
const { uc } = api;
|
const { uc } = api;
|
||||||
|
const changes = {};
|
||||||
|
|
||||||
updateSettingsFromFields(controller);
|
updateSettingsFromFields(controller, undefined, changes);
|
||||||
|
|
||||||
switch (controller.units) {
|
switch (controller.units) {
|
||||||
case 'mm': uc.setUnits(1); break;
|
case 'mm': uc.setUnits(1); break;
|
||||||
|
|
@ -104,7 +105,7 @@ function updateSettings(opt = {}) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSettingsFromFields(device);
|
updateSettingsFromFields(device, undefined, changes);
|
||||||
|
|
||||||
// range-specific values
|
// range-specific values
|
||||||
if (settings.mode === 'FDM' && api.view.is_slice()) {
|
if (settings.mode === 'FDM' && api.view.is_slice()) {
|
||||||
|
|
@ -123,13 +124,18 @@ function updateSettings(opt = {}) {
|
||||||
updateRange(range.lo, range.hi, changes, add);
|
updateRange(range.lo, range.hi, changes, add);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
updateSettingsFromFields(process);
|
updateSettingsFromFields(process, undefined, changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.extruders && device.extruders[device.internal]) {
|
if (device.extruders && device.extruders[device.internal]) {
|
||||||
updateSettingsFromFields(device.extruders[device.internal]);
|
updateSettingsFromFields(device.extruders[device.internal]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invalidate slice, preview, export on settings changes
|
||||||
|
if (Object.keys(changes).length) {
|
||||||
|
api.function.clear_progress();
|
||||||
|
}
|
||||||
|
|
||||||
api.conf.save();
|
api.conf.save();
|
||||||
|
|
||||||
let compare = sproc[mode][cproc[mode]];
|
let compare = sproc[mode][cproc[mode]];
|
||||||
|
|
@ -161,7 +167,6 @@ function updateSettingsFromFields(setrec, uirec = api.ui, changes) {
|
||||||
if (!setrec) {
|
if (!setrec) {
|
||||||
return console.trace("missing scope");
|
return console.trace("missing scope");
|
||||||
}
|
}
|
||||||
|
|
||||||
let lastChange = api.uc.lastChange();
|
let lastChange = api.uc.lastChange();
|
||||||
|
|
||||||
// for each key in setrec object
|
// for each key in setrec object
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue