Skip to content

Sync MaRGE's hardware fields with the landing page, regroup Status and Start, and start pulserver from the page - #15

Merged
mcencini merged 3 commits into
masterfrom
claude/project-thread-97su71
Oct 6, 2026
Merged

mcencini merged 3 commits into
masterfrom
claude/project-thread-97su71

Conversation

@mcencini

@mcencini mcencini commented Oct 6, 2026 •

Copy link
Copy Markdown

Requested by Matteo · project thread

Before: the landing page's scanner settings reached pulserver only. MaRGE's Gradients and RF tabs kept their own values (Gx/Gy/Gz max, slew, raster, rise time, steps, delay, de-blanking time, RF dead time, gamma, Larmor), so the two could disagree. The status row was called Console, Open MaRGE sat under Status and the launcher under Start pulserver. Every change of settings or update meant downloading the launcher and running it again.

After: when MaRGE opens from the landing page, those fields are filled from the scanner pulserver was started with and are read-only, with a tip saying they are set on the page. The row is called Docker, Open MaRGE sits under Start pulserver, and the launcher download is at the bottom of Status. The launcher only has to be run once: after that, the page's Start pulserver button starts or updates pulserver with the page's settings directly.

The button can't run Docker from inside the page: a browser page cannot run commands on the computer, and that includes Pyodide. So the launcher registers itself as the handler of pulserver: links, and the button opens one of those links.

How:

  • boot.hardware_fields maps the limits block to MaRGE's field texts: gradient units are converted with gamma, rise time = max_grad/max_slew, steps = rise/raster, de-blanking = rf_dead_time, RF dead time = rf_ringdown_time, and Larmor = gamma·B0. The page passes the last started settings to boot.start. A page opened with ?console= leaves the fields editable.
  • The launcher copies itself to ~/.pulserver and registers the copy as the pulserver: handler: a desktop entry on Linux, an osacompile applet re-signed ad hoc on macOS, and an HKCU URL protocol on Windows.
  • Start opens pulserver:start/x<limits>.x<sequences>.x<recon>, where each part is base64url behind an x. The handler decodes the settings as data, never as code, and logs to ~/.pulserver/launcher.log on macOS and Linux. On Windows it shows a window, which pauses only if the launch fails.
  • Tests: tests/test_boot.py covers the field mapping. tests/test_launcher.py covers installing the handler and starting from a link, for both the shell and batch launchers. The macOS applet is not exercised in CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_012vtPr1RHY3npHWe7bMTGrr

…and regroup Status and Start

The fields the scanner determines (per-axis gmax, slew, raster, rise time,
steps, delay, RFPA de-blanking time, RF dead time, gyromagnetic ratio,
Larmor frequency) are written from the settings of the launcher last
downloaded and made read-only. The Console row is named Docker, Open MaRGE
moves under Start pulserver, and the launcher to the bottom of Status.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012vtPr1RHY3npHWe7bMTGrr
@mcencini mcencini self-assigned this Oct 6, 2026
…registers

A launcher run once copies itself to ~/.pulserver and registers that copy as
the handler of pulserver: links (desktop entry on Linux, applet on macOS,
HKCU URL protocol on Windows). The page's Start pulserver button opens
pulserver:start/x<limits>.x<sequences>.x<recon>, and the handler starts
pulserver with those settings.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012vtPr1RHY3npHWe7bMTGrr
@mcencini mcencini changed the title Set MaRGE's Gradients and RF fields from the landing page's scanner, and regroup Status and Start Sync MaRGE's hardware fields with the landing page, regroup Status and Start, and start pulserver from the page Oct 6, 2026
@mcencini
mcencini merged commit 6caf181 into master Oct 6, 2026
3 checks passed
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.

2 participants