Class DataTracker
- Namespace
- NominalSystems.Messages
- Assembly
- NominalSystems.Messages.dll
This component is able to track data from messages and properties and export to a range of data formats.
public class DataTracker : Component
- Inheritance
-
DataTracker
- Inherited Members
Constructors
DataTracker()
Default constructor
public DataTracker()
Fields
DatabaseDirectory
[-] The full path to the database directory path. If the directory is empty, it will use the current working directory.
public string DatabaseDirectory
Field Value
Interval
[s] The interval between storing data on the messages
public double Interval
Field Value
Methods
Deregister(Message)
Deregisters a message that is being tracked by the component.
public bool Deregister(Message message)
Parameters
message
Message[-] The message to deregister
Returns
- bool
A successful message deregistration
IsRegistered(Message)
Returns whether a particular message has already been registered.
public bool IsRegistered(Message message)
Parameters
message
Message[-] The message to check
Returns
- bool
A flag if the message is registered
OnFinish(double)
Called when the 'Component' is finishing
protected override void OnFinish(double time)
Parameters
time
doublecurrent time (seconds)
OnUpdate(double, double)
Called when the 'Component' should update
protected override void OnUpdate(double time, double step)
Parameters
Register(Message)
Registers a message to be tracked by the component to be saved to a database.
public bool Register(Message message)
Parameters
message
Message[-] The message to register
Returns
- bool
A successful message register
RemoveAll()
Removes all messages that are being tracked by the component.
public void RemoveAll()
Request(Message, string)
Requests a dictionary mapping of time (in seconds) to the value within the property of a particular message.
public Dictionary<double, string> Request(Message message, string property)
Parameters
Returns
- Dictionary<double, string>
A dictionary mapping
WriteAllToCSV(string, string)
Writes all current data registered to individual CSV files.
public bool WriteAllToCSV(string directory, string delimiter = "|")
Parameters
Returns
- bool
A successful write flag
WriteToCSV(Message, string, string)
Writes the data from a particular message to a CSV file with a particular path.
public bool WriteToCSV(Message message, string path, string delimiter = "|")
Parameters
message
MessageThe message to save
path
stringThe path name of the file to save
delimiter
stringThe CSV seperator character
Returns
- bool
A successful write flag