Class Context
java.lang.Object
io.openems.edge.common.statemachine.AbstractContext<ControllerEssCycleImpl>
io.openems.edge.controller.ess.cycle.statemachine.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected final int
protected final Clock
protected final Config
protected final ManagedSymmetricEss
protected final LocalDateTime
-
Constructor Summary
ConstructorDescriptionContext
(ControllerEssCycleImpl parent, Config config, Clock clock, ManagedSymmetricEss ess, LocalDateTime startTime) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
getAcPower
(ManagedSymmetricEss ess, HybridEssMode hybridEssMode, int power) Gets the required AC power set-point for AC- or Hybrid-ESS.boolean
Is Start Time Initialized?.void
Updates the time whenStateMachine
StateMachine.State
changed.protected StateMachine.State
waitForChangeState
(StateMachine.State currentState, StateMachine.State nextState) Helper for a state change.
-
Field Details
-
config
-
ess
-
allowedChargePower
protected final int allowedChargePower -
allowedDischargePower
protected final int allowedDischargePower -
clock
-
startTime
-
-
Constructor Details
-
Context
public Context(ControllerEssCycleImpl parent, Config config, Clock clock, ManagedSymmetricEss ess, LocalDateTime startTime)
-
-
Method Details
-
getAcPower
Gets the required AC power set-point for AC- or Hybrid-ESS.- Parameters:
ess
- theManagedSymmetricEss
; checked forHybridEss
hybridEssMode
- theHybridEssMode
power
- the configured target power- Returns:
- the AC power set-point
-
isStartTimeInitialized
public boolean isStartTimeInitialized()Is Start Time Initialized?.- Returns:
- true if the Controller should be executed now
-
waitForChangeState
protected StateMachine.State waitForChangeState(StateMachine.State currentState, StateMachine.State nextState) Helper for a state change. If awaiting hysteresis time exceeded switches from currentState to NextState.- Parameters:
currentState
- Used to output better log.nextState
- state which will be switched to.- Returns:
StateMachine.State
state.
-
updateLastStateChangeTime
public void updateLastStateChangeTime()Updates the time whenStateMachine
StateMachine.State
changed.
-