Module: dataNodeBase¶
Executive Summary¶
The dataNodeBase class is used to generate a standard interface and list of features for modules that generate or downlink simulated onboard data (ie. science or telemetry data). Specifically, each DataNodeBase:
Writes out a dataNodeUsageSimMsg describing its data name and the amount of data it has generated or downlinked (using baud rates) at each sim update.
Can be switched on or off using an optional deviceStatusIntMsg
Can also be switched on or off using the public variable
dataStatus
Core functionality is wrapped in the evaluateDataModel()
protected virtual void method, which is assumed to compute data usage based on a module specific mathematical model. Typically, this will be a straightforward static baud rate. However, some modules may wish to perform computations to generate variable baud rates based on data content.
Protected methods prepended with custom
are intended for module developers to override with additional, module-specific functionality.
For more information on how to set up and use classes derived from this module, see the simple data system example: scenarioDataDemo.
Module Assumptions and Limitations¶
The data draw or supply for this module is assumed to be constant between scenario time steps.
Message Connection Descriptions¶
The following table lists all the module input and output messages. The module msg variable name is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
nodeDataOutMsgName |
Writes out the data name and amount used/generated by a DataNodeBase instance. |
|
deviceStatusInMsgName |
(optional). If dataStatus is 0, the node is disabled; other values indicate various data modes depending on the module. |
User Guide¶
To specify the module’s simulated data consumption (neg. value) or generation (pos. value), set the variable
nodeBaudRate
to the desired value in units of bps (baud) in Python.To specify the name of the data so that it may be partitioned in a storage unit, set the variable ‘nodeDataName’ in Python.
Specify the module output message name using the variable
nodeDataOutMsgName
in Python.The module data status can be set using the public variable
dataStatus
. The default value is 1 meaning the device is on. If set to 0 the device is off and the data value returns to 0.The module data status can be set also through an optional input message. By specifying a non-empty string from
nodeStatusInMsgName
the status message is read in at every time step.
-
class
DataNodeBase
: public SysModel¶ Public Functions
-
DataNodeBase
()¶ Constructor.
- Return
void
-
~DataNodeBase
()¶ Destructor.
- Return
void
-
void
SelfInit
()¶ SelfInit creates a DataNodeUsageSimMsg using the provided message output name.
- Return
void
-
void
CrossInit
()¶ This method subscribes to anything that would tell the data node to turn on/off.
- Return
void
-
void
Reset
(uint64_t CurrentSimNanos)¶ This method is used to reset the module. In general, no functionality is reset.
- Return
void
- Parameters
CurrentSimNanos
:
-
void
computeDataStatus
(double currentTime)¶ This method evaluates the implementation-specific data model if the device is set to on.
- Return
void
- Parameters
CurrentTime
:
-
void
UpdateState
(uint64_t CurrentSimNanos)¶ This method updates the state by reading messages, calling computeDataStatus, and writing messages
- Return
void
- Parameters
CurrentSimNanos
:
Public Members
-
std::string
nodeDataOutMsgName
¶ Custom read method, similar to customSelfInit; returns true by default.
Message name for the node’s output message
-
std::string
nodeStatusInMsgName
¶ String for the message name that tells the node it’s status.
-
double
nodeBaudRate
¶ [baud] Data provided (+) or consumed (-).
-
char
nodeDataName
[128]¶
-
uint64_t
dataStatus
¶ Name of the data node consuming or generating data.
Device data mode; by default, 0 is off and 1 is on. Additional modes can fill other slots
Protected Functions
-
void
writeMessages
(uint64_t CurrentClock)¶ This method writes out the data node messages (dataName, baudRate)
- Return
void
- Parameters
CurrentClock
:
-
bool
readMessages
()¶ This method reads the device status messages and calls a customReadMessages method
- Return
bool
-
void
evaluateDataModel
(DataNodeUsageSimMsg *dataUsageMsg, double currentTime) = 0¶ Virtual void method used to compute module-wise data usage/generation.
-
void
customSelfInit
()¶
-
void
customCrossInit
()¶ Custom output input reading method. This allows a child class to add additional functionality.
-
void
customReset
(uint64_t CurrentClock)¶ Custom subscription method, similar to customSelfInit.
-
void
customWriteMessages
(uint64_t CurrentClock)¶ Custom Reset method, similar to customSelfInit.
-
bool
customReadMessages
()¶ custom Write method, similar to customSelfInit.
Protected Attributes
-
int64_t
nodeDataOutMsgId
¶
-
int64_t
nodeStatusInMsgId
¶
-
DataNodeUsageSimMsg
nodeDataMsg
¶
-
DeviceStatusIntMsg
nodeStatusMsg
¶
Private Members
-
uint64_t
outputBufferCount
¶
-