Class BlockVisualization
All-in-one visualization bundle for any processing block.
Owns a ScopeMonitor, SpiderMonitor, and HeatMapMonitor, and provides
a single Feed(Vector<double>?) call to update all of them.
Inheritance
BlockVisualization
Assembly: MOSAIC.dll
Syntax
public sealed class BlockVisualization : IDisposable
Constructors
BlockVisualization()
Declaration
public BlockVisualization()
Fields
Enabled
Global switch for whether new BlockVisualization instances build their
underlying chart monitors. Always true in the running app. Unit tests set this to
false (from an [AssemblyInitialize]) so that constructing a block does not
spin up LiveCharts UI controls — which are pointless without a window and whose one-time
global initialization is not thread-safe under parallel test execution.
Declaration
public static bool Enabled
Field Value
_attachedCount
Declaration
private int _attachedCount
Field Value
_derivedRate
Declaration
private double _derivedRate
Field Value
_desiredRate
Declaration
private double _desiredRate
Field Value
_disposed
Declaration
Field Value
_enabled
Declaration
private readonly bool _enabled
Field Value
_heatmap
Declaration
private volatile HeatMapMonitor? _heatmap
Field Value
_monitorLock
Declaration
private readonly object _monitorLock
Field Value
_publishRate
Declaration
private double _publishRate
Field Value
_rowsPerFeed
Declaration
Field Value
_scope
Declaration
private volatile ScopeMonitor? _scope
Field Value
_signalRate
Declaration
private double _signalRate
Field Value
_spider
Declaration
private volatile SpiderMonitor? _spider
Field Value
Properties
DerivedSignalRate
The rate worked out from the publish rate and the feed size, or 0 before both are known.
Declaration
public double DerivedSignalRate { get; }
Property Value
DesiredRate
Declaration
public double DesiredRate { get; }
Property Value
EffectiveSignalRate
The rate the scope is actually running on — the explicit declaration when a block made one,
otherwise the derived rate.
Declaration
public double EffectiveSignalRate { get; }
Property Value
Heatmap
Declaration
public HeatMapMonitor? Heatmap { get; }
Property Value
IsVisible
Declaration
public bool IsVisible { get; }
Property Value
PublishRate
The rate the owning block publishes at, pushed automatically by BaseBlock.
Declaration
public double PublishRate { get; }
Property Value
Scope
Created on first UI request, never as a side effect of feeding data.
Declaration
public ScopeMonitor? Scope { get; }
Property Value
SignalRate
Declaration
public double SignalRate { get; }
Property Value
Spider
Declaration
public SpiderMonitor? Spider { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
Feed(Matrix<double>?)
Feed an entire batch matrix [rows × channels].
When signal rate and desired rate are known, only the non-overlapping
tail of the matrix is sent to the scope so that overlapping windows
from a SlidingWindow don't produce jagged re-plots.
Spider and Heatmap receive only the last row — they're envelope-style
displays where intermediate frames within one 30 fps tick aren't meaningful.
Declaration
public void Feed(Matrix<double>? matrix)
Parameters
| Type |
Name |
Description |
| Matrix<double> |
matrix |
|
Feed(Vector<double>?)
Feed one sample (Vector) to all three monitors.
Declaration
public void Feed(Vector<double>? data)
Parameters
| Type |
Name |
Description |
| Vector<double> |
data |
|
Feed(ReadOnlySpan<double>)
Feed one sample (ReadOnlySpan) to all three monitors.
Declaration
public void Feed(ReadOnlySpan<double> data)
Parameters
NoteFeedShape(int)
Records how many rows a feed carries, so the time base can be derived from it.
Declaration
private void NoteFeedShape(int rows)
Parameters
| Type |
Name |
Description |
| int |
rows |
|
NotifyAttached()
Declaration
public void NotifyAttached()
NotifyDetached()
Declaration
public void NotifyDetached()
RefreshDerivedRate(int)
Derives the scope's time base from the publish rate and the size of each feed, for blocks
that never declare a sample rate of their own.
Declaration
private void RefreshDerivedRate(int rows)
Parameters
| Type |
Name |
Description |
| int |
rows |
|
UpdateDesiredRate(double)
Sets the block's output rate (Hz). Used together with the signal rate to
extract only the non-overlapping tail from windowed matrices in
Feed(Matrix<double>?).
Declaration
public void UpdateDesiredRate(double desiredRate)
Parameters
| Type |
Name |
Description |
| double |
desiredRate |
|
UpdatePublishRate(double)
Tells this visualization how often its block publishes. Pushed automatically by
BaseBlock whenever the block's rate changes; blocks do not call this themselves.
Declaration
public void UpdatePublishRate(double publishRate)
Parameters
| Type |
Name |
Description |
| double |
publishRate |
|
UpdateSignalRate(double)
Informs the scope monitor of the upstream signal rate so it can size
its internal buffers and time-axis correctly.
A non-positive value restores automatic derivation from publication rate and feed shape.
Declaration
public void UpdateSignalRate(double signalRate)
Parameters
| Type |
Name |
Description |
| double |
signalRate |
|
Implements