Skip to content

Add isolated macro storage and dedicated macro management#362

Open
Q1WP wants to merge 11 commits intobuildbotics:masterfrom
Q1WP:reconstruct/pr-macros
Open

Add isolated macro storage and dedicated macro management#362
Q1WP wants to merge 11 commits intobuildbotics:masterfrom
Q1WP:reconstruct/pr-macros

Conversation

@Q1WP
Copy link
Copy Markdown
Contributor

@Q1WP Q1WP commented Mar 16, 2026

Test deployment: http://bbctrl.dyndns.org:8091/

Fixes #346.
Fixes #347.

This PR contains the macro-related changes requested after the earlier mixed
PRs.

Changes:

  • Macro isolation: macro source files are copied into protected Home/macros
    storage on save/load migration. Older configs are migrated automatically, and
    orphaned protected macro files are cleaned up.
  • Reference system: macros can require referenced axes before run. Homed axes
    are referenced automatically, and manually set positions also establish
    reference.
  • skip_reference_check: per-macro override for homing/setup macros that must
    run before axes are referenced.
  • Restore behavior: after a macro finishes, the previous active program is
    restored.
  • Macros page: moves macro management out of Settings -> Macros into a
    dedicated top-level page.
  • Tabs/visibility/confirm: macros can be organized into tabs, hidden from the
    control page, and optionally confirmed before run.
  • ZEROED state: referenced-but-not-homed axes are shown separately from fully
    unreferenced axes.
  • Protected file access: protected macro directories are hidden from the normal
    file browser, but active macro files remain readable so the control page,
    editor, and toolpath viewer still work.
  • Control-page preflight: missing-reference errors are caught before the run
    confirm dialog, which avoids confirm-then-fail behavior.

Implementation notes:

  • macro isolation copies source files into protected storage; source files are
    not renamed or modified
  • protected macro paths cannot be written or deleted through the normal file
    APIs
  • direct reads of active protected macro files remain allowed so the control
    page, editor, and toolpath viewer work while a macro is running

Validation:

  • python3 -m py_compile on changed Python files
  • node -c on changed JS files
  • controller testing covered macro creation/edit/save, migration, tabs,
    visibility, confirm on/off, skip_reference_check, active macro display, and
    logged-out/read-only macro editing

@Q1WP Q1WP marked this pull request as ready for review March 16, 2026 22:01
@jcoffland
Copy link
Copy Markdown
Member

Sorry, it's taking me awhile to get time to look at these in detail. I've seen they exist and will look at them as soon as I get a chance. I'm traveling a lot right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Macro buttons remain active while other programs are running Consider making programs that are used by macro buttons read only

2 participants