Class Instrument
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] 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 : PhysicalObject
- Inheritance
-
Instrument
Constructors
Instrument()
Default constructor
protected Instrument()
Fields
BaudRate
The bits per second for the rate of data transfer
[Unit("b/s")]
[Range(0, 1.7976931348623157E+308)]
public int BaudRate
Field Value
Buffer
The current most recent data buffer if it exists.
[Unit("B")]
[ReadOnly]
public byte[] Buffer
Field Value
- byte[]
BufferSize
The number of bytes that the buffer can be
[Unit("B/s")]
[Range(0, 1.7976931348623157E+308)]
public int BufferSize
Field Value
HexData
The data in the buffer as a hexadecimal string. This is used for serialization purposes and is not used for any other purpose.
[Hidden]
public string HexData
Field Value
NextBufferRefresh
The time that the buffer can be refreshed with some data
[Unit(UnitType.SECOND)]
[ReadOnly]
public double NextBufferRefresh
Field Value
Properties
BytesPerSecond
The number of bytes that can be transmitted per second
[Unit("B/s")]
[ReadOnly]
public double BytesPerSecond { get; }
Property Value
Methods
OnBegin(double)
Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.
protected override void OnBegin(double time)
Parameters
time
double[s] Current time of the simulation before the tick
OnLoad(double)
Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.
protected override void OnLoad(double time)
Parameters
time
double[s] The current clock time of the simulation
OnSave()
Called before the object is saved into the save state. This ensures that any additional metadata can be saved on the object before it is automatically serialized.
protected override void OnSave()
OnUpdate(double, double)
Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.
protected override void OnUpdate(double time, double step)
Parameters
time
double[s] Current time of the simulation before the update
step
double[s] The time-step to update during this tick
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