flag mode info with * when profile has been modified from what was saved
This commit is contained in:
parent
09d1b35fe3
commit
eb7a35a9ea
2 changed files with 23 additions and 7 deletions
|
|
@ -640,10 +640,12 @@
|
||||||
if (name) {
|
if (name) {
|
||||||
let np = pl[name] = {};
|
let np = pl[name] = {};
|
||||||
cp.processName = name;
|
cp.processName = name;
|
||||||
|
pl[name] = Object.clone(cp);
|
||||||
for (let k in cp) {
|
for (let k in cp) {
|
||||||
if (!cp.hasOwnProperty(k)) continue;
|
if (!cp.hasOwnProperty(k)) continue;
|
||||||
np[k] = cp[k];
|
np[k] = cp[k];
|
||||||
}
|
}
|
||||||
|
s.cproc[mode] = name;
|
||||||
s.devproc[s.device.deviceName] = name;
|
s.devproc[s.device.deviceName] = name;
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
API.conf.update();
|
API.conf.update();
|
||||||
|
|
|
||||||
|
|
@ -1950,23 +1950,37 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSettings(opt = {}) {
|
function updateSettings(opt = {}) {
|
||||||
updateSettingsFromFields(settings.controller);
|
let { controller, device, process, mode, sproc, cproc } = settings;
|
||||||
switch (settings.controller.units) {
|
updateSettingsFromFields(controller);
|
||||||
|
switch (controller.units) {
|
||||||
case 'mm': UC.setUnits(1); break;
|
case 'mm': UC.setUnits(1); break;
|
||||||
case 'in': UC.setUnits(25.4); break;
|
case 'in': UC.setUnits(25.4); break;
|
||||||
}
|
}
|
||||||
if (opt.controller) {
|
if (opt.controller) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateSettingsFromFields(settings.device);
|
updateSettingsFromFields(device);
|
||||||
updateSettingsFromFields(settings.process);
|
updateSettingsFromFields(process);
|
||||||
let device = settings.device;
|
|
||||||
if (device.extruders && device.extruders[device.internal]) {
|
if (device.extruders && device.extruders[device.internal]) {
|
||||||
updateSettingsFromFields(device.extruders[device.internal]);
|
updateSettingsFromFields(device.extruders[device.internal]);
|
||||||
}
|
}
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
$('mode-device').innerText = settings.device.deviceName;
|
let current = process;
|
||||||
$('mode-profile').innerText = settings.cproc[settings.mode];
|
let compare = sproc[mode][cproc[mode]];
|
||||||
|
let same = true;
|
||||||
|
for (let [key, val] of Object.entries(compare).filter(v => v[0] !== 'processName')) {
|
||||||
|
let tval = current[key];
|
||||||
|
// outputLoopLayers misbehaving and setting null on empty
|
||||||
|
if (val === '' && tval == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (tval != val) {
|
||||||
|
// console.log(key, 'expected', val, 'got', tval);
|
||||||
|
same = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('mode-device').innerText = device.deviceName;
|
||||||
|
$('mode-profile').innerText = `${cproc[mode]}${same ? '' : ' *'}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveSettings() {
|
function saveSettings() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue