Class Selector

Extracts the data payload from a labelled tuple, discarding the label string.

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.

JSON configuration:

{
  "LDAOutput": {
    "Type": "Selector",
    "Inputs": [ "OnlineLDA" ],
    "Path": "C:/Data/session1"
  }
}

How Type, Inputs and Params work · Block catalogue and parameter reference

Inheritance
Selector
Inherited Members
Namespace: MOSAIC.Models.FlowControl
Assembly: MOSAIC.dll
Syntax
public class Selector : BaseBlock, INotifyPropertyChanged, INotifyPropertyChanging, ISubscriber, IPublisher, IBaseBlockProps, IJsonExportable, IDisposable, IAsyncDisposable
Remarks

Overview: Several blocks publish (string label, data) tuples. The Selector strips the label and forwards only the data, allowing downstream blocks that expect a bare MathNet.Numerics.LinearAlgebra.Vector<T> or MathNet.Numerics.LinearAlgebra.Matrix<T> to consume it without modification.

Accepted input types:

  • ValueTuple<string, Vector<double>> — forwards the vector.
  • ValueTuple<string, Matrix<double>> — forwards the matrix.
  • Tuple<string, Vector<double>> — legacy class tuple; forwards the vector.
  • Tuple<string, Matrix<double>> — legacy class tuple; forwards the matrix.
  • ValueTuple<string, object> — forwards Item2 if it is a Vector or Matrix.

All other types are rejected and reported through ReportError(string, Exception?).

Constructors

Selector(string, double)

Declaration
public Selector(string name, double desiredRate = 0)
Parameters
Type Name Description
string name
double desiredRate

Properties

DumpFilePrefix

Recordings from this block are named <block>_vec.csv.

Declaration
protected override string DumpFilePrefix { get; }
Property Value
Type Description
string
Overrides
BaseBlock.DumpFilePrefix

JsonTypeName

Block type identifier for JSON serialization. Override for a custom name.

Declaration
protected override string JsonTypeName { get; }
Property Value
Type Description
string
Overrides
BaseBlock.JsonTypeName

Methods

ConfigureInput(IServiceProvider, JsonModel)

Declaration
public static Selector ConfigureInput(IServiceProvider sp, JsonModel m)
Parameters
Type Name Description
IServiceProvider sp
JsonModel m
Returns
Type Description
Selector

OnReceive(object, object?)

Processes incoming data from an upstream block. Must be implemented by derived classes.

Declaration
protected override void OnReceive(object sender, object? value)
Parameters
Type Name Description
object sender

The publishing block, or whatever else delivered the value.

object value

The payload. Blocks are wired by config rather than by type, so an implementation has to check the run-time type and reject or handle a shape it cannot use. Status is updated automatically from publication activity; it is not a per-value validation result.

Overrides
BaseBlock.OnReceive(object, object)
Remarks

Called on the dispatching thread, not the UI thread.

Implements

INotifyPropertyChanged
INotifyPropertyChanging
ISubscriber
IPublisher
IBaseBlockProps
IJsonExportable
IDisposable
IAsyncDisposable

Search documentation

Start typing to search the documentation.