Class PowerBus
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
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 power storage unit, such as a battery, into a series of nodes. All components that are power related must attach to this component.
public class PowerBus : PhysicalComponent, IGroundStationAttachment
- Inheritance
-
PowerBus
- Implements
- Inherited Members
Constructors
PowerBus()
Default constructor for the bus
public PowerBus()
Methods
AttachStorage(PowerStorage)
Attaches a power storage to the current bus. If the storage system already exists, then it will return false.
public bool AttachStorage(PowerStorage storage)
Parameters
storage
PowerStorageThe new storage system to attach
Returns
- bool
A success flag
Connect(PowerSource, PowerStorage)
Connects a power source, such as a Solar Panel, to the current power storage unit of the sytem. If there is no storage system attached, it will return false.
public bool Connect(PowerSource source, PowerStorage storage = null)
Parameters
source
PowerSourceThe power source to attach
storage
PowerStorageThe power storage to attach
Returns
- bool
A success flag
Connect(PowerStorage, Component)
Connects a power storage unit, such as a battery, to a component that has a power node attached. If a power node does not yet exist, it will create the node.
public bool Connect(PowerStorage storage, Component component)
Parameters
storage
PowerStorageThe power storage unit that is connected
component
ComponentThe new power component that should be attached to the storage
Returns
- bool
A success flag
Connect(Component, Component)
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 Connect(Component componentA, Component componentB)
Parameters
componentA
ComponentThe component that already exists on the bus
componentB
ComponentThe new component that will be attached to the bus
Returns
- bool
A success flag
IsChildTypeSupported(Type)
Returns true if 'Component' type is a supported child
protected override bool IsChildTypeSupported(Type type)
Parameters
type
Typea 'Component' type
Returns
IsComponentConnected(Component)
Returns whether a particular component is connected
public bool IsComponentConnected(Component component)
Parameters
component
ComponentThe 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
OnDecodeMetadata(JObject)
Called after the "Component" was loaded to handle additional metadata.
protected override void OnDecodeMetadata(JObject metadata)
Parameters
metadata
JObject
OnEncodeMetadata(JObject)
Called while the "Component" is being saved to save additional metadata.
protected override JObject OnEncodeMetadata(JObject metadata)
Parameters
metadata
JObject
Returns
- JObject
OnUpdate(double, double)
Called when the 'Component' should update
protected override void OnUpdate(double time, double step)
Parameters
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