The editor
magnet gui opens your project on a live canvas in the browser. You place and wire blocks, run the
simulation and read the traces, while every edit is written into your .mag source. The text is
the single source of truth and the canvas is a view of it.
$ magnet gui Serving /home/you/hello_pid at http://127.0.0.1:7317/?token=…Ctrl-C to stopmagnet gui is magnet serve --open. It starts a local kernel in the project directory that
serves the editor and a WebSocket on one localhost port, guarded by the token in the URL.
Hand-written text on the canvas
Section titled “Hand-written text on the canvas”The canvas shows a hand-written model faithfully:
- The step’s inputs and outputs are ports.
- Each probed signal has a magnifier on its output port.
- Every hand-written statement, such as a model call, a
fbyor arithmetic, is a custom block named for what it binds, wired by name and read-only. Double-click one to read its statement, and Open in source jumps to its line in the file.
A walkthrough
Section titled “A walkthrough”-
Edit the text. Change
kp: 1.0to2.0in your editor and save. The canvas updates in about 300 ms. -
Add a block. Drag a
Gain,SaturationorSine Wavefrom the palette and wire it in. AGainis an expression and needs no field. A stateful block arrives as:- a field
- a step line
- a
paramsentry
-
Edit parameters. Double-click a block. Only the changed value moves in the text, and your comments and formatting stay. The Variable name field renames the block and every use of it in one edit.
-
Pin a type, or let it follow. Every block with an input, such as a
Gain, aSaturationor aUnit Delay, takes the type of what is wired into it. Its Type reads Inherited, with the type it resolves to, and its text states none (let clamp = limit(u, -1.0, 1.0);,d: UnitDelay). A block with no input, like aSine Wave, has a type of its own.Pick a type to pin it (
let clamp: f32 = …,d: UnitDelay<f32>). A wire never changes a pinned type, and wiring in something else is a type error on the block, not a silent rewrite. Pick Inherited to let it follow again. -
Probe a signal. Hover an output port and click the magnifier, press
P, or right-click and pick Probe this signal. The step gains the argument in@probe(...). Click again to unprobe. -
Add ports. Drag an Input or Output from the palette. A port added to a module is added to every call of that module in the package in the same edit.
-
Group into a module. Select two or more catalog blocks and press
Ctrl+G. Their statements, fields andparamsentries move verbatim into a newmodelandsteppair.Ctrl+Zrestores. -
Run. The simulation settings set
dtand the end time, which are the manifest’s[simulate]table. Run simulates the current text. The first run pays a cargo build, and reruns of an unchanged model start instantly. -
Iterate. Change a value and Run again. The viewer flags a trace as stale whenever the text changed after its run.
Layouts
Section titled “Layouts”Three layouts on the top bar arrange the panes for an activity:
- Modelling puts the Canvas Editor beside the Output Viewer.
- Simulation puts the Canvas Editor beside the Simulation Viewer.
- Deployment puts the Text Editor beside the Deployment Settings: the
[deploy]table, Flash and Watch.
In Deployment, the Model row lists every model the package can ship, and the Firmware row every crate that builds a binary with the chip its runner specifies. Picking either writes the manifest. A firmware walks through it.
Traces
Section titled “Traces”The Simulation layout’s viewer shows one row per probed signal, grouped by the model that produced it. An array probe is one expandable row. Stop ends a runaway run, and a stale flag marks a trace whose text changed since.
Its two sections, Custom Plots and Probes, fold to their headers, and dragging a header’s grip swaps their order. Every plot folds to its title row, and Full screen opens it across most of the window, its settings with it. Remove probe on a probe’s row takes the probe off the model once you Apply; its trace stays until the next run.
To navigate a plot:
- Drag across it to zoom in on that span of time.
- Ctrl and the scroll wheel zoom about the cursor. In full screen, the wheel alone does.
- Shift turns that zoom to the value axis.
- A middle-button drag pans.
- A double-click returns to the whole run.
Model instances and feedback
Section titled “Model instances and feedback”Double-click an instance to view its contents. Its inports and outports are the module’s ports on the parent canvas. Instances are created on the canvas, but their interiors are edited in the text, so the drilled-in view is read-only.
Model calls schedule as full feedthrough (see Causality, delays, and feedback). Wiring an instance’s output back to its input reports an algebraic loop. Place a Unit Delay on the feedback path to break it.
The Output Viewer
Section titled “The Output Viewer”The Output Viewer shows the generated #![no_std] crate live. Hover a block to highlight its
generated lines. Diagnostics outline the offending blocks in red, with the full error in the panel.
View › Toggle Output Left/Right moves it to the other side.
Version and updates
Section titled “Version and updates”Help › Magnetite Version opens a dialog that shows:
- which
magnetserves the canvas - its project root and kernel address
- a link to these docs
Update and Uninstall run magnet self-update and magnet uninstall and print the result.