api and event additions by request
This commit is contained in:
parent
6088bc7684
commit
d017efee19
2 changed files with 11 additions and 4 deletions
|
|
@ -55,6 +55,7 @@
|
||||||
// extend KIRI API with local functions
|
// extend KIRI API with local functions
|
||||||
API.show.devices = showDevices;
|
API.show.devices = showDevices;
|
||||||
API.device.set = selectDevice;
|
API.device.set = selectDevice;
|
||||||
|
API.device.clone = cloneDevice;
|
||||||
|
|
||||||
function settings() {
|
function settings() {
|
||||||
return API.conf.get();
|
return API.conf.get();
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,8 @@
|
||||||
},
|
},
|
||||||
device: {
|
device: {
|
||||||
get: currentDeviceName,
|
get: currentDeviceName,
|
||||||
set: undefined // set during init
|
set: undefined, // set during init
|
||||||
|
clone: undefined // set during init
|
||||||
},
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
show: showModal,
|
show: showModal,
|
||||||
|
|
@ -688,11 +689,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isCam = MODE === MODES.CAM, pMode = getMode();
|
||||||
|
|
||||||
setViewMode(VIEWS.PREVIEW);
|
setViewMode(VIEWS.PREVIEW);
|
||||||
clearPrint();
|
clearPrint();
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
|
API.event.emit('preview.begin', pMode);
|
||||||
let isCam = MODE === MODES.CAM;
|
|
||||||
|
|
||||||
if (isCam) {
|
if (isCam) {
|
||||||
setOpacity(color.cam_preview_opacity);
|
setOpacity(color.cam_preview_opacity);
|
||||||
|
|
@ -716,7 +718,8 @@
|
||||||
|
|
||||||
currentPrint.render();
|
currentPrint.render();
|
||||||
|
|
||||||
API.event.emit('print', getMode());
|
API.event.emit('print', pMode);
|
||||||
|
API.event.emit('preview.end', pMode);
|
||||||
SPACE.platform.add(currentPrint.group);
|
SPACE.platform.add(currentPrint.group);
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
|
|
||||||
|
|
@ -781,7 +784,9 @@
|
||||||
clearPrint();
|
clearPrint();
|
||||||
platform.deselect();
|
platform.deselect();
|
||||||
setViewMode(VIEWS.SLICE);
|
setViewMode(VIEWS.SLICE);
|
||||||
|
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
|
API.event.emit('slice.begin', getMode());
|
||||||
|
|
||||||
let firstMesh = true,
|
let firstMesh = true,
|
||||||
countdown = WIDGETS.length,
|
countdown = WIDGETS.length,
|
||||||
|
|
@ -834,6 +839,7 @@
|
||||||
setProgress(0);
|
setProgress(0);
|
||||||
showSlices(preserveLayer);
|
showSlices(preserveLayer);
|
||||||
SPACE.scene.active();
|
SPACE.scene.active();
|
||||||
|
API.event.emit('slice.end', getMode());
|
||||||
if (callback && typeof callback === 'function') {
|
if (callback && typeof callback === 'function') {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue