Package io.openems.edge.battery.test
Class DummyBattery
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.battery.test.DummyBattery
-
- All Implemented Interfaces:
Battery
,OpenemsComponent
,StartStoppable
public class DummyBattery extends AbstractOpenemsComponent implements Battery, OpenemsComponent, StartStoppable
Provides a simple, simulatedBattery
component that can be used together with the OpenEMS Component test framework.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.openems.edge.battery.api.Battery
Battery.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.startstop.StartStoppable
StartStoppable.ChannelId
-
-
Constructor Summary
Constructors Constructor Description DummyBattery(java.lang.String id)
DummyBattery(java.lang.String id, ChannelId[] additionalChannelIds)
-
Method Summary
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, deactivate, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.battery.api.Battery
_setCapacity, _setCapacity, _setChargeMaxCurrent, _setChargeMaxCurrent, _setChargeMaxVoltage, _setChargeMaxVoltage, _setCurrent, _setCurrent, _setDischargeMaxCurrent, _setDischargeMaxCurrent, _setDischargeMinVoltage, _setDischargeMinVoltage, _setMaxCellTemperature, _setMaxCellTemperature, _setMaxCellVoltage, _setMaxCellVoltage, _setMinCellTemperature, _setMinCellTemperature, _setMinCellVoltage, _setMinCellVoltage, _setSoc, _setSoc, _setSoh, _setSoh, _setVoltage, _setVoltage, getCapacity, getCapacityChannel, getChargeMaxCurrent, getChargeMaxCurrentChannel, getChargeMaxVoltage, getChargeMaxVoltageChannel, getCurrent, getCurrentChannel, getDischargeMaxCurrent, getDischargeMaxCurrentChannel, getDischargeMinVoltage, getDischargeMinVoltageChannel, getMaxCellTemperature, getMaxCellTemperatureChannel, getMaxCellVoltage, getMaxCellVoltageChannel, getMinCellTemperature, getMinCellTemperatureChannel, getMinCellVoltage, getMinCellVoltageChannel, getSoc, getSocChannel, getSoh, getSohChannel, getVoltage, getVoltageChannel
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Methods inherited from interface io.openems.edge.common.startstop.StartStoppable
_setStartStop, getStartStop, getStartStopChannel, isStarted, isStopped, start, stop
-
-
-
-
Constructor Detail
-
DummyBattery
public DummyBattery(java.lang.String id)
-
DummyBattery
public DummyBattery(java.lang.String id, ChannelId[] additionalChannelIds)
-
-
Method Detail
-
setStartStop
public void setStartStop(StartStop value) throws OpenemsError.OpenemsNamedException
Description copied from interface:StartStoppable
Starts or stops the device or service represented by this OpenEMS Component.- Specified by:
setStartStop
in interfaceStartStoppable
- Parameters:
value
- targetStartStop
state- Throws:
OpenemsError.OpenemsNamedException
- on error
-
withCapacity
public DummyBattery withCapacity(int value)
Sets and applies theBattery.ChannelId.CAPACITY
.- Parameters:
value
- the Capacity in [Wh]- Returns:
- myself
-
withVoltage
public DummyBattery withVoltage(int value)
Sets and applies theBattery.ChannelId.VOLTAGE
.- Parameters:
value
- the Capacity in [V]- Returns:
- myself
-
withDischargeMaxCurrent
public DummyBattery withDischargeMaxCurrent(int value)
Sets and applies theBattery.ChannelId.DISCHARGE_MAX_CURRENT
.- Parameters:
value
- the Discharge Max Current in [A]- Returns:
- myself
-
withChargeMaxCurrent
public DummyBattery withChargeMaxCurrent(int value)
Sets and applies theBattery.ChannelId.CHARGE_MAX_CURRENT
.- Parameters:
value
- the Charge Max Current in [A]- Returns:
- myself
-
withMinCellVoltage
public DummyBattery withMinCellVoltage(int value)
Sets and applies theBattery.ChannelId.MIN_CELL_VOLTAGE
.- Parameters:
value
- the Min-Cell-Voltage in [mV]- Returns:
- myself
-
withMaxCellVoltage
public DummyBattery withMaxCellVoltage(int value)
Sets and applies theBattery.ChannelId.MAX_CELL_VOLTAGE
.- Parameters:
value
- the Max-Cell-Voltage in [mV]- Returns:
- myself
-
withMinCellTemperature
public DummyBattery withMinCellTemperature(int value)
Sets and applies theBattery.ChannelId.MIN_CELL_TEMPERATURE
.- Parameters:
value
- the Min-Cell-Temperature in [degC]- Returns:
- myself
-
withMaxCellTemperature
public DummyBattery withMaxCellTemperature(int value)
Sets and applies theBattery.ChannelId.MAX_CELL_TEMPERATURE
.- Parameters:
value
- the Max-Cell-Temperature in [degC]- Returns:
- myself
-
-