C# Class EnergyUsingObject

Inheritance: SimObject
Exibir arquivo Open project: FIU-SCIS-Senior-Projects/SmartBuilding4 Class Usage Examples

Public Methods

Method 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

Method 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 method

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

addBattery() public method

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

connectToPlugLoad() public method

public connectToPlugLoad ( PlugLoad, pl ) : void
pl PlugLoad,
return void

disconnectFromPlugLoad() public method

public disconnectFromPlugLoad ( ) : void
return void

getBatteryEnergyAt() public method

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

getConnectedPlugLoad() public method

public getConnectedPlugLoad ( ) : PlugLoad,
return PlugLoad,

getEnergyUsagePerSec() public method

Gets the energy usage per sec.
public getEnergyUsagePerSec ( ) : float
return float

getIsEnergySupplied() public method

Gets the is energy supplied.
public getIsEnergySupplied ( ) : bool
return bool

getIsPluggedIn() public method

public getIsPluggedIn ( ) : bool
return bool

getIsPoweredOn() public method

Gets if is powered on.
public getIsPoweredOn ( ) : bool
return bool

getIsUsingBattery() public method

Gets the is using battery.
public getIsUsingBattery ( ) : bool
return bool

getNumBatteries() public method

Gets the number batteries.
public getNumBatteries ( ) : int
return int

getTotalEnergyUsage() public method

Gets the total energy usage.
public getTotalEnergyUsage ( ) : float
return float

powerOff() public method

Powers off.
public powerOff ( ) : bool
return bool

powerOn() public method

Powers on.
public powerOn ( ) : bool
return bool

removeBatteryAt() public method

Removes the battery at batIndex.
public removeBatteryAt ( int batIndex ) : void
batIndex int Bat index.
return void

setBatteryEnergyAt() public method

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

startSupplyingEnergy() public method

Starts the supplying energy.
public startSupplyingEnergy ( ) : void
return void

startUsingBattery() public method

Starts the using battery.
public startUsingBattery ( ) : void
return void

stopSupplyingEnergy() public method

Stops the supplying energy.
public stopSupplyingEnergy ( ) : void
return void

stopUsingBattery() public method

Stops the using battery.
public stopUsingBattery ( ) : void
return void

toggleSupplyingEnergy() public method

public toggleSupplyingEnergy ( ) : void
return void

toggleSupplyingEnergy() public method

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.
return void