Skip to content

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. detail is the channel number. A host has to act on it: a channel only yields bytes if it was configured as BinaryLE when RTT was set up (debugger.enableRtt({ channels })), which happens once, at the start of a run.

Extends

Constructors

Constructor

ts
new ProbeRttPlot(): ProbeRttPlot;

Defined in: node_modules/@lit/reactive-element/development/reactive-element.d.ts:527

Returns

ProbeRttPlot

Inherited from

DebuggerElement.constructor

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
debuggerDebugger | nullnullThe debugger to follow (from session.debugger()); the panel shows "no debugger" without one.DebuggerElement.debuggerpackages/ui/src/debugger-element.ts:12
channelnumber1Which up channel to plot.-packages/ui/src/rtt-plot.ts:43
formatSampleFormat'u32'How to read the bytes.-packages/ui/src/rtt-plot.ts:45
windownumber400How many samples to keep on screen.-packages/ui/src/rtt-plot.ts:47

Accessors

samples

Get Signature

ts
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()

ts
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

ParameterType
channelnumber
bytesUint8Array

Returns

void


clear()

ts
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()

ts
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