fix belt settings mixture across mode changes. commend cleanup, rm dead code
This commit is contained in:
parent
4aa9b7ed49
commit
d88f603e38
4 changed files with 19 additions and 20 deletions
|
|
@ -259,6 +259,13 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
}
|
||||
|
||||
function onBooleanClick(el) {
|
||||
// copy some ui elements to target settings
|
||||
let settings = api.conf.get();
|
||||
settings.device.bedBelt = ui.deviceBelt.checked && api.mode.is_fdm();
|
||||
settings.device.bedRound = ui.deviceRound.checked && api.mode.is_fdm();
|
||||
settings.device.originCenter = ui.deviceOrigin.checked || ui.deviceRound.checked;
|
||||
settings.device.fwRetract = ui.fwRetract.checked;
|
||||
// refresh vars and other ui elements
|
||||
uc.refresh();
|
||||
api.conf.update();
|
||||
DOC.activeElement.blur();
|
||||
|
|
@ -726,8 +733,6 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
try {
|
||||
if (typeof(code) === 'string') code = js2o(code) || {};
|
||||
|
||||
api.event.emit('device.set', devicename);
|
||||
|
||||
let mode = api.mode.get(),
|
||||
lmode = mode.toLowerCase(),
|
||||
current = settings(),
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ gapp.register("kiri.main", [], (root, exports) => {
|
|||
// restore cached device profile for this mode
|
||||
if (current.cdev[mode]) {
|
||||
current.device = clone(current.cdev[mode]);
|
||||
api.event.emit('device.set', currentDeviceName());
|
||||
api.event.emit('device.select', currentDeviceName());
|
||||
}
|
||||
// hide/show
|
||||
api.uc.setVisible($('set-tools'), mode === 'CAM');
|
||||
|
|
|
|||
|
|
@ -46,10 +46,11 @@ function saveSettings() {
|
|||
const mode = settings.mode;
|
||||
settings.sproc[mode].default = settings.process;
|
||||
settings.sproc[mode][settings.process.processName] = settings.process;
|
||||
settings.device.bedBelt = ui.deviceBelt.checked;
|
||||
settings.device.bedRound = ui.deviceRound.checked;
|
||||
settings.device.originCenter = ui.deviceOrigin.checked || ui.deviceRound.checked;
|
||||
settings.device.fwRetract = ui.fwRetract.checked;
|
||||
// moved to init.onBooleanClick() -- delete later after confirming no side-effects
|
||||
// settings.device.bedBelt = ui.deviceBelt.checked;
|
||||
// settings.device.bedRound = ui.deviceRound.checked;
|
||||
// settings.device.originCenter = ui.deviceOrigin.checked || ui.deviceRound.checked;
|
||||
// settings.device.fwRetract = ui.fwRetract.checked;
|
||||
local.setItem('ws-settings', JSON.stringify(settings));
|
||||
api.event.emit('settings.saved', settings);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue