properly import device's process with new device
This commit is contained in:
parent
77a46b9d15
commit
33770a8918
2 changed files with 23 additions and 12 deletions
|
|
@ -8,6 +8,9 @@
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri.utils
|
// dep: kiri.utils
|
||||||
// dep: kiri.widget
|
// dep: kiri.widget
|
||||||
|
// dep: load.stl
|
||||||
|
// dep: load.obj
|
||||||
|
// dep: load.3mf
|
||||||
gapp.register("kiri.platform", [], (root, exports) => {
|
gapp.register("kiri.platform", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri, moto, load } = root;
|
const { kiri, moto, load } = root;
|
||||||
|
|
|
||||||
|
|
@ -518,30 +518,38 @@ function settingsImport(data, ask) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
function doit() {
|
function doit() {
|
||||||
if (isDevice) {
|
function devset() {
|
||||||
if (settings.devices[data.device]) {
|
|
||||||
uc.confirm(`Replace device ${data.device}?`).then(yes => {
|
|
||||||
if (yes) {
|
|
||||||
settings.devices[data.device] = data.code;
|
settings.devices[data.device] = data.code;
|
||||||
|
settings.devproc[data.device] = data.name;
|
||||||
api.show.devices();
|
api.show.devices();
|
||||||
}
|
}
|
||||||
|
function procset() {
|
||||||
|
settings.sproc[data.mode][data.name] = data.process;
|
||||||
|
if (!isDevice) {
|
||||||
|
api.conf.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isDevice) {
|
||||||
|
if (data.process && data.process.processName && data.code.mode) {
|
||||||
|
data.mode = data.code.mode;
|
||||||
|
data.name = data.process.processName;
|
||||||
|
isProcess = true;
|
||||||
|
}
|
||||||
|
if (settings.devices[data.device]) {
|
||||||
|
uc.confirm(`Replace device ${data.device}?`).then(yes => {
|
||||||
|
if (yes) devset()
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
settings.devices[data.device] = data.code;
|
devset();
|
||||||
api.show.devices();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isProcess) {
|
if (isProcess) {
|
||||||
if (settings.sproc[data.mode][data.name]) {
|
if (settings.sproc[data.mode][data.name]) {
|
||||||
uc.confirm(`Replace process ${data.name}?`).then(yes => {
|
uc.confirm(`Replace process ${data.name}?`).then(yes => {
|
||||||
if (yes) {
|
if (yes) procset();
|
||||||
settings.sproc[data.mode][data.name] = data.process;
|
|
||||||
api.conf.show();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
settings.sproc[data.mode][data.name] = data.process;
|
procset();
|
||||||
api.conf.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isSettings) {
|
if (isSettings) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue