powerNodeBase#
Executive Summary#
The powerNodeBase class is used generate a standard interface and list of features for modules that consume or provide power. Specifically, each PowerNodeBase:
Writes out a PowerNodeUsageMsgPayload describing its power consumption at each sim update
Can be switched on or off using an optional PowerNodeStatusMsgPayload
Can also be switched on or off using the public variable
powerStatus
Core functionality is wrapped in the evaluatePowerModel() protected virtual void method, which is assumed to compute power usage based on a module specific mathematical model.
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 power system example: scenarioPowerDemo.
Module Assumptions and Limitations#
The power draw or supply for this module is assumed to be constant.
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 |
|---|---|---|
nodePowerOutMsg |
Writes out the net power used/generated by a PowerNodeBase instance. |
|
nodeStatusInMsg |
(optional). If powerStatus is 0, the node is disabled; other values indicate various power modes depending on the module. |
User Guide#
To specify the modules simulated power draw (neg. value) or generation (pos. value), set the variable
nodePowerOutto the desired value in units of Watts.The module power status can be set using the public variable
powerStatus. The default value is 1 meaning the device is on. If set to 0 the device is off and the power value returns to 0.The module power status can be set also through an optional input message. By connecting
nodeStatusInMsgthe status message is read in at every time step.
-
class PowerNodeBase : public SysModel#
power node base class
Subclassed by ReactionWheelPower, SimplePowerSink, SimpleSolarPanel
Public Functions
-
PowerNodeBase()#
This method initializes the messaging parameters to either empty strings for message names or -1 for message IDs.
- Returns:
void
-
~PowerNodeBase()#
Destructor.
- Returns:
void
-
void reset(uint64_t currentSimNanos)#
This method is used to reset the module. In general, no functionality must be reset.
- Returns:
void
-
void computePowerStatus(double currentTime)#
Core compute operation that implements switching logic and computes module-wise power consumption.
-
void updateState(uint64_t currentSimNanos)#
Provides logic for running the read / compute / write operation that is the module’s function.
- Parameters:
currentSimNanos – The current simulation time in nanoseconds
Public Members
-
Message<PowerNodeUsageMsgPayload> nodePowerOutMsg#
output power message
-
ReadFunctor<DeviceStatusMsgPayload> nodeStatusInMsg#
note status input message
-
double nodePowerOut#
[W] Power provided (+) or consumed (-).
-
uint64_t powerStatus#
Device power mode; by default, 0 is off and 1 is on. Additional modes can fill other slots.
-
BSKLogger bskLogger#
— BSK Logging
-
PowerNodeBase()#