Class EpicsScalerSimple

All Implemented Interfaces:
Detector, Device, Scannable, Configurable, Findable, gda.observable.IObservable, Serializable

public class EpicsScalerSimple extends DetectorBase
 Class to allow an EpicsScaler to be used as a detector in GDA
 CollectData - sends 1 to .CNT field
 IsBusy - returns True whilst .CNT field remains 1
 Data is read from .S field.
 The values of n are set in setChannelsToBeRead
 The extraNames for the n values are set in setExtraNames.
 Readout returns an Integer array of length equal to the number of channels to be read
 
See Also:
  • Field Details

    • channelsToBeRead

      protected ArrayList<Integer> channelsToBeRead
    • fieldsToBeRead

      protected String[] fieldsToBeRead
  • Constructor Details

    • EpicsScalerSimple

      public EpicsScalerSimple()
  • Method Details

    • getChannelsToBeRead

      public ArrayList<Integer> getChannelsToBeRead()
      Returns:
      Returns the channelsToBeRead.
    • setChannelsToBeRead

      public void setChannelsToBeRead(ArrayList<Integer> channelsToBeRead)
      Parameters:
      channelsToBeRead - The channelsToBeRead to set.
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.
      Throws:
      DeviceException
    • getStatus

      public int getStatus() throws DeviceException
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Returns:
      BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
      Throws:
      DeviceException
    • _setFieldValue

      public void _setFieldValue(int fieldIndex, Double val) throws DeviceException
      method used for testing only
      Throws:
      DeviceException
    • readout

      public Object readout() throws DeviceException
      Description copied from interface: Detector
      Returns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.

      If LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLY is true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. See Detector.waitWhileBusy() and ConcurrentScan. Readout must block until the detector is ready to respond quickly to Detector.collectData() again.

      Returns:
      the data collected
      Throws:
      DeviceException
    • createsOwnFiles

      public boolean createsOwnFiles() throws DeviceException
      Description copied from interface: Detector
      Returns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException
    • getDescription

      public String getDescription() throws DeviceException
      Specified by:
      getDescription in interface Detector
      Overrides:
      getDescription in class DetectorBase
      Returns:
      A description of the detector.
      Throws:
      DeviceException
    • getDetectorID

      public String getDetectorID() throws DeviceException
      Specified by:
      getDetectorID in interface Detector
      Overrides:
      getDetectorID in class DetectorBase
      Returns:
      A identifier for this detector.
      Throws:
      DeviceException
    • getDetectorType

      public String getDetectorType() throws DeviceException
      Specified by:
      getDetectorType in interface Detector
      Overrides:
      getDetectorType in class DetectorBase
      Returns:
      The type of detector.
      Throws:
      DeviceException
    • getEpicsDevice

      public FindableEpicsDevice getEpicsDevice()
      Returns:
      Returns the epicsDevice.
    • setEpicsDevice

      public void setEpicsDevice(FindableEpicsDevice epicsDevice)
      Parameters:
      epicsDevice - The epicsDevice to set.
    • 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
    • setCollectionTime

      public void setCollectionTime(double time)
      Sets the collection time for the scalers
      Specified by:
      setCollectionTime in interface Detector
      Overrides:
      setCollectionTime in class DetectorBase
      Parameters:
      time - period to count
    • getCollectionTime

      public double getCollectionTime()
      Gets the collection time from the scalers
      Specified by:
      getCollectionTime in interface Detector
      Overrides:
      getCollectionTime in class DetectorBase
      Returns:
      double collectionTime