probe-web / @probe-web/ui / ProbeRttPlot
Class: ProbeRttPlot
Defined in: packages/ui/src/rtt-plot.ts:27
<probe-rtt-plot>: plot the numbers coming out of a binary RTT channel.
Native tooling does this with probe-rs trace writing pairs to stdout for an external plot.py; in a browser there is no reason to leave the page. A firmware that writes samples to a BinaryLE channel gets a live trace with no extra tooling. Samples are decoded with a SampleDecoder from the Debugger's rtt-bytes events, or fed in with ProbeRttPlot.push.
Drawn on a canvas rather than with a charting library: a rolling line plot is about a hundred lines, and the alternative is a dependency and its licence for every visitor who loads the page. <probe-memory-view> makes the same call about hex rendering.
Fires
channel-changed: The user picked a different channel.detailis the channel number. A host has to act on it: a channel only yields bytes if it was configured asBinaryLEwhen RTT was set up (debugger.enableRtt({ channels })), which happens once, at the start of a run.
Extends
Constructors
Constructor
new ProbeRttPlot(): ProbeRttPlot;Defined in: node_modules/@lit/reactive-element/development/reactive-element.d.ts:527
Returns
ProbeRttPlot
Inherited from
Properties
| Property | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
debugger | Debugger | null | null | The debugger to follow (from session.debugger()); the panel shows "no debugger" without one. | DebuggerElement.debugger | packages/ui/src/debugger-element.ts:12 |
channel | number | 1 | Which up channel to plot. | - | packages/ui/src/rtt-plot.ts:43 |
format | SampleFormat | 'u32' | How to read the bytes. | - | packages/ui/src/rtt-plot.ts:45 |
window | number | 400 | How many samples to keep on screen. | - | packages/ui/src/rtt-plot.ts:47 |
Accessors
samples
Get Signature
get samples(): readonly number[];Defined in: packages/ui/src/rtt-plot.ts:107
The samples currently shown, for tests and for export.
Returns
readonly number[]
Methods
push()
push(channel, bytes): void;Defined in: packages/ui/src/rtt-plot.ts:80
Feed bytes in directly, as if they came from the Debugger's rtt-bytes event. Bytes for a channel other than ProbeRttPlot.channel are ignored. Used by the tests, and by anything not driving a Debugger.
Parameters
| Parameter | Type |
|---|---|
channel | number |
bytes | Uint8Array |
Returns
void
clear()
clear(): void;Defined in: packages/ui/src/rtt-plot.ts:98
Throw away what is on screen, e.g. after a reset.
Returns
void
draw()
draw(): void;Defined in: packages/ui/src/rtt-plot.ts:129
Redraw the trace. Cheap enough to do on every poll at RTT rates.
Returns
void