change preview.maxspeed to preview.speeds and emit an object with min/max
This commit is contained in:
parent
c42fc7ee73
commit
abe27001ca
5 changed files with 32 additions and 13 deletions
|
|
@ -953,7 +953,7 @@
|
|||
UI.speeds.style.display = 'none';
|
||||
}
|
||||
|
||||
function updateSpeeds(maxSpeed) {
|
||||
function updateSpeeds(maxSpeed, minSpeed) {
|
||||
UI.speeds.style.display =
|
||||
settings.mode !== 'SLA' &&
|
||||
settings.mode !== 'LASER' &&
|
||||
|
|
@ -977,7 +977,7 @@
|
|||
});
|
||||
UI.speedbar.innerHTML = list.join('');
|
||||
});
|
||||
API.event.emit('preview.maxspeed', maxSpeed);
|
||||
API.event.emit('preview.speeds', {min: minSpeed, max: maxSpeed});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1177,7 +1177,7 @@
|
|||
startTime = mark;
|
||||
}
|
||||
API.show.progress(offset + progress * scale, message);
|
||||
}, function (reply, maxSpeed) {
|
||||
}, function (reply, maxSpeed, minSpeed) {
|
||||
// handle worker errors
|
||||
if (reply && reply.error) {
|
||||
alert2(reply.error, 5);
|
||||
|
|
@ -1224,7 +1224,7 @@
|
|||
SPACE.update();
|
||||
updateSliderMax(true);
|
||||
setVisibleLayer(-1, 0);
|
||||
updateSpeeds(maxSpeed);
|
||||
updateSpeeds(maxSpeed, minSpeed);
|
||||
updateStackLabelState();
|
||||
|
||||
// mark preview complete for export
|
||||
|
|
@ -1267,13 +1267,13 @@
|
|||
setOpacity(0);
|
||||
KIRI.client.parse({code, type, settings}, progress => {
|
||||
API.show.progress(progress, "parsing");
|
||||
}, (layers, maxSpeed) => {
|
||||
}, (layers, maxSpeed, minSpeed) => {
|
||||
API.show.progress(0);
|
||||
STACKS.clear();
|
||||
const stack = STACKS.create('parse', SPACE.platform.world);
|
||||
layers.forEach(layer => stack.add(layer));
|
||||
updateSliderMax(true);
|
||||
updateSpeeds(maxSpeed);
|
||||
updateSpeeds(maxSpeed, minSpeed);
|
||||
showSlices();
|
||||
updateStackLabelState();
|
||||
SPACE.update();
|
||||
|
|
|
|||
Loading…
Reference in a new issue