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:

  1. Writes out a DataNodeUsageMsgPayload describing its data name and the amount of data it has generated or downlinked (using baud rates) at each sim update.

  2. Can be switched on or off using an optional DeviceCmdMsgPayload

  3. 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.

Module I/O Messages

Msg Variable Name

Msg Type

Description

nodeDataOutMsg

DataNodeUsageMsgPayload

Writes out the data name and amount used/generated by a DataNodeBase instance.

nodeStatusInMsg

DeviceCmdMsgPayload

(optional). If deviceCmd 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.

  • Connect to the module output message using the variable nodeDataOutMsg 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 subscribing to nodeStatusInMsg the status message is read in at every time step.


class DataNodeBase : public SysModel
#include <dataNodeBase.h>

data node base class

Public Functions

DataNodeBase()

Constructor.

Returns:

void

~DataNodeBase()

Destructor.

Returns:

void

void Reset(uint64_t CurrentSimNanos)

This method is used to reset the module. In general, no functionality is reset.

Parameters:

CurrentSimNanos

Returns:

void

void computeDataStatus(double currentTime)

This method evaluates the implementation-specific data model if the device is set to on.

Parameters:

CurrentTime

Returns:

void

void UpdateState(uint64_t CurrentSimNanos)

This method updates the state by reading messages, calling computeDataStatus, and writing messages

Parameters:

CurrentSimNanos

Returns:

void

Public Members

Message<DataNodeUsageMsgPayload> nodeDataOutMsg

Message name for the node’s output message.

ReadFunctor<DeviceCmdMsgPayload> nodeStatusInMsg

String for the message name that tells the node it’s status.

double nodeBaudRate

[baud] Data provided (+) or consumed (-).

char nodeDataName[128]

Name of the data node consuming or generating data.

uint64_t dataStatus

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)

Parameters:

CurrentClock

Returns:

void

bool readMessages()

This method reads the device status messages and calls a customReadMessages method

Returns:

bool

virtual void evaluateDataModel(DataNodeUsageMsgPayload *dataUsageMsg, double currentTime) = 0

Virtual void method used to compute module-wise data usage/generation.

virtual void customReset(uint64_t CurrentClock)

Custom Reset method, similar to customSelfInit.

Custom Reset() method. This allows a child class to add additional functionality to the Reset() method

Returns:

void

virtual void customWriteMessages(uint64_t CurrentClock)

custom Write method, similar to customSelfInit.

custom Write method, similar to customSelfInit.

Returns:

void

virtual bool customReadMessages()

Custom read method, similar to customSelfInit; returns true by default.

Custom read method, similar to customSelfInit; returns true by default.

Returns:

void

Protected Attributes

DataNodeUsageMsgPayload nodeDataMsg

class variable

DeviceCmdMsgPayload nodeStatusMsg

class variable