Class IonChamberBeamMonitor

All Implemented Interfaces:
Device, IBeamMonitor, Monitor, Scannable, Configurable, Findable, gda.observable.IObservable, gda.observable.IObserver

@ServiceInterface(IBeamMonitor.class) public class IonChamberBeamMonitor extends MonitorBase implements gda.observable.IObserver, IBeamMonitor
A worker object operating at background to monitor the photon beam availability using an ion chamber. This class monitors the specified ion chamber amplifier value and checks whether it has fallen below a specified threshold. If so any scan is paused. On reading above the threshold, the paused scan is either resumed or restarted depending on a java parameter gda.device.monitor.resumeScan setting. This monitor behaviour can be switched on and off as required.
  • Constructor Details

    • IonChamberBeamMonitor

      public IonChamberBeamMonitor()
      Empty constructor for Castor configuration.
    • IonChamberBeamMonitor

      public IonChamberBeamMonitor(String detectorName, double threshold)
      Constructor
      Parameters:
      detectorName - the name of the detector instance.
      threshold - the threshold when the scan is paused/resumed.
  • Method Details

    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • atScanStart

      public void atScanStart()
      Description copied from class: ScannableBase
      Called for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atScanStart in interface Scannable
      Overrides:
      atScanStart in class ScannableBase
      See Also:
    • atScanEnd

      public void atScanEnd()
      Description copied from class: ScannableBase
      Called for every Scannable at the end of a group of nested scans (or a single scan if that is the case).

      Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See Scannable.atCommandFailure() Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atScanEnd in interface Scannable
      Overrides:
      atScanEnd in class ScannableBase
      See Also:
    • getThreshold

      public double getThreshold()
      Returns:
      Returns the threshold.
    • setThreshold

      public void setThreshold(double threshold)
      Parameters:
      threshold - The threshold to set.
    • getPosition

      public Object getPosition() throws DeviceException
      Description copied from class: ScannableBase
      Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class ScannableBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
    • getElementCount

      public int getElementCount() throws DeviceException
      Description copied from interface: Monitor
      returns the number of elements in this monitor.
      Specified by:
      getElementCount in interface Monitor
      Overrides:
      getElementCount in class MonitorBase
      Returns:
      int the element count
      Throws:
      DeviceException
    • getUnit

      public String getUnit() throws DeviceException
      Description copied from interface: Monitor
      gets the physical unit of the monitor.
      Specified by:
      getUnit in interface Monitor
      Overrides:
      getUnit in class MonitorBase
      Returns:
      String the physical unit
      Throws:
      DeviceException
    • update

      public void update(Object theObserved, Object changeCode)
      a given number (the default is 5) consecutive
      Specified by:
      update in interface gda.observable.IObserver
      See Also:
      • IObserver.update(java.lang.Object, java.lang.Object)
    • isMonitorOn

      public boolean isMonitorOn()
      checks beam monitor flag
      Specified by:
      isMonitorOn in interface IBeamMonitor
      Returns:
      boolean
    • setMonitorOn

      public void setMonitorOn(boolean monitorOn)
      set beam monitor flag
      Parameters:
      monitorOn -
    • on

      public void on()
      switch on beam monitoring
      Specified by:
      on in interface IBeamMonitor
    • off

      public void off()
      switch off beam monitoring
      Specified by:
      off in interface IBeamMonitor
    • toFormattedString

      public String toFormattedString()
      Description copied from interface: Scannable
      Returns a string representation of the Scannable and its current position/value/status

      Typically should return:

      name : position

      or for detectors, name : status

      If the position/status cannot be determined, the function should return Scannable.VALUE_UNAVAILABLE in its place.

      Specified by:
      toFormattedString in interface Scannable
      Overrides:
      toFormattedString in class ScannableBase
      Returns:
      string as defined above
    • getMonitorName

      public String getMonitorName()
      gets monitor name
      Returns:
      monitor name
    • setMonitorName

      public void setMonitorName(String monitorName)
      sets monitor name
      Parameters:
      monitorName -
    • getMonitor

      public CurrentAmplifier getMonitor()
      gets the current amplifier object
      Returns:
      the current amplifier object
    • setMonitor

      public void setMonitor(CurrentAmplifier monitor)
      sets the current amplifier object
      Parameters:
      monitor -
    • isBeamOn

      public boolean isBeamOn()
      Description copied from interface: IBeamMonitor
      check if X-ray beam is on or not
      Specified by:
      isBeamOn in interface IBeamMonitor
      Returns:
      boolean
    • setBeamOn

      public void setBeamOn(boolean beamOn)
      Parameters:
      beamOn -
    • getCurrentValue

      public double getCurrentValue()
      Returns the current value of this monitor.
      Returns:
      the current value