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:

1. Writes out a :ref:`PowerNodeUsageMsgPayload` describing its power consumption at each sim update
2. Can be switched on or off using an optional :ref:`PowerNodeStatusMsgPayload`
3. 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: :ref:`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.

.. table:: Module I/O Messages
        :widths: 25 25 100

        +-----------------------+---------------------------------+---------------------------------------------------+
        | Msg Variable Name     | Msg Type                        | Description                                       |
        +=======================+=================================+===================================================+
        | nodePowerOutMsg       | :ref:`PowerNodeUsageMsgPayload` | Writes out the net power                          |
        |                       |                                 | used/generated by a PowerNodeBase instance.       |
        +-----------------------+---------------------------------+---------------------------------------------------+
        | nodeStatusInMsg       | :ref:`DeviceStatusMsgPayload`   | (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 ``nodePowerOut`` to 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 ``nodeStatusInMsg``
  the status message is read in at every time step.
