Class Context
- java.lang.Object
-
- io.openems.edge.common.statemachine.AbstractContext<EssCycle>
-
- io.openems.edge.controller.ess.cycle.statemachine.Context
-
public class Context extends AbstractContext<EssCycle>
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentManager
componentManager
protected Config
config
protected ManagedSymmetricEss
ess
protected int
maxChargePower
protected int
maxDischargePower
protected StateMachine.State
previousState
-
Constructor Summary
Constructors Constructor Description Context(EssCycle parent, Config config, ComponentManager componentManager, ManagedSymmetricEss ess, int maxChargePower, int maxDischargePower, StateMachine.State previousState, java.time.LocalDateTime lastStateChange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getChargePower()
protected int
getDischargePower()
protected boolean
waitForChangeState(StateMachine.State currentState, StateMachine.State nextState)
Helper for a state change.
-
-
-
Field Detail
-
config
protected final Config config
-
ess
protected final ManagedSymmetricEss ess
-
maxChargePower
protected final int maxChargePower
-
maxDischargePower
protected final int maxDischargePower
-
componentManager
protected final ComponentManager componentManager
-
previousState
protected final StateMachine.State previousState
-
-
Constructor Detail
-
Context
public Context(EssCycle parent, Config config, ComponentManager componentManager, ManagedSymmetricEss ess, int maxChargePower, int maxDischargePower, StateMachine.State previousState, java.time.LocalDateTime lastStateChange)
-
-
Method Detail
-
waitForChangeState
protected boolean 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:
- boolean true if change state is allowed
-
getChargePower
protected int getChargePower()
-
getDischargePower
protected int getDischargePower()
-
-