Class PowerInterlockApplication.RateCalculator

java.lang.Object
org.scictrl.csshell.epics.server.application.PowerInterlockApplication.RateCalculator
Enclosing class:
PowerInterlockApplication

public static class PowerInterlockApplication.RateCalculator extends Object
Calculates rate of interlocks on normalized time interval.
  • Constructor Details

    • RateCalculator

      public RateCalculator()
      New instance.
  • Method Details

    • getWindow

      public long getWindow()
      Returns time window in ms.
      Returns:
      time window in ms
    • setWindow

      public void setWindow(long window)
      Sets time window in ms.
      Parameters:
      window - time window in ms
    • report

      public void report(boolean high)
      Reports to the calculator interlock high incident.
      Parameters:
      high - true if interlock is high, false at end of interlock
    • calculate

      public double calculate()
      Calculates and returns interlock rate
      Returns:
      calculated interlock rate
    • getRate

      public double getRate()
      Last calculated rate.
      Returns:
      last calculated rate