Package gda.scan

Class DetectorReadout

java.lang.Object
gda.scan.DetectorReadout
All Implemented Interfaces:
Runnable

public abstract class DetectorReadout extends Object implements Runnable
Runnable that can be used to collect detector data in a background thread. It monitors the number of frames of detector data available using getNumAvailableFrames(), and when enough frames for a new spectrum are available, it collects the spectrum data and writes it to the Nexus file using collectData(). Refactored from inner class in TurboXasScan.
  • Constructor Details

    • DetectorReadout

      public DetectorReadout()
  • Method Details

    • getNumAvailableFrames

      public abstract int getNumAvailableFrames() throws Exception
      Return the highest frame number common to all detectors to be read out
      Throws:
      Exception
    • collectData

      public abstract void collectData() throws Exception
      Collect data from all the detectors to be read out
      Throws:
      Exception
    • detectorsAreBusy

      public abstract boolean detectorsAreBusy() throws Exception
      Throws:
      Exception
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • waitForFrame

      public void waitForFrame(int frameNumber, double maxWaitTimeSecs) throws InterruptedException
      Wait up to maxWaitTime seconds for frameNumber frames of data to be collected.
      Parameters:
      frameNumber -
      maxWaitTime -
      Throws:
      InterruptedException
    • waitForAllSpectra

      public void waitForAllSpectra(double maxWaitTimeSecs) throws InterruptedException
      Wait until all spectra have been collected.
      Throws:
      InterruptedException
    • getNumSpectraCollected

      public int getNumSpectraCollected()
    • getLastFrameRead

      public int getLastFrameRead()
    • setLastFrameRead

      public void setLastFrameRead(int lastFrameRead)
    • setTotalNumSpectraToCollect

      public void setTotalNumSpectraToCollect(int totalNumSpectraToCollect)
    • setNumFramesPerSpectrum

      public void setNumFramesPerSpectrum(int numFramesPerSpectrum)
    • collectionFinished

      public boolean collectionFinished()
    • getPollIntervalMillis

      public int getPollIntervalMillis()
    • setPollIntervalMillis

      public void setPollIntervalMillis(int pollIntervalMillis)
    • forceQuit

      public void forceQuit()
    • isForceQuit

      public boolean isForceQuit()