stub in placeholder for fdm animation

This commit is contained in:
Stewart Allen 2021-03-04 15:17:09 -05:00
commit f30865c60a
4 changed files with 26 additions and 3 deletions

View file

@ -41,7 +41,7 @@
API = api;
// wire up animate button in ui
api.function.animate = () => {
api.event.on("function.animate", (mode) => {
if (isCamMode && !camStock) {
return api.show.alert("animation requires stock to be enabled");
}
@ -50,7 +50,7 @@
animate();
}
});
};
});
api.event.on("mode.set", (mode) => {
isCamMode = mode === 'CAM';

View file

@ -102,6 +102,24 @@
}
}
api.event.on("function.animate", (mode) => {
if (!isFdmMode) {
return;
}
if (!API.conf.get().controller.danger) {
return;
}
let pct = 0;
let int = setInterval(function() {
if (pct <= 1) {
api.const.STACKS.setFraction(pct);
pct += 0.05;
} else {
api.const.STACKS.setFraction(1);
clearTimeout(int);
}
}, 50);
});
api.event.on("mode.set", mode => {
isFdmMode = mode === 'FDM';
lastMode = mode;