Class RampFilter

java.lang.Object
io.openems.edge.common.filter.RampFilter
Direct Known Subclasses:
DisabledRampFilter

public class RampFilter extends Object
A controller that applies a ramp to a given value.
  • Constructor Details

    • RampFilter

      public RampFilter()
    • RampFilter

      public RampFilter(Float initialValue)
  • Method Details

    • getFilteredValueAsInteger

      public Integer getFilteredValueAsInteger(Float targetValue, float maxChangePerCall)
      Get filtered value using the present lastValue, the value to reach and a fixed maximum change per call.
      Parameters:
      targetValue - Value to reach
      maxChangePerCall - Fixed change per call
      Returns:
      value as Integer with applied ramp filter
    • getFilteredValueAsInteger

      public Integer getFilteredValueAsInteger(float lastValue, Float targetValue, float maximumLimit, float increaseRate)
      Get filtered value using the given lastValue, the value to reach and a calculated maximum change per call.
      Parameters:
      lastValue - Last or current value that needs to be adjusted
      targetValue - Value to reach
      maximumLimit - Maximum limit used to calculate a fixed change per call
      increaseRate - Increasing rate used to calculate a fixed change per call
      Returns:
      value as Integer with applied ramp filter
    • getFilteredValueAsInteger

      public Integer getFilteredValueAsInteger(float lastValue, Float targetValue, float maxChangePerCall)
      Get filtered value using the given lastValue, the value to reach and a fixed maximum change per call.
      Parameters:
      lastValue - Last or current value that needs to be adjusted
      targetValue - Value to reach
      maxChangePerCall - Fixed change per call
      Returns:
      value as Integer with applied ramp filter