Class Xspress2BufferedDetector

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

public class Xspress2BufferedDetector extends DetectorBase implements BufferedDetector, NexusDetector
To operate the Xspress through TFGv2 in the ContinuousScan framework
See Also:
  • Field Details

    • continuousParameters

      protected ContinuousParameters continuousParameters
    • isContinuousMode

      protected boolean isContinuousMode
    • xspress2system

      protected Xspress2Detector xspress2system
    • maxNumberOfInts

      protected int maxNumberOfInts
    • daserver

      protected DAServer daserver
    • useNexusTreeWriter

      protected boolean useNexusTreeWriter
    • nexusTreeWriter

      protected transient NexusTreeWriterHelper nexusTreeWriter
  • Constructor Details

    • Xspress2BufferedDetector

      public Xspress2BufferedDetector()
  • Method Details

    • getTriggerSwitch

      public int getTriggerSwitch()
    • setTriggerSwitch

      public void setTriggerSwitch(int triggerSwitch)
    • getFramesRead

      public Object[] getFramesRead()
    • clearFramesRead

      public void clearFramesRead()
    • getExtraNames

      public String[] getExtraNames()
      Description copied from interface: Scannable
      Additional names for extra values that returned by getPosition().
      Specified by:
      getExtraNames in interface Scannable
      Overrides:
      getExtraNames in class ScannableBase
      Returns:
      array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
    • getInputNames

      public String[] getInputNames()
      Description copied from interface: Scannable
      gets a array of InputNames used by moveTo of this scannable.
      Specified by:
      getInputNames in interface Scannable
      Overrides:
      getInputNames in class ScannableBase
      Returns:
      array of the names of the elements of the object returned by getPosition
    • getOutputFormat

      public String[] getOutputFormat()
      Description copied from interface: Scannable
      Returns an array of strings which are the format strings to use when pretty printing parts of the output
      Specified by:
      getOutputFormat in interface Scannable
      Overrides:
      getOutputFormat in class ScannableBase
      Returns:
      string array
    • clearMemory

      public void clearMemory() throws DeviceException
      Description copied from interface: BufferedDetector
      Clears the detector memory
      Specified by:
      clearMemory in interface BufferedDetector
      Throws:
      DeviceException
    • getNumberFrames

      public int getNumberFrames() throws DeviceException
      Specified by:
      getNumberFrames in interface BufferedDetector
      Returns:
      number of frames of data in memory which have been collected
      Throws:
      DeviceException
    • isContinuousMode

      public boolean isContinuousMode()
      Specified by:
      isContinuousMode in interface BufferedDetector
      Returns:
      true if the detector is ready to accept trigger pulses
    • readAllFrames

      public Object[] readAllFrames() throws DeviceException
      Description copied from interface: BufferedDetector
      An array of the data from the detector. Each element is one frame of data.
      Specified by:
      readAllFrames in interface BufferedDetector
      Returns:
      Object
      Throws:
      DeviceException
    • readFrames

      public Object[] readFrames(int startFrame, int finalFrame) throws DeviceException
      Description copied from interface: BufferedDetector
      An array of the data from the detector. Each element is one frame of data. The first frame is 0.
      Specified by:
      readFrames in interface BufferedDetector
      Parameters:
      startFrame -
      finalFrame -
      Returns:
      Object
      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:
    • stop

      public void stop()
      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
      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:
    • setContinuousMode

      public void setContinuousMode(boolean on) throws DeviceException
      Description copied from interface: BufferedDetector
      When in slave mode the detector will be triggered by an external signal to collect each frame of data.
      Specified by:
      setContinuousMode in interface BufferedDetector
      Parameters:
      on -
      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
    • 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
    • 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
    • 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
    • readout

      public NexusTreeProvider 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.

      Specified by:
      readout in interface Detector
      Specified by:
      readout in interface NexusDetector
      Returns:
      the data collected
      Throws:
      DeviceException
    • maximumReadFrames

      public int maximumReadFrames() throws DeviceException
      Description copied from interface: BufferedDetector
      As certain detectors may cause memory issues if too many frames are attempted to be read in one go, this is the maximum for this detector based on its current configuration (i.e. after setContinuousMode(True) has been called.

      The lowest value returned from any of the detectors in a continuous scan will be the limit set.

      If there is no limit then this method should return Integer.MAX_VALUE.

      Specified by:
      maximumReadFrames in interface BufferedDetector
      Returns:
      int - the maximum number of frames which should be read at any one time from this detector
      Throws:
      DeviceException
    • getContinuousParameters

      public ContinuousParameters getContinuousParameters()
      Specified by:
      getContinuousParameters in interface BufferedDetector
      Returns:
      ContinuousParameters
    • setContinuousParameters

      public void setContinuousParameters(ContinuousParameters parameters)
      Description copied from interface: BufferedDetector
      Sets the parameters which define the continuous movement to use
      Specified by:
      setContinuousParameters in interface BufferedDetector
      Parameters:
      parameters -
    • getXspress2system

      public Xspress2Detector getXspress2system()
    • setXspress2system

      public void setXspress2system(Xspress2Detector xspress2system)
    • isSlave

      public boolean isSlave()
    • setSlave

      public void setSlave(boolean isSlave)
    • getDaserver

      public DAServer getDaserver()
    • setDaserver

      public void setDaserver(DAServer daserver)
    • getUseNexusTreeWriter

      public boolean getUseNexusTreeWriter()
    • setUseNexusTreeWriter

      public void setUseNexusTreeWriter(boolean useTreeWriter)
    • setDetectorNexusFilename

      public void setDetectorNexusFilename(String detectorNexusFilename)
    • getDetectorNexusFilename

      public String getDetectorNexusFilename()