Class Context
java.lang.Object
io.openems.edge.common.statemachine.AbstractContext<AbstractFixStateOfCharge>
io.openems.edge.controller.ess.fixstateofcharge.statemachine.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Clock
protected final ConfigProperties
protected final int
protected final int
protected final int
-
Constructor Summary
ConstructorDescriptionContext
(AbstractFixStateOfCharge parent, ConfigProperties config, Sum sum, int maxApparentPower, int soc, int targetSoc, ZonedDateTime targetDateTime, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionprotected Integer
protected boolean
Check if the target time should be considered.protected int
Calculate the limited power for the boundaries.float
static StateMachine.State
getSocState
(int soc, int targetSoc) Check if SoC is above, below or at target.boolean
Check whether the configured target time has already been passed.protected void
setRampPower
(float rampPower) protected void
setRampPower
(int rampPower) protected void
setRampPower
(Double rampPower) protected void
setTargetPower
(Float targetPower) protected void
setTargetPower
(Integer targetPower)
-
Field Details
-
config
-
maxApparentPower
protected final int maxApparentPower -
soc
protected final int soc -
targetSoc
protected final int targetSoc -
clock
-
-
Constructor Details
-
Context
public Context(AbstractFixStateOfCharge parent, ConfigProperties config, Sum sum, int maxApparentPower, int soc, int targetSoc, ZonedDateTime targetDateTime, Clock clock)
-
-
Method Details
-
getTargetPower
-
setTargetPower
-
setTargetPower
-
getLastTargetPower
-
getRampPower
public float getRampPower() -
setRampPower
-
setRampPower
protected void setRampPower(float rampPower) -
setRampPower
protected void setRampPower(int rampPower) -
getTargetTime
-
passedTargetTime
public boolean passedTargetTime()Check whether the configured target time has already been passed.- Returns:
- target time already passed
-
getSocState
Check if SoC is above, below or at target.- Parameters:
soc
- current state of chargetargetSoc
- target state of charge- Returns:
- above, below or at target soc
StateMachine.State
-
calculateTargetPower
-
getBoundariesPower
protected int getBoundariesPower()Calculate the limited power for the boundaries.Calculate the minimum from the maximum apparent power and the capacity, adjusting both with a factor.
- Returns:
- limited power for boundaries
-
considerTargetTime
protected boolean considerTargetTime()Check if the target time should be considered.- Returns:
- is target time specified and valid
-