Class HidenRGAScannable

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

public class HidenRGAScannable extends ScannableBase implements gda.observable.IObserver, HidenRGA
The Hiden RGA is a gas mass analyser for use on Spectroscopy beamlines.

It will be shared across different beamlines but only Spectroscopy ones for the moment. If other beamlines need this then this class maybe should be moved into its a different repository.

This class operates in two modes: either it can be part of a stwp scan, but it will force the scan to run slow enough that the Hiden can take a new reading for every data point.

Alternatively it will write its own file and take readings as fast as it can and add timestamps so that the data can be compared with fly scan data offline.

If it is already recording to a file and it is included in a scan that it will throw an exception which will abort the scan.

  • Field Details

  • Constructor Details

    • HidenRGAScannable

      public HidenRGAScannable()
  • 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() throws DeviceException
      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
      Throws:
      DeviceException
      See Also:
    • atScanEnd

      public void atScanEnd() throws DeviceException
      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
      Throws:
      DeviceException
      See Also:
    • stop

      public void stop() throws DeviceException
      Description copied from class: ScannableBase
      Stop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      stop in interface Scannable
      Overrides:
      stop in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atCommandFailure

      public void atCommandFailure() throws DeviceException
      Description copied from class: ScannableBase
      Hook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then only Scannable.stop() will be called by the Scan or pos command.

      Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atCommandFailure in interface Scannable
      Overrides:
      atCommandFailure in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • startRecording

      public void startRecording() throws IOException
      Description copied from interface: HidenRGA
      Start recording RGA data to an ASCII file with a unique name in the current visit data directory.

      The rate at which data is recording is determined by the collection rate attribute.

      Specified by:
      startRecording in interface HidenRGA
      Throws:
      IOException
    • stopRecording

      public void stopRecording()
      Specified by:
      stopRecording in interface HidenRGA
    • 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
    • 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
    • isBusy

      public boolean isBusy() throws DeviceException
      Description copied from interface: Scannable
      Check if the Scannable is moving/operating.
      Specified by:
      isBusy in interface HidenRGA
      Specified by:
      isBusy in interface Scannable
      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
    • getController

      public HidenRGAController getController()
    • setController

      public void setController(HidenRGAController controller)
    • getEpicsPrefix

      public String getEpicsPrefix()
    • setEpicsPrefix

      public void setEpicsPrefix(String epicsPrefix)
    • getMasses

      public Set<Integer> getMasses()
      Specified by:
      getMasses in interface HidenRGA
    • setMasses

      public void setMasses(int[] masses)
      Specified by:
      setMasses in interface HidenRGA
    • getCollectionRate

      public double getCollectionRate()
      Specified by:
      getCollectionRate in interface HidenRGA
    • setCollectionRate

      public void setCollectionRate(double collectionRate)
      Description copied from interface: HidenRGA
      Set the time in seconds between writing data to file in recording mode.

      If invalid input: '<'= 0 then data will be recorded as fast as the RGA collects it, if >=1 then GDA will wait a minimum of that value in seconds before recording the next line of data.

      Specified by:
      setCollectionRate in interface HidenRGA
    • update

      public void update(Object source, Object arg)
      Specified by:
      update in interface gda.observable.IObserver
    • isUseAuxiliaryInputs

      public boolean isUseAuxiliaryInputs()
    • setUseAuxiliaryInputs

      public void setUseAuxiliaryInputs(boolean useAuxiliaryInputs)
    • addToOutputFile

      public void addToOutputFile(String message)
      Add a message to the RGA data file. This can be used for recording, say, scan numbers and sample conditions to allow them to be easily linked to the corresponding RGA data
      Parameters:
      message -
    • getBarChartPressures

      public List<Double> getBarChartPressures() throws IOException
      Specified by:
      getBarChartPressures in interface HidenRGA
      Throws:
      IOException
    • getNumBarChartPressures

      public int getNumBarChartPressures()
      Specified by:
      getNumBarChartPressures in interface HidenRGA
    • getNumberOfMassChannels

      public int getNumberOfMassChannels()
      Specified by:
      getNumberOfMassChannels in interface HidenRGA