Table of Contents

Class Instrument

Namespace
NominalSystems.Classes
Assembly
NominalSystems.Classes.dll

An instrument is a source of data and can output data from a particular sensor or some form of output. The data can be read from but cannot store data. As such, only the most recent data is visible from the system.

public class Instrument : PhysicalComponent
Inheritance
Instrument
Inherited Members

Constructors

Instrument()

Default constructor for the instrument; creates the buffer.

public Instrument()

Fields

BaudRate

[bps] The bits per second for the rate of data transfer

[EditableVariable("bps", 0, false, "", "")]
public int BaudRate

Field Value

int

BufferSize

[B] The number of bytes that the buffer can be

[EditableVariable("B", 0, false, "", "")]
public int BufferSize

Field Value

int

Properties

Buffer

The current most recent data buffer if it exists.

public byte[]? Buffer { get; protected set; }

Property Value

byte[]

BytesPerSecond

The number of bytes that can be transmitted per second

[EditableVariable("bytes/s", true, "", "")]
public double BytesPerSecond { get; }

Property Value

double

Methods

OnBegin(double)

Called when the 'Component' is beginning

protected override void OnBegin(double time)

Parameters

time double

current time (seconds)

OnUpdate(double, double)

Called when the 'Component' should update

protected override void OnUpdate(double time, double step)

Parameters

time double

current time (seconds)

step double

the time step (seconds)

OutputData(byte[])

Outputs data from the system and adds it to an internal buffer, waiting to add the final data to the output buffer that can be read.

public void OutputData(byte[] data)

Parameters

data byte[]

The data to add to the buffer