Package gda.scan
Class DetectorReadout
java.lang.Object
gda.scan.DetectorReadout
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidCollect data from all the detectors to be read outbooleanabstract booleanvoidintabstract intReturn the highest frame number common to all detectors to be read outintintbooleanvoidrun()voidsetLastFrameRead(int lastFrameRead) voidsetNumFramesPerSpectrum(int numFramesPerSpectrum) voidsetPollIntervalMillis(int pollIntervalMillis) voidsetTotalNumSpectraToCollect(int totalNumSpectraToCollect) voidwaitForAllSpectra(double maxWaitTimeSecs) Wait until all spectra have been collected.voidwaitForFrame(int frameNumber, double maxWaitTimeSecs) Wait up to maxWaitTime seconds for frameNumber frames of data to be collected.
-
Constructor Details
-
DetectorReadout
public DetectorReadout()
-
-
Method Details
-
getNumAvailableFrames
Return the highest frame number common to all detectors to be read out- Throws:
Exception
-
collectData
Collect data from all the detectors to be read out- Throws:
Exception
-
detectorsAreBusy
- Throws:
Exception
-
run
public void run() -
waitForFrame
Wait up to maxWaitTime seconds for frameNumber frames of data to be collected.- Parameters:
frameNumber-maxWaitTime-- Throws:
InterruptedException
-
waitForAllSpectra
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()
-