Table of Contents

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

Battery

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

List<PowerSource>

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

List<List<PowerNodeModel>>

PowerComponents

A list of all power components added to the system

[Hidden]
public List<UniverseObject> PowerComponents

Field Value

List<UniverseObject>

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 UniverseEvent

The first object

b UniverseEvent

The 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 Battery

The 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 Battery

The battery unit that is connected

component UniverseObject

The 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 UniverseObject

The component that already exists on the bus

componentB UniverseObject

The 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 PowerSource

The power source to attach

battery Battery

The battery to attach

Returns

bool

A success flag

IsComponentConnected(UniverseObject)

Returns whether a particular component is connected

public bool IsComponentConnected(UniverseObject component)

Parameters

component UniverseObject

The 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 PowerSource

The 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