Class ChannelRingMonitorBase
Inheritance
ChannelRingMonitorBase
Assembly: MOSAIC.dll
Syntax
public abstract class ChannelRingMonitorBase : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging, IMonitor, IDisposable
Constructors
ChannelRingMonitorBase()
Declaration
protected ChannelRingMonitorBase()
Fields
IsActive
Declaration
protected volatile bool IsActive
Field Value
IsDisposed
Declaration
protected volatile bool IsDisposed
Field Value
IsUpdating
Declaration
protected volatile bool IsUpdating
Field Value
_flushScheduled
Declaration
private int _flushScheduled
Field Value
_lastAcceptedUtc
Declaration
private DateTime _lastAcceptedUtc
Field Value
_lastMonotonicTicks
Declaration
private long _lastMonotonicTicks
Field Value
_mirrorLock
Declaration
private readonly object _mirrorLock
Field Value
_mirrors
Declaration
private volatile ChannelRingMonitorBase[] _mirrors
Field Value
_numberOfChannels
Declaration
private int _numberOfChannels
Field Value
_pendingChannelCount
Declaration
private int _pendingChannelCount
Field Value
Declaration
private int _reconfigureScheduled
Field Value
_ring
Declaration
private SampleRingBuffer? _ring
Field Value
_scratch
Declaration
private double[] _scratch
Field Value
_t0Stamp
Declaration
private readonly long _t0Stamp
Field Value
_t0UtcTicks
Declaration
private readonly long _t0UtcTicks
Field Value
_tickRate
Declaration
private VisualizationTimer.TickRate _tickRate
Field Value
_timerCallback
Declaration
private readonly Action _timerCallback
Field Value
Properties
AcceptInterval
Declaration
protected virtual TimeSpan? AcceptInterval { get; }
Property Value
AcceptsData
Declaration
internal bool AcceptsData { get; }
Property Value
ChannelCount
Current channel count (frame width). Set on the UI thread via reconfigure / configure.
Declaration
public int ChannelCount { get; }
Property Value
IsRenderReady
Whether the render surface is ready to draw. The base skips flushing while false.
Declaration
protected virtual bool IsRenderReady { get; }
Property Value
MaxChannels
Upper bound on channel count. Defaults to 128.
Declaration
protected virtual int MaxChannels { get; }
Property Value
Mirrors
The currently registered mirror sinks (snapshot; safe to read off-thread).
Declaration
protected ChannelRingMonitorBase[] Mirrors { get; }
Property Value
Ring
The ingest ring for the current channel count, or null when there are no channels.
Declaration
protected SampleRingBuffer? Ring { get; }
Property Value
RingCapacityFrames
Frames of ingest headroom. Must exceed (rate / flushRate) and the largest EnqueueBatch.
Declaration
protected virtual int RingCapacityFrames { get; }
Property Value
TickRate
Display refresh rate. Pauses/resumes the timer subscription around the change.
Declaration
public VisualizationTimer.TickRate TickRate { get; set; }
Property Value
Methods
AddMirror(ChannelRingMonitorBase)
Registers a monitor to receive a verbatim copy of this monitor's ingest.
A mirror must not itself be a source with mirrors (no re-forwarding), which is the case for the
aggregate window's leaf monitors.
Declaration
public void AddMirror(ChannelRingMonitorBase mirror)
Parameters
UI-thread-safe channel-count set: (re)allocates the ring and rebuilds the surface.
Declaration
protected void ConfigureChannels(int count)
Parameters
| Type |
Name |
Description |
| int |
count |
|
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
EnqueueBatch(Matrix<double>, int)
Enqueues a [rows × channels] matrix. Bypasses the throttle; decimates to maxRowsToKeep.
Declaration
public void EnqueueBatch(Matrix<double> matrix, int maxRowsToKeep = 4096)
Parameters
| Type |
Name |
Description |
| Matrix<double> |
matrix |
|
| int |
maxRowsToKeep |
|
EnqueueData(Vector<double>)
Enqueues one multi-channel sample. Safe to call from the producer thread.
Declaration
public void EnqueueData(Vector<double> data)
Parameters
| Type |
Name |
Description |
| Vector<double> |
data |
|
NowMonotonicUtc()
Strictly-increasing UTC timestamp derived from a high-resolution stopwatch.
Declaration
protected DateTime NowMonotonicUtc()
Returns
OnDispose()
Release surface references on dispose. Optional.
Declaration
protected virtual void OnDispose()
OnFlush(SampleRingBuffer, int)
Render the frameCount fresh frames in ring
(read via Peek(int, int)). The base brackets this with BeginRead/CommitRead
and the IsUpdating guard — do not call those yourself.
Declaration
protected abstract void OnFlush(SampleRingBuffer ring, int frameCount)
Parameters
OnPaused()
Extra teardown on pause. Optional.
Declaration
protected virtual void OnPaused()
OnRebuild()
(Re)build the render surface for the current ChannelCount. Runs on the UI
thread after the ring is (re)allocated.
Declaration
protected abstract void OnRebuild()
OnResetData()
Reset display state and rebuild after a data reset. Runs on the UI thread; the ring is
already cleared.
Declaration
protected abstract void OnResetData()
OnResumed()
Reset transient display state on resume (e.g. auto-scale extremes). Optional.
Declaration
protected virtual void OnResumed()
Pause()
Stops data flow and rendering updates.
Declaration
public virtual void Pause()
RemoveMirror(ChannelRingMonitorBase)
Unregisters a previously added mirror sink. Safe to call on a disposed monitor.
Declaration
public void RemoveMirror(ChannelRingMonitorBase mirror)
Parameters
Declaration
private void RequestChannelReconfigure(int newCount)
Parameters
| Type |
Name |
Description |
| int |
newCount |
|
RequestFlush()
Declaration
private void RequestFlush()
ResetCore()
Declaration
ResetData()
Clears buffered data and any accumulated display state.
Declaration
Resume()
Resumes data flow and rendering updates.
Declaration
public virtual void Resume()
RunFlush()
Declaration
SetChannelCountInternal(int)
Declaration
private void SetChannelCountInternal(int count)
Parameters
| Type |
Name |
Description |
| int |
count |
|
UpdateThemeColors()
Re-applies theme-dependent colours to the monitor's paints.
Declaration
public abstract void UpdateThemeColors()
Implements