Class EpicsBekhoffAdc

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

public class EpicsBekhoffAdc extends DetectorBase implements NexusDetector
See Also:
  • Field Details

    • basePVName

      protected String basePVName
    • detectorDataEntryMap

      protected transient HashMap<String,DetectorDataEntry<?>> detectorDataEntryMap
    • dataMapToWrite

      protected final HashMap<String,Object> dataMapToWrite
    • adcStateMonitor

      protected final transient gov.aps.jca.event.MonitorListener adcStateMonitor
  • Constructor Details

    • EpicsBekhoffAdc

      protected EpicsBekhoffAdc()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      check bean properties have been set. This must be used to specify a custom init-method in an XML bean definition.
    • 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 collectionTime) throws DeviceException
      Description copied from interface: Detector
      Sets the collection time, in seconds, to be used during the next call of collectData.
      Specified by:
      setCollectionTime in interface Detector
      Overrides:
      setCollectionTime in class DetectorBase
      Parameters:
      collectionTime - the collection time in seconds
      Throws:
      DeviceException
    • 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.
      Specified by:
      collectData in interface Detector
      Throws:
      DeviceException
    • waitWhileBusy

      public void waitWhileBusy() throws DeviceException, InterruptedException
      Description copied from class: ScannableBase
      Returns when operation carried out by moveTo has completed If this is to be overriden, isBusy must also be valid. Although the pos and scan command currently use this method to determine if the Scannable is busy, this must not be relied upon.
      Specified by:
      waitWhileBusy in interface Detector
      Specified by:
      waitWhileBusy in interface Scannable
      Overrides:
      waitWhileBusy in class ScannableBase
      Throws:
      DeviceException
      InterruptedException
    • getStatus

      public int getStatus() throws DeviceException
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Specified by:
      getStatus in interface Detector
      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
    • getAdcStatus

      public String getAdcStatus() throws DeviceException
      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.
      Specified by:
      createsOwnFiles in interface Detector
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException
    • 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:
    • atPointStart

      public void atPointStart() throws DeviceException
      Description copied from class: ScannableBase
      Called on every Scannable at every data point, for scans which are broken down into individual points (i.e. non-continuous scans) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atPointStart in interface Scannable
      Overrides:
      atPointStart in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atPointEnd

      public void atPointEnd() throws DeviceException
      Description copied from class: ScannableBase
      Called on every Scannable at the end of every data point, for scans which are broken down into individual points (i.e. non-continous scans) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atPointEnd in interface Scannable
      Overrides:
      atPointEnd 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:
    • 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:
    • readout

      public NexusTreeProvider readout() throws DeviceException
      Description copied from interface: NexusDetector
      Returns the latest data collected as well as general detector information
      Specified by:
      readout in interface Detector
      Specified by:
      readout in interface NexusDetector
      Returns:
      the data collected
      Throws:
      DeviceException
    • getFileStructure

      public NexusTreeProvider getFileStructure() throws DeviceException
      Description copied from interface: Detector
      Returns the structure of the file. This is only needed if using NexusScanDataWriter#PROPERTY_NAME_CREATE_FILE_AT_SCAN_START is true. If null (default), then the detector is not compatible with this property and will throw an error. This must describe the nexus structure fields that the detector will later write to. *
      Specified by:
      getFileStructure in interface Detector
      Returns:
      the nexus file structure
      Throws:
      DeviceException
    • setDetectorDataEntryMap

      protected void setDetectorDataEntryMap(HashMap<?,?>... data) throws DeviceException
      Throws:
      DeviceException
    • getPosition

      public Object getPosition() throws DeviceException
      Description copied from class: DetectorBase
      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. Also, if createsOwnFiles attempts to register the file with all FileRegistrars (primarily for data archiving). Note that this method will be called if the detector is triggered from a 'pos' command but not if the detector is triggered by the scan command (which ignores the detector's scannable interface).
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class DetectorBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
      See Also:
    • setAdcMode

      public void setAdcMode(String adcMode) throws DeviceException
      Set the ADC mode, takes a string for Jython to use
      Parameters:
      adcMode - The requested ADC mode
      Throws:
      DeviceException
    • setAdcMode

      public void setAdcMode(EpicsBekhoffAdc.AdcMode adcMode) throws DeviceException
      Throws:
      DeviceException
    • getAdcMode

      public EpicsBekhoffAdc.AdcMode getAdcMode() throws DeviceException
      Throws:
      DeviceException
    • getAdcSamples

      public int getAdcSamples() throws DeviceException
      Throws:
      DeviceException
    • setAdcSamples

      public void setAdcSamples(int num) throws DeviceException
      Throws:
      DeviceException
    • getAdcAverage

      public int getAdcAverage() throws DeviceException
      Throws:
      DeviceException
    • setAdcAverage

      public void setAdcAverage(int num) throws DeviceException
      Throws:
      DeviceException
    • setAdcEnable

      public void setAdcEnable(boolean enabled) throws DeviceException
      Throws:
      DeviceException
    • getAdcEnable

      public boolean getAdcEnable() throws DeviceException
      Throws:
      DeviceException
    • setAdcRetrigger

      public void setAdcRetrigger(boolean enabled) throws DeviceException
      Throws:
      DeviceException
    • getAdcRetrigger

      public boolean getAdcRetrigger() throws DeviceException
      Throws:
      DeviceException
    • 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 DetectorBase
      Returns:
      string as defined above
    • getBasePVName

      public String getBasePVName()
    • setBasePVName

      public void setBasePVName(String basePVName)
    • getAdcChannel

      public int getAdcChannel()
    • setAdcChannel

      public void setAdcChannel(int adcChannel)
    • isAutoGain

      public boolean isAutoGain()
    • setAutoGain

      public void setAutoGain(boolean autoGain)
    • isHasIAVinPV

      public boolean isHasIAVinPV()
    • setHasIAVinPV

      public void setHasIAVinPV(boolean hasAverage)
    • isIntegrated

      public boolean isIntegrated()
    • setIntegrated

      public void setIntegrated(boolean integrated)
    • getAmplifier

      public AmplifierAutoGain getAmplifier()
    • setAmplifier

      public void setAmplifier(AmplifierAutoGain amplifier)
    • isWriteAbsValues

      public boolean isWriteAbsValues()
    • setWriteAbsValues

      public void setWriteAbsValues(boolean writeAbsValues)