Class PowerBus
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] The Power Bus is a component that can be attached to a object that controls the power system on-board the entity. It allows for power to flow from a battery unit, into a series of nodes. All components that are power related must attach to this component.
public class PowerBus : UniverseBehaviour
- Inheritance
-
PowerBus
Constructors
PowerBus()
Default constructor
protected PowerBus()
Fields
Battery
The main power storage system that this bus is connected to.
[ReadOnly]
[Metadata(IsAdvanced = true)]
public Battery? Battery
Field Value
BatteryInputs
The list of all power sources that the battery can be connected to with the current connected battery.
[Hidden]
public List<PowerSource> BatteryInputs
Field Value
BatteryOutputs
The list of power nodes that the battery is connected to on the output from the battery.
[Hidden]
public List<List<PowerNodeModel>> BatteryOutputs
Field Value
PowerComponents
A list of all power components added to the system
[Hidden]
public List<UniverseObject> PowerComponents
Field Value
Methods
Connect(UniverseEvent, UniverseEvent)
Connects two power components together. This will determine the type of of components and connect them accordingly.
public bool Connect(UniverseEvent a, UniverseEvent b)
Parameters
a
UniverseEventThe first object
b
UniverseEventThe second object
Returns
- bool
The success of the connection
ConnectBattery(Battery)
Attaches a battery to the current bus. If the battery already exists, then it will return false.
public bool ConnectBattery(Battery battery)
Parameters
battery
BatteryThe new battery to attach
Returns
- bool
A success flag
ConnectBatteryComponent(Battery?, UniverseObject)
Connects a battery unit, to a component that has a power node attached. If a power node does not yet exist, it will create the node.
public bool ConnectBatteryComponent(Battery? battery, UniverseObject component)
Parameters
battery
BatteryThe battery unit that is connected
component
UniverseObjectThe new power component that should be attached to the storage
Returns
- bool
A success flag
ConnectComponentComponent(UniverseObject, UniverseObject)
Connects a power node to another power node that is already connected. The other power node that is attached (nodeA) should already be attached to the power storage on the battery and should be the last node in the chain. If either component do not have power nodes attached, it will attach it.
public bool ConnectComponentComponent(UniverseObject componentA, UniverseObject componentB)
Parameters
componentA
UniverseObjectThe component that already exists on the bus
componentB
UniverseObjectThe new component that will be attached to the bus
Returns
- bool
A success flag
ConnectSourceBattery(PowerSource, Battery?)
Connects a power source, such as a Solar Panel, to the current battery unit of the system. If there is no battery attached, it will return false.
public bool ConnectSourceBattery(PowerSource source, Battery? battery = null)
Parameters
source
PowerSourceThe power source to attach
battery
BatteryThe battery to attach
Returns
- bool
A success flag
IsComponentConnected(UniverseObject)
Returns whether a particular component is connected
public bool IsComponentConnected(UniverseObject component)
Parameters
component
UniverseObjectThe component to check
Returns
- bool
A connection flag
IsValid()
Returns whether the current system is valid and has a completed circuit. Right now this is true if the power storage unit exists.
public bool IsValid()
Returns
- bool
A valid flag
OnUpdate(double, double)
Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.
protected override void OnUpdate(double time, double step)
Parameters
time
double[s] Current time of the simulation before the update
step
double[s] The time-step to update during this tick
Remove(PowerSource)
Removes and disconnects a power source from the EPS bus
public bool Remove(PowerSource source)
Parameters
source
PowerSourceThe source to disconnect
Returns
- bool
A success flag
RemoveAll()
Removes and disconnects all power sources from the EPS bus
public bool RemoveAll()
Returns
- bool
A success flag