app
Base Scaffold Control Panel
Public Made by Adomby adom
The Base Scaffold System's control panel: electrical specifications and the connect/disconnect interface between a base scaffold and the workcell ecosystem.
← Commit history
README.html+32@@ -99,6 +99,17 @@ else { g.onclick = () => { groundOn = !groundOn; viewer.setGroundVisible(groundOn); paint(); }; l.onclick = () => { viewer.setBottomLight(!viewer.getBottomLightState()); paint(); }; paint(); ctl.style.display = 'flex';+ addEventListener('message', (e) => {+ const d = e.data || {};+ if (d.type !== 'cp-cam' || (d.board && d.board !== 'workcell')) return;+ try {+ const c = viewer.getCamera();+ if (Array.isArray(d.target)) c.setTarget(new window.BABYLON.Vector3(...d.target));+ if (typeof d.alpha === 'number') c.alpha = d.alpha;+ if (typeof d.beta === 'number') c.beta = d.beta;+ if (typeof d.radius === 'number') c.radius = d.radius;+ } catch (err) {}+ }); }).catch(() => wrap.remove()); } catch (e) { wrap.remove(); } }@@ -142,6 +153,17 @@ else { g.onclick = () => { groundOn = !groundOn; viewer.setGroundVisible(groundOn); paint(); }; l.onclick = () => { viewer.setBottomLight(!viewer.getBottomLightState()); paint(); }; paint(); ctl.style.display = 'flex';+ addEventListener('message', (e) => {+ const d = e.data || {};+ if (d.type !== 'cp-cam' || (d.board && d.board !== 'scaffold')) return;+ try {+ const c = viewer.getCamera();+ if (Array.isArray(d.target)) c.setTarget(new window.BABYLON.Vector3(...d.target));+ if (typeof d.alpha === 'number') c.alpha = d.alpha;+ if (typeof d.beta === 'number') c.beta = d.beta;+ if (typeof d.radius === 'number') c.radius = d.radius;+ } catch (err) {}+ }); }).catch(() => wrap.remove()); } catch (e) { wrap.remove(); } }@@ -267,5 +289,15 @@ else { post(); })(); </script>+<script>+// cp-cam relay: forward camera messages from the parent page into the viewer iframes+addEventListener('message', function (e) {+ var d = e.data || {};+ if (d.type !== 'cp-cam') return;+ document.querySelectorAll('iframe.vframe').forEach(function (f) {+ try { f.contentWindow.postMessage(d, '*'); } catch (err) {}+ });+});+</script> </body> </html>