Settings rail: add W Axis entry; deploy scripts (local/hardware/prod)
UX
- The V09 redesign already exposed the W axis in the Control jog grid
(row 4 when w.enabled) and as a row in the DRO table. The Settings
shell now also surfaces a dedicated 'W Axis' rail entry that smooth-
scrolls to the W Axis (auxcnc) section of the main settings page.
The rail item is marked active only while the user is on Display &
Units AND the W Axis link was the most recent click.
- The W Axis section in src/svelte-components/src/components/Settings
View.svelte gets an id="w-axis" anchor so the scroll lands cleanly.
Tested live against onefinity.local. Aux status reports
{enabled: true, present: true, pos_mm: 43.96, homed: false}; the W
axis row appears in the DRO with the right purple styling, and the
jog row 4 shows W- / Home W / W+ / Probe.
Deploy scripts
- deploy.sh dispatches to scripts/deploy/{local,hardware,prod}.sh
with shorthand wrappers (deploy-local.sh / deploy-hardware.sh /
deploy-prod.sh).
- local: builds the UI bundle and serves build/http/ via
python3 -m http.server 8770 in a tmux session 'onefin-local'.
Useful for visual iteration on macOS — chrome only, no controller.
- hardware: rsyncs the freshly built build/http/ tree onto the Pi at
onefinity.local and restarts bbctrl. Stages to /tmp on the Pi and
uses sudo to install into the running egg's bbctrl/http directory,
so iteration time is ~5 seconds.
- prod: requires a clean working tree, then runs 'make pkg' followed
by 'make update HOST=onefinity.local PASSWORD=onefinity'.
Defaults can be overridden with environment variables (HOST, PASSWORD,
REMOTE_USER for the hardware path).
This commit is contained in:
@@ -47,6 +47,10 @@ module.exports = {
|
||||
{ sub: "motor", motor: 1, href: "#motor:1", icon: "fa-arrows-up-down-left-right", label: "Motor 1" },
|
||||
{ sub: "motor", motor: 2, href: "#motor:2", icon: "fa-arrows-up-down-left-right", label: "Motor 2" },
|
||||
{ sub: "motor", motor: 3, href: "#motor:3", icon: "fa-arrows-up-down-left-right", label: "Motor 3" },
|
||||
// W axis is auxiliary (auxcnc ESP32). Its config lives inside
|
||||
// the main Settings page; we route to #settings and scroll to
|
||||
// the #w-axis anchor on click.
|
||||
{ sub: "w-axis", href: "#settings", anchor: "w-axis", icon: "fa-arrows-up-down", label: "W Axis" },
|
||||
{ section: " " },
|
||||
{ sub: "macros", href: "#macros", icon: "fa-keyboard", label: "Macros" },
|
||||
{ sub: "cheat-sheet", href: "#cheat-sheet", icon: "fa-book", label: "G-code Cheat Sheet" },
|
||||
@@ -95,6 +99,12 @@ module.exports = {
|
||||
|
||||
is_active: function (item) {
|
||||
if (!item || item.section) return false;
|
||||
// The W Axis rail item is a soft-link into #settings; we mark
|
||||
// it active only when the user is on Display & Units AND the
|
||||
// last clicked rail item was W Axis.
|
||||
if (item.sub === "w-axis") {
|
||||
return this.sub === "settings" && this._w_axis_focus === true;
|
||||
}
|
||||
if (item.sub !== this.sub) return false;
|
||||
if (item.sub === "motor") {
|
||||
return "" + item.motor === "" + this.ridx;
|
||||
@@ -102,6 +112,23 @@ module.exports = {
|
||||
return true;
|
||||
},
|
||||
|
||||
on_rail_click: function (item, ev) {
|
||||
// Soft-link rail items use an anchor and a scrollIntoView call.
|
||||
if (item && item.anchor) {
|
||||
ev.preventDefault();
|
||||
// Navigate to settings if not already there, then scroll.
|
||||
if (location.hash !== item.href) location.hash = item.href;
|
||||
this._w_axis_focus = (item.sub === "w-axis");
|
||||
// Defer the scroll so Vue mounts the inner Svelte page first.
|
||||
setTimeout(() => {
|
||||
const el = document.getElementById(item.anchor);
|
||||
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
}, 250);
|
||||
} else {
|
||||
this._w_axis_focus = false;
|
||||
}
|
||||
},
|
||||
|
||||
showShutdownDialog: function () {
|
||||
SvelteComponents.showDialog("Shutdown");
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ script#settings-shell-view-template(type="text/x-template")
|
||||
template(v-for="item in rail_items")
|
||||
.set-section(v-if="item.section") {{item.section}}
|
||||
a.set-item(v-if="!item.section", :class="{active: is_active(item)}",
|
||||
:href="item.href")
|
||||
:href="item.href", @click="on_rail_click(item, $event)")
|
||||
.fa(:class="item.icon")
|
||||
| {{item.label}}
|
||||
.set-rail-foot
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
{/each}
|
||||
</fieldset>
|
||||
|
||||
<h2>W Axis (auxcnc)</h2>
|
||||
<h2 id="w-axis">W Axis (auxcnc)</h2>
|
||||
<fieldset>
|
||||
<WAxisSettings />
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user