Class ConcurrentScan
- All Implemented Interfaces:
IConcurrentScanChild,NestableScan,Scan,ScanChild,Serializable
- Direct Known Subclasses:
AbstractContinuousScanLine,TestScan
Expect arguments in the following format:
scannable1 start stop step scannable2 [start] [[stop] step] scannable3 [start] [[stop] step]
The number of steps is calculated from scannable1.
For subsequent scannables: if only 'start' then they are moved only to that position. If no start value given then the current position will be used (so this scannable will not be moved, but will be included in any output from the scan.
If a step value given then the scannable will be moved each time
If a stop value is also given then this is treated as a nested scan containing one scannable. This scan will be run in full at each node of the main scan. If there are multiple nested scans then they are nested inside each other to create a multidimensional scan space (rasta scan).
If LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLY is set to true Scannables will be moved to
the next point in a scan while detectors from the current point are read out (e.g. if a scan contains motors and
detectors, the motors will be moved to the next point while the detectors are read out).
CAUTION: If this feature is enabled then all the detectors on the beamline must latch counts somewhere before
Detector.waitWhileBusy() returns so that Detector.readout() is not effected by any concurrent motor
or shutter movements.
More precisely, when moving to the next point, Scannables at each subsequent level are moved until a level which contains a detector is encountered. The scan command thread then waits until the detectors from the current point have read out completely and the resulting ScanDataPoint has been added to the pipeline before continuing to operate devices at the level containing the a detector. The scan command thread will also wait at the end of each line for the Detector readout to complete before calling the atScanEnd() hooks and starting the next line.
NOTE that as a consequence of using this feature, an exception thrown while reading out a detector won't be thrown in the main scan command thread until after the next point's 'motors' have moved.
Detectors must work as follows to take advantage of this feature:
Detector.collectData()should cause the hardware to start collecting immediately and as its interface says return immediately. If there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.-
Detector.waitWhileBusy()should return as soon as the exposure completes and it is safe to move motors. i.e. counts must be safely latched either in hardware or software before returning. -
Detector.readout()should block until the detector is ready to start collecting again. The value returned must not be effected by any concurrent motor or shutter movements.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gda.scan.ConcurrentScanChild
ConcurrentScanChild.PointPositionInLineNested classes/interfaces inherited from class gda.scan.ScanBase
ScanBase.ParentScanComponentNested classes/interfaces inherited from interface gda.scan.Scan
Scan.ScanStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe number of steps or movements (this dimension only)static final StringName of flag in Jython namespace which, if set to true, then this scan will return all the scannables to their initial positions at the end of this type of scanFields inherited from class gda.scan.ConcurrentScanChild
allChildScans, allScanObjects, detectorReadoutTask, scannableLevelsFields 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
ConstructorsModifierConstructorDescriptionprotectedFor inheriting classesConcurrentScan(Object[] args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected ScanDataPointvoidThe method in which the work of the scan is performed.protected voidendScan()This should be called by all scans when they have finished, including when an exception has been raised.intdefault implementation.intGets the number of points visited by this scanbooleanbooleanvoidsetReturnScannablesToOrginalPositions(boolean returnScannablesToOrginalPositions) voidsetSendUpdateEvents(boolean sendUpdateEvents) voidsetStatus(Scan.ScanStatus status) To allow nests of scans to share a common status with each other.Methods inherited from class gda.scan.ConcurrentScanChild
acquirePoint, cancelReadoutAndPublishCompletion, checkAllMovesComplete, generateDevicesToMoveByLevel, getAllChildScans, getAllDetectors, getAllScannables, getAllScanObjects, getChild, getCommand, getPointPositionInLine, getScannableLevels, isMustBeFinal, isReadoutConcurrent, isScannableActuallyToBeMoved, isScannableToBeMoved, readoutDetectorsAndPublish, reorderAllScanObjects, setAllChildScans, setAllDetectors, setAllScannables, setAllScanObjects, setChild, setCommand, setMustBeFinal, setPointPositionInLine, setScannableLevels, setTotalNumberOfPoints, setUp, waitForDetectorReadoutAndPublishCompletionMethods inherited from class gda.scan.ScanBase
callAtCommandFailureHooks, callDetectorsEndCollection, callScannablesAtScanEnd, callScannablesAtScanLineEnd, callScannablesAtScanLineStart, callScannablesAtScanStart, checkStartStopStep, checkThreadInterrupted, collectData, createScanDataPointPipeline, createScanDataPointPipeline, generateRandomName, getDataWriter, getDetectors, 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, reorderScannables, representThrowable, requestFinishEarly, resume, run, runScan, scanRunning, sendScanEvent, setChild, setDataWriter, setDetectors, setIsChild, setLineScanNeedsDoing, setNumberOfChildScans, setParent, setPositionCallableThreadPoolSize, setScanDataPointPipeline, setScanDataPointQueueLength, setScanIdentifierInScanDataPoint, setScannables, setScanNumber, setScanPlotSettings, setStatus, setStepId, shutdownScandataPipeline, signalScanComplete, signalScanStarted, sortArguments, waitIfPaused, wasScanExplicitlyHalted, wrappedExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.scan.IConcurrentScanChild
getTotalNumberOfPointsMethods inherited from interface gda.scan.Scan
getDataWriter, getDetectors, getName, getScanDataPointPipeline, getScanInformation, getScannables, getScanNumber, getScanPlotSettings, getStatus, getStepId, isChild, isFinishEarlyRequested, pause, prepareForCollection, requestFinishEarly, resume, run, runScan, setChild, setDataWriter, setDetectors, setIsChild, setScanDataPointPipeline, setScannables, setScanPlotSettings, setStepId
-
Field Details
-
RETURNTOSTARTINGPOSITION
Name of flag in Jython namespace which, if set to true, then this scan will return all the scannables to their initial positions at the end of this type of scan- See Also:
-
numberSteps
protected int numberStepsThe number of steps or movements (this dimension only)
-
-
Constructor Details
-
ConcurrentScan
protected ConcurrentScan()For inheriting classes -
ConcurrentScan
Constructor.- Parameters:
args- Object[]- Throws:
IllegalArgumentException
-
-
Method Details
-
reportDevicesByLevel
-
doCollection
Description copied from interface:ScanThe method in which the work of the scan is performed. This method assumes that the data handler has already been created and the baton claimed.- Specified by:
doCollectionin interfaceScan- Specified by:
doCollectionin classScanBase- Throws:
Exception
-
createScanDataPoint
- Overrides:
createScanDataPointin classScanBase- Throws:
DeviceException
-
callAtPointStartHooks
- Throws:
DeviceException
-
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
-
getNumberPoints
public int getNumberPoints()Gets the number of points visited by this scan- Returns:
- the number of points in visited by this scan
-
getUserListedScannablesToScan
- Returns:
- List of scannables to be scanned in the order presented to the constructor
-
getUserListedScannables
- Returns:
- List of scannables in the order presented to the constructor
-
getDimension
public int getDimension()Description copied from class:ScanBasedefault implementation. Classes that derive from ScanBase which want to support the reporting of scan dimensions -@see getDimensions need to override this method- Specified by:
getDimensionin interfaceScan- Overrides:
getDimensionin classScanBase- Returns:
- the number of points of this scan object - the whole scan execution can be a hierarchy of parent scan objects and layers of child scan objects
- See Also:
-
isReturnScannablesToOrginalPositions
public boolean isReturnScannablesToOrginalPositions() -
setReturnScannablesToOrginalPositions
public void setReturnScannablesToOrginalPositions(boolean returnScannablesToOrginalPositions) -
isSendUpdateEvents
public boolean isSendUpdateEvents() -
setSendUpdateEvents
public void setSendUpdateEvents(boolean sendUpdateEvents) -
setStatus
To allow nests of scans to share a common status with each other.- Parameters:
status-
-