Module: simpleTransmitter¶
Executive Summary¶
This module provides first-order modeling of data downlinking from a simple transmitter at a fixed baud rate. Specifically, the transmitter reads a dataStorageStatusSimMsg from the storage unit it is subscribed to, searches for the data buffer with the maximum amount of data, and downlinks a packet of data at a fixed baud rate. The transmitter writes out a dataNodeUsageSimMsg describing the data name and baud rate of the data it wants to downlink.
For more information on how to set up and use this module, see the simple data system example: scenarioDataDemo
Module Assumptions and Limitations¶
This module makes no additional assumptions outside of those already made in the Module: dataNodeBase base class.
Message Connection Descriptions¶
This module uses the input and output messages of the Module: dataNodeBase base class, plus an additional dataStorageStatusSimMsg input message subscribed to and read in customCrossInit() and customRead() methods, respectively.
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. |
|
storageUnitMsgNames |
Vector of storage units that are connected
to the transmitter. Add storage unit with the
|
User Guide¶
This module inherits the user guide from the Module: dataNodeBase base class, but there are several key differences from other Module: dataNodeBase child classes:
Unlike other child classes of Module: dataNodeBase, this module does not require a user to set a nodeDataName
The nodeBaudRate variable should be set to a negative value in order to remove data from the storage unit.
The user must specify a packetSize variable (negative value) in addition to the nodeBaudRate variable
The user must specify the number of buffers numBuffers variable so the transmitter knows how many buffers to search through
The user must specify the storage unit the transmitter should subscribe to using the addStorageUnitToTransmitter()` method
To set up this module users must create a SimpleTransmitter instance:
transmitter = simpleTransmitter.SimpleTransmitter()
transmitter.ModelTag = "transmitter"
Set the nodeBaudRate, packetSize, and numBuffers variables:
transmitter.nodeBaudRate = -16000. # baud
transmitter.packetSize = -1E6 # bits
transmitter.numBuffers = 2
The next step is to attach one or more dataStorageStatusSimMsg instances to it using the addStorageUnitToTransmitter()
method:
transmitter.addStorageUnitToTransmitter("msg name")
The final step is to specify the output message name and add the model to task:
transmitter.nodeDataOutMsgName = "TransmitterMsg"
scenarioSim.AddModelToTask(taskName, transmitter)
Follow the Module: partitionedStorageUnit or Module: simpleStorageUnit instructions to add the transmitter to a storage unit.
For more information on how to set up and use this module, see the simple data system example: scenarioDataDemo
-
class
SimpleTransmitter
: public DataNodeBase¶ Public Functions
-
SimpleTransmitter
()¶ Constructor, which sets the default nodeDataOut to zero.
-
~SimpleTransmitter
()¶
-
void
addStorageUnitToTransmitter
(std::string tmpStorageUnitMsgName)¶ Adds a dataStorageStatusSimMsg name to be accessed by transmitter.
- Return
void
- Parameters
tmpScMsgName
: A spacecraft state message name.
Public Members
-
double
packetSize
¶ Size of packet to downklink (bytes)
-
int
numBuffers
¶ Number of buffers the transmitter can access.
-
std::vector<std::string>
storageUnitMsgNames
¶ Vector of data node input message names.
-
std::vector<std::int64_t>
storageUnitMsgIds
¶
-
std::vector<DataStorageStatusSimMsg>
storageUnitMsgs
¶
Private Functions
-
void
evaluateDataModel
(DataNodeUsageSimMsg *dataUsageMsg, double currentTime)¶ Loads the nodeDataOut attribute into the dataUsageSimMessage instance.
-
bool
customReadMessages
()¶
-
void
customCrossInit
()¶
Private Members
-
double
packetTransmitted
¶ Amount of packet downlinked (bytes)
-
double
currentTimestep
¶ Current timestep tracked for data packet integration.
-
double
previousTime
¶ Previous timestep tracked for data packet integration.
-
std::vector<dataInstance>
storedData
¶
-