C# Class EnergyUsingObject

Inheritance: SimObject
Afficher le fichier Open project: FIU-SCIS-Senior-Projects/SmartBuilding4 Class Usage Examples

Méthodes publiques

Méthode Description
ReceiveEnergy ( ) : float

Receives the energy. called from the plug load.. amt of energy used.

addBattery ( Battery, bat ) : void

Adds the battery to batteryList

connectToPlugLoad ( PlugLoad, pl ) : void
disconnectFromPlugLoad ( ) : void
getBatteryEnergyAt ( int batIndex ) : float

Gets the battery level at batIndex.

getConnectedPlugLoad ( ) : PlugLoad,
getEnergyUsagePerSec ( ) : float

Gets the energy usage per sec.

getIsEnergySupplied ( ) : bool

Gets the is energy supplied.

getIsPluggedIn ( ) : bool
getIsPoweredOn ( ) : bool

Gets if is powered on.

getIsUsingBattery ( ) : bool

Gets the is using battery.

getNumBatteries ( ) : int

Gets the number batteries.

getTotalEnergyUsage ( ) : float

Gets the total energy usage.

powerOff ( ) : bool

Powers off.

powerOn ( ) : bool

Powers on.

removeBatteryAt ( int batIndex ) : void

Removes the battery at batIndex.

setBatteryEnergyAt ( int batIndex, float amt ) : void

Sets the battery energy at batIndex and set to amt.

startSupplyingEnergy ( ) : void

Starts the supplying energy.

startUsingBattery ( ) : void

Starts the using battery.

stopSupplyingEnergy ( ) : void

Stops the supplying energy.

stopUsingBattery ( ) : void

Stops the using battery.

toggleSupplyingEnergy ( ) : void
toggleSupplyingEnergy ( Button sender ) : void

for when a button in the ui has to toggle this that way this method auto sets whatever button it was. Hopefully that button is linked to the proper EUO. Oh well.

Private Methods

Méthode Description
Awake ( ) : void
Start ( ) : void
Update ( ) : void

Update this instance. /// Updates the energy use. Does necessary calculations for averages and totals. should be called each frame from the energy hub.

hasPower ( ) : bool

returns if has power.

Method Details

ReceiveEnergy() public méthode

Receives the energy. called from the plug load.. amt of energy used.
public ReceiveEnergy ( ) : float
Résultat float

addBattery() public méthode

Adds the battery to batteryList
public addBattery ( Battery, bat ) : void
bat Battery, Bat. the Battery to add
Résultat void

connectToPlugLoad() public méthode

public connectToPlugLoad ( PlugLoad, pl ) : void
pl PlugLoad,
Résultat void

disconnectFromPlugLoad() public méthode

public disconnectFromPlugLoad ( ) : void
Résultat void

getBatteryEnergyAt() public méthode

Gets the battery level at batIndex.
public getBatteryEnergyAt ( int batIndex ) : float
batIndex int Bat index.
Résultat float

getConnectedPlugLoad() public méthode

public getConnectedPlugLoad ( ) : PlugLoad,
Résultat PlugLoad,

getEnergyUsagePerSec() public méthode

Gets the energy usage per sec.
public getEnergyUsagePerSec ( ) : float
Résultat float

getIsEnergySupplied() public méthode

Gets the is energy supplied.
public getIsEnergySupplied ( ) : bool
Résultat bool

getIsPluggedIn() public méthode

public getIsPluggedIn ( ) : bool
Résultat bool

getIsPoweredOn() public méthode

Gets if is powered on.
public getIsPoweredOn ( ) : bool
Résultat bool

getIsUsingBattery() public méthode

Gets the is using battery.
public getIsUsingBattery ( ) : bool
Résultat bool

getNumBatteries() public méthode

Gets the number batteries.
public getNumBatteries ( ) : int
Résultat int

getTotalEnergyUsage() public méthode

Gets the total energy usage.
public getTotalEnergyUsage ( ) : float
Résultat float

powerOff() public méthode

Powers off.
public powerOff ( ) : bool
Résultat bool

powerOn() public méthode

Powers on.
public powerOn ( ) : bool
Résultat bool

removeBatteryAt() public méthode

Removes the battery at batIndex.
public removeBatteryAt ( int batIndex ) : void
batIndex int Bat index.
Résultat void

setBatteryEnergyAt() public méthode

Sets the battery energy at batIndex and set to amt.
public setBatteryEnergyAt ( int batIndex, float amt ) : void
batIndex int Bat index.
amt float Amt.
Résultat void

startSupplyingEnergy() public méthode

Starts the supplying energy.
public startSupplyingEnergy ( ) : void
Résultat void

startUsingBattery() public méthode

Starts the using battery.
public startUsingBattery ( ) : void
Résultat void

stopSupplyingEnergy() public méthode

Stops the supplying energy.
public stopSupplyingEnergy ( ) : void
Résultat void

stopUsingBattery() public méthode

Stops the using battery.
public stopUsingBattery ( ) : void
Résultat void

toggleSupplyingEnergy() public méthode

public toggleSupplyingEnergy ( ) : void
Résultat void

toggleSupplyingEnergy() public méthode

for when a button in the ui has to toggle this that way this method auto sets whatever button it was. Hopefully that button is linked to the proper EUO. Oh well.
public toggleSupplyingEnergy ( Button sender ) : void
sender Button Sender.
Résultat void