Class BufferedPandaDetector

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

public class BufferedPandaDetector extends DetectorBase implements BufferedDetector
See Also:
  • Constructor Details

    • BufferedPandaDetector

      public BufferedPandaDetector()
  • Method Details

    • getPandaDetector

      public PandaDetector getPandaDetector()
    • setPandaDetector

      public void setPandaDetector(PandaDetector pandaDetector)
    • 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
    • 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 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.

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

      public void clearMemory() throws DeviceException
      Description copied from interface: BufferedDetector
      Clears the detector memory
      Specified by:
      clearMemory in interface BufferedDetector
      Throws:
      DeviceException
    • 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
    • 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:
    • 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
    • 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
    • isContinuousMode

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

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

      public ContinuousParameters getContinuousParameters() throws DeviceException
      Specified by:
      getContinuousParameters in interface BufferedDetector
      Returns:
      ContinuousParameters
      Throws:
      DeviceException
    • getNumberFrames

      public int getNumberFrames() throws DeviceException
      Return current line repetition number in the sequence table. We assume that this corresponds to number of frames captured by Panda and available for readback via Socket or Hdf file (once data has been flushed to disc etc).
      Specified by:
      getNumberFrames in interface BufferedDetector
      Returns:
      number of frames of data in memory which have been collected
      Throws:
      DeviceException
    • transformData

      public double[][] transformData(double[][] dataValues)
    • 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
    • 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
    • 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
    • setMaximumReadFrames

      public void setMaximumReadFrames(int maximumReadFrames)