Class MuoviSingleProbe
A BaseBlock that streams high-density surface EMG (HD-sEMG), EEG, or IMU data
from a single OT Bioelettronica Muovi probe over a direct Wi-Fi TCP connection.
JSON configuration
Use these block entries inside a pipeline configuration. Input names must match other blocks in that pipeline; device addresses and file paths must match your setup.
Block entry for a larger pipeline. Params are keyword tokens: emg selects the signal mode; matrix requests batched output. Configure the Wi-Fi probe to connect to this host before starting acquisition.
{
"MuoviSingleProbe": {
"Type": "muovisingleprobe",
"Inputs": [],
"Params": ["emg", "matrix"]
}
}
How Type, Inputs and Params work · Block catalogue and parameter reference
Inheritance
MuoviSingleProbe
Assembly: MOSAIC.dll
Syntax
public sealed class MuoviSingleProbe : BaseBlock, INotifyPropertyChanged, INotifyPropertyChanging, ISubscriber, IPublisher, IBaseBlockProps, IJsonExportable, IDisposable, IAsyncDisposable
Constructors
MuoviSingleProbe(string, double)
Declaration
public MuoviSingleProbe(string name = "MuoviSingle", double desiredRate = 100)
Parameters
Fields
BytesPerSample
Byte count for one sample frame: 38 columns × 2 bytes = 76 bytes.
Declaration
private const int BytesPerSample = 76
Field Value
ListenPort
TCP port on which this block listens for the incoming probe connection.
Declaration
private const int ListenPort = 54321
Field Value
TotalColumnsPerFrame
Total raw columns per frame (32 electrode + 4 IMU + 2 accessory).
Declaration
private const int TotalColumnsPerFrame = 38
Field Value
_clientSocket
Declaration
private Socket? _clientSocket
Field Value
_configByte
Declaration
Field Value
_conversionFactor
Declaration
private double _conversionFactor
Field Value
_hasEmg
Declaration
[ObservableProperty]
private bool _hasEmg
Field Value
_hasImu
Declaration
[ObservableProperty]
private bool _hasImu
Field Value
_isStreaming
Declaration
private volatile bool _isStreaming
Field Value
_lastRamp
Declaration
Field Value
_latestImu
Declaration
private volatile Vector<double>? _latestImu
Field Value
| Type |
Description |
| Vector<double> |
|
_latestSample
Declaration
private volatile Vector<double>? _latestSample
Field Value
| Type |
Description |
| Vector<double> |
|
_listenSocket
Declaration
private Socket? _listenSocket
Field Value
_matrixMode
Declaration
Field Value
_nominalRate
Declaration
Field Value
_rampInitialized
Declaration
private bool _rampInitialized
Field Value
_readerThread
Declaration
private Thread? _readerThread
Field Value
_reading
Declaration
private volatile bool _reading
Field Value
_sampleReady
Declaration
private volatile bool _sampleReady
Field Value
_samplesPerBatch
Declaration
private int _samplesPerBatch
Field Value
_stream
Declaration
private NetworkStream? _stream
Field Value
Properties
ChannelLabels
Declaration
public List<string> ChannelLabels { get; private set; }
Property Value
DumpFilePrefix
Recordings from this block are named <block>_muovi_single.csv.
Declaration
protected override string DumpFilePrefix { get; }
Property Value
Overrides
EmgChannelLabels
Declaration
public List<string> EmgChannelLabels { get; private set; }
Property Value
ForceMatrixMode
Explicit override for the publish strategy (JSON "matrix" / "vector").
null (default) keeps the legacy auto-derivation from
DesiredRate; true forces per-packet
MathNet.Numerics.LinearAlgebra.Matrix<T> push (lossless), false forces decimated
single-MathNet.Numerics.LinearAlgebra.Vector<T> output. Must be set before Connect().
Declaration
public bool? ForceMatrixMode { get; set; }
Property Value
HasEmg
Declaration
[ExcludeFromCodeCoverage]
public bool HasEmg { get; set; }
Property Value
HasImu
Declaration
[ExcludeFromCodeCoverage]
public bool HasImu { get; set; }
Property Value
ImuChannelLabels
Declaration
public List<string> ImuChannelLabels { get; private set; }
Property Value
IsStreaming
Declaration
public bool IsStreaming { get; }
Property Value
Gets the maximum number of input connections allowed for this block.
Declaration
public override int MaxInputs { get; }
Property Value
Overrides
Gets the minimum number of input connections required for this block.
Declaration
public override int MinInputs { get; }
Property Value
Overrides
OutputChannels
Number of output channels: 32 electrode, plus optionally 4 IMU.
Declaration
public int OutputChannels { get; }
Property Value
ScopeEmg
Scope monitor for real-time visualisation of the electrode (EMG / EEG) channels.
Declaration
public ScopeMonitor ScopeEmg { get; }
Property Value
ScopeImu
Scope monitor for real-time visualisation of the IMU quaternion channels.
Declaration
public ScopeMonitor ScopeImu { get; }
Property Value
SignalMode
Signal acquisition mode. Must be set before Connect().
Declaration
public MuoviSignalMode SignalMode { get; set; }
Property Value
StreamImu
Whether the four IMU quaternion channels are included.
Declaration
public bool StreamImu { get; set; }
Property Value
StreamInfo
Observable telemetry counters for binding in a device card view.
Declaration
public MuoviStreamInfo StreamInfo { get; }
Property Value
Methods
BuildChannelLabels()
Declaration
private void BuildChannelLabels()
CheckRamp(byte[], int)
Declaration
private void CheckRamp(byte[] frame, int offset)
Parameters
| Type |
Name |
Description |
| byte[] |
frame |
|
| int |
offset |
|
Declaration
public static MuoviSingleProbe ConfigureInput(IServiceProvider sp, JsonModel m)
Parameters
Returns
Connect()
Declaration
ConnectAsync()
Declaration
public Task ConnectAsync()
Returns
DecodeSampleInline(byte[], int)
Declaration
private void DecodeSampleInline(byte[] frame, int offset)
Parameters
| Type |
Name |
Description |
| byte[] |
frame |
|
| int |
offset |
|
Disconnect()
Declaration
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
Returns a [rows × electrodeChannels] sub-matrix containing only the
electrode columns. When StreamImu is false
the input matrix is returned unchanged.
Declaration
private Matrix<double> ExtractElectrodeMatrix(Matrix<double> full)
Parameters
| Type |
Name |
Description |
| Matrix<double> |
full |
|
Returns
| Type |
Description |
| Matrix<double> |
|
OnHasEmgChanged(bool)
Executes the logic for when HasEmg just changed.
Declaration
private void OnHasEmgChanged(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
The new property value that was set.
|
OnHasEmgChanged(bool, bool)
Executes the logic for when HasEmg just changed.
Declaration
private void OnHasEmgChanged(bool oldValue, bool newValue)
Parameters
| Type |
Name |
Description |
| bool |
oldValue |
The previous property value that was replaced.
|
| bool |
newValue |
The new property value that was set.
|
OnHasEmgChanging(bool)
Executes the logic for when HasEmg is changing.
Declaration
private void OnHasEmgChanging(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
The new property value being set.
|
OnHasEmgChanging(bool, bool)
Executes the logic for when HasEmg is changing.
Declaration
private void OnHasEmgChanging(bool oldValue, bool newValue)
Parameters
| Type |
Name |
Description |
| bool |
oldValue |
The previous property value that is being replaced.
|
| bool |
newValue |
The new property value being set.
|
OnHasImuChanged(bool)
Executes the logic for when HasImu just changed.
Declaration
private void OnHasImuChanged(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
The new property value that was set.
|
OnHasImuChanged(bool, bool)
Executes the logic for when HasImu just changed.
Declaration
private void OnHasImuChanged(bool oldValue, bool newValue)
Parameters
| Type |
Name |
Description |
| bool |
oldValue |
The previous property value that was replaced.
|
| bool |
newValue |
The new property value that was set.
|
OnHasImuChanging(bool)
Executes the logic for when HasImu is changing.
Declaration
private void OnHasImuChanging(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
The new property value being set.
|
OnHasImuChanging(bool, bool)
Executes the logic for when HasImu is changing.
Declaration
private void OnHasImuChanging(bool oldValue, bool newValue)
Parameters
| Type |
Name |
Description |
| bool |
oldValue |
The previous property value that is being replaced.
|
| bool |
newValue |
The new property value being set.
|
OnReceive(object, object)
Processes incoming data from an upstream block.
Must be implemented by derived classes.
Declaration
protected override void OnReceive(object sender, object tNow)
Parameters
| Type |
Name |
Description |
| object |
sender |
The publishing block, or whatever else delivered the value.
|
| object |
tNow |
|
Overrides
PublishMatrixBatch(byte[], int)
Declaration
private void PublishMatrixBatch(byte[] buf, int batchOffset)
Parameters
| Type |
Name |
Description |
| byte[] |
buf |
|
| int |
batchOffset |
|
ReadInt16BigEndian(byte[], int)
Declaration
private static short ReadInt16BigEndian(byte[] buf, int offset)
Parameters
| Type |
Name |
Description |
| byte[] |
buf |
|
| int |
offset |
|
Returns
ReaderLoop()
Declaration
private void ReaderLoop()
Implements