java.lang.Object
io.openems.edge.common.statemachine.AbstractContext<AbstractFixStateOfCharge>
io.openems.edge.controller.ess.fixstateofcharge.statemachine.Context

public class Context extends AbstractContext<AbstractFixStateOfCharge>
  • Field Details

    • config

      protected final ConfigProperties config
    • maxApparentPower

      protected final int maxApparentPower
    • soc

      protected final int soc
    • targetSoc

      protected final int targetSoc
    • clock

      protected final Clock clock
  • Constructor Details

  • Method Details

    • getTargetPower

      public Float getTargetPower()
    • setTargetPower

      protected void setTargetPower(Float targetPower)
    • setTargetPower

      protected void setTargetPower(Integer targetPower)
    • getLastTargetPower

      public Float getLastTargetPower()
    • getRampPower

      public float getRampPower()
    • setRampPower

      protected void setRampPower(Double rampPower)
    • setRampPower

      protected void setRampPower(float rampPower)
    • setRampPower

      protected void setRampPower(int rampPower)
    • getTargetTime

      public ZonedDateTime getTargetTime()
    • passedTargetTime

      public boolean passedTargetTime()
      Check whether the configured target time has already been passed.
      Returns:
      target time already passed
    • getSocState

      public static StateMachine.State getSocState(int soc, int targetSoc)
      Check if SoC is above, below or at target.
      Parameters:
      soc - current state of charge
      targetSoc - target state of charge
      Returns:
      above, below or at target soc StateMachine.State
    • calculateTargetPower

      protected Integer 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