Class BaseProcessCheck

java.lang.Object
PamController.status.BaseProcessCheck
All Implemented Interfaces:
ProcessCheck

public class BaseProcessCheck extends Object implements ProcessCheck
Basic checks of one or more processes in a module. The module will have to add one of these process checks explicitly for every process it wan'ts to check, checks can include the input being connected, the output being connected, data arriving at the input and data arriving at the output
Author:
Doug
  • Constructor Details

    • BaseProcessCheck

      public BaseProcessCheck(PamProcess pamProcess, Class inputClass, double d, double e)
      Class to check a PAMProcess is doing it's stuff
      Parameters:
      pamProcess - process reference
      inputClass - input class (can be null if there is no input)
      d - minimum rate of input data
      e - minimum rate of output data
  • Method Details

    • newInput

      public void newInput(PamObservable obs, PamDataUnit data)
      Description copied from interface: ProcessCheck
      Called from a process every time new input data arrive
      Specified by:
      newInput in interface ProcessCheck
      Parameters:
      obs - PamObservable (always a PAMDataBlock)
      data - Data unit
    • newOutput

      public void newOutput(PamObservable obs, PamDataUnit data)
      Description copied from interface: ProcessCheck
      Called from a process every time new data are added to the output data block
      Specified by:
      newOutput in interface ProcessCheck
      Parameters:
      obs - PamObservable (always a PAMDataBlock)
      data - Data unit
    • setInputAveraging

      public void setInputAveraging(double averaging)
      Set and averaging for the input counter.
      This must me greater than or equal to 1. A value of 1 means no averaging, bigger values will be the number of measurements counts are averaged over using a simple decaying average calculation
      Parameters:
      averaging -
    • setOutputAveraging

      public void setOutputAveraging(double averaging)
      Set and averaging for the output counter.
      This must me greater than or equal to 1. A value of 1 means no averaging, bigger values will be the number of measurements counts are averaged over using a simple decaying average calculation
      Parameters:
      averaging -
    • reset

      public void reset()
    • getStatus

      public ModuleStatus getStatus()
      Description copied from interface: ProcessCheck
      Get the process status. Note that calling this will probably reset some counters, so don't call this multiple times in quick succession.
      Specified by:
      getStatus in interface ProcessCheck
      Returns:
      the status of this process
    • getIdleStatus

      public ModuleStatus getIdleStatus()
      Get a status when the system is idle. Generally this is just a warning, but it might get overridden for modules that are meant to operate even when PAM is idle.
      Returns:
      A status for when the system is idel.
    • getRunningStatus

      public ModuleStatus getRunningStatus()
      Returns:
      a status for if the idle stats was null
    • isNeverIdle

      public boolean isNeverIdle()
    • setNeverIdle

      public void setNeverIdle(boolean neverIdle)
    • getInputCounter

      public BaseProcessCheck.IOCounter getInputCounter()
    • getOutputCounter

      public BaseProcessCheck.IOCounter getOutputCounter()