Class AbstractAllowedChargeDischargeHandler<ESS extends SymmetricEss>
java.lang.Object
io.openems.edge.ess.generic.common.AbstractAllowedChargeDischargeHandler<ESS>
- All Implemented Interfaces:
BiConsumer<ClockProvider,
Battery>
- Direct Known Subclasses:
AllowedChargeDischargeHandler
,AllowedChargeDischargeHandler
public abstract class AbstractAllowedChargeDischargeHandler<ESS extends SymmetricEss>
extends Object
implements BiConsumer<ClockProvider,Battery>
Helper class to handle calculation of Allowed-Charge-Power and
Allowed-Discharge-Power. This class is used by
ChannelManager
as a
callback to updates of Battery Channels.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
protected float
protected float
static final float
Allow a maximum increase per second.protected final ESS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
accept
(ClockProvider clockProvider, Battery battery) protected void
calculateAllowedChargeDischargePower
(ClockProvider clockProvider, boolean isStarted, Integer chargeMaxCurrent, Integer dischargeMaxCurrent, Integer voltage) Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters.protected void
calculateAllowedChargeDischargePower
(ClockProvider clockProvider, Battery battery) Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiConsumer
andThen
-
Field Details
-
DISCHARGE_EFFICIENCY_FACTOR
public static final float DISCHARGE_EFFICIENCY_FACTOR- See Also:
-
MAX_INCREASE_PERCENTAGE
public static final float MAX_INCREASE_PERCENTAGEAllow a maximum increase per second.5 % of possible allowed charge/discharge power
- See Also:
-
parent
-
lastBatteryAllowedChargePower
protected float lastBatteryAllowedChargePower -
lastBatteryAllowedDischargePower
protected float lastBatteryAllowedDischargePower
-
-
Constructor Details
-
AbstractAllowedChargeDischargeHandler
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceBiConsumer<ClockProvider,
Battery>
-
calculateAllowedChargeDischargePower
Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters. Result is stored in 'lastBatteryAllowedChargePower' and 'lastBatteryAllowedDischargePower' variables - both as positive values!- Parameters:
clockProvider
- theClockProvider
battery
- theBattery
-
calculateAllowedChargeDischargePower
protected void calculateAllowedChargeDischargePower(ClockProvider clockProvider, boolean isStarted, Integer chargeMaxCurrent, Integer dischargeMaxCurrent, Integer voltage) Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters. Result is stored in 'allowedChargePower' and 'allowedDischargePower' variables - both as positive values!- Parameters:
clockProvider
- theClockProvider
isStarted
- is the ESS started?chargeMaxCurrent
- theBattery.ChannelId.CHARGE_MAX_CURRENT
dischargeMaxCurrent
- theBattery.ChannelId#DISHARGE_MAX_CURRENT
voltage
- theBattery.ChannelId.VOLTAGE
-