Package gda.scan
Class AsynchronousTimeScan
java.lang.Object
gda.scan.ScanBase
gda.scan.AsynchronousTimeScan
- All Implemented Interfaces:
NestableScan,Scan,ScanChild,Serializable
An asynchronous timeScan that can be started collecting data and read out at intervals during continuous data
collection
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gda.scan.ScanBase
ScanBase.ParentScanComponentNested classes/interfaces inherited from interface gda.scan.Scan
Scan.ScanStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionfor observers to identify the relative time of the last data point from the start of the scan.Fields inherited from class gda.scan.ScanBase
allDetectors, allScannables, callCollectDataOnDetectors, child, command, currentPointCount, GDA_SCANBASE_FIRST_SCAN_NUMBER_FOR_TEST, GDA_SCANBASE_PRINT_TIMESTAMP_TO_TERMINAL, instrument, isChild, name, numberOfChildScans, parent, parentComponent, permissionLevel, scanDataPointPipeline, stepId, totalNumberOfPoints -
Constructor Summary
ConstructorsConstructorDescriptionAsynchronousTimeScan(Detector detector, double totalTime) Create an asynchronous timeScan that can be started collecting data and read out at intervals during continuous data collection -
Method Summary
Modifier and TypeMethodDescriptionvoidCollect the data asynchronously i.e.voidendScan()This should be called by all scans when they have finished, including when an exception has been raised.protected voidreadout()readout whatever pseudo-data the detector has to offer whilst it is continually collecting (might not be the raw data!)static voidCreate and run a scanprotected voidwaitUntil(long targetTime) Given a Java time in seconds, wait until that point and then return.Methods inherited from class gda.scan.ScanBase
callAtCommandFailureHooks, callDetectorsEndCollection, callScannablesAtScanEnd, callScannablesAtScanLineEnd, callScannablesAtScanLineStart, callScannablesAtScanStart, cancelReadoutAndPublishCompletion, checkStartStopStep, checkThreadInterrupted, collectData, createScanDataPoint, createScanDataPointPipeline, createScanDataPointPipeline, generateRandomName, getChild, getDataWriter, getDetectors, getDimension, getDimensions, getName, getNumberOfChildScans, getParent, getPositionCallableThreadPoolSize, getScanDataPointPipeline, getScanDataPointQueueLength, getScanInformation, getScannables, getScanNumber, getScanPlotSettings, getStatus, getStepId, getStepIds, getTotalNumberOfPoints, isChild, isFinishEarlyRequested, isLineScanNeedsDoing, notifyServer, notifyServer, numberOfScannablesThatCanProvidePositionCallables, pause, prepareDevicesForCollection, prepareForCollection, prepareScanForCollection, prepareScanNumber, prepareStaticVariables, readDevicesAndPublishScanDataPoint, readoutDetectorsAndPublish, reorderScannables, representThrowable, requestFinishEarly, resume, run, runScan, scanRunning, sendScanEvent, setChild, setDataWriter, setDetectors, setIsChild, setLineScanNeedsDoing, setNumberOfChildScans, setParent, setPositionCallableThreadPoolSize, setScanDataPointPipeline, setScanDataPointQueueLength, setScanIdentifierInScanDataPoint, setScannables, setScanNumber, setScanPlotSettings, setStatus, setStepId, setUp, shutdownScandataPipeline, signalScanComplete, signalScanStarted, sortArguments, waitForDetectorReadoutAndPublishCompletion, waitIfPaused, wasScanExplicitlyHalted, wrappedException
-
Field Details
-
asynchronousDetectors
-
relativeTime
for observers to identify the relative time of the last data point from the start of the scan. This is a DummyScannable object so that data handlers will work properly.
-
-
Constructor Details
-
AsynchronousTimeScan
Create an asynchronous timeScan that can be started collecting data and read out at intervals during continuous data collection- Parameters:
detector- the detector to be scannedtotalTime- total collect time in milliseconds
-
-
Method Details
-
doCollection
Collect the data asynchronously i.e. let the detector do all point iterations. In this case readout() will behave in an unusual way and will be detector specific, real data read out being handled by the detector itself- Specified by:
doCollectionin interfaceScan- Specified by:
doCollectionin classScanBase- Throws:
InterruptedExceptionDeviceException- See Also:
-
endScan
Description copied from class:ScanBaseThis should be called by all scans when they have finished, including when an exception has been raised.- Overrides:
endScanin classScanBase- Throws:
DeviceExceptionInterruptedException
-
readout
readout whatever pseudo-data the detector has to offer whilst it is continually collecting (might not be the raw data!)- Throws:
Exception
-
waitUntil
Given a Java time in seconds, wait until that point and then return. If that time has passed, then return immediately;- Parameters:
targetTime- time in milli-seconds- Throws:
InterruptedException
-
runScan
public static void runScan(Detector detector, double totalTime, double readoutinterval) throws InterruptedException, Exception Create and run a scan- Parameters:
detector- the detector object to be scannedtotalTime- total collect time in milli-secondsreadoutinterval- time after which pseudo-data is to be read out during continuous data collection in milli-seconds- Throws:
InterruptedExceptionException
-