Package gda.scan
Class ConcurrentScanChild
java.lang.Object
gda.scan.ScanBase
gda.scan.ConcurrentScanChild
- All Implemented Interfaces:
IConcurrentScanChild,NestableScan,Scan,ScanChild,Serializable
- Direct Known Subclasses:
ConcurrentScan,ContinuousScan,EdeScan
Base class for scan classes which can act as a dimension in a multi-dimensional concurrentscan
- See Also:
-
Nested Class Summary
Nested ClassesNested 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 List<IConcurrentScanChild> protected List<IScanObject> protected FutureTask<Void> 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidacquirePoint(boolean start, boolean collectDetectors) Moves to the next step unless start is true, then moves to the start of the current (possibly child) scan.protected voidCancels readout and publish completion task.protected voidgenerateDevicesToMoveByLevel(SortedMap<Integer, Scannable[]> scannableLevels, List<Detector> detectors) getChild()protected final ConcurrentScanChild.PointPositionInLinebooleanbooleanprotected final booleanisScannableActuallyToBeMoved(Scannable scannable) protected IScanObjectisScannableToBeMoved(Scannable scannable) Asks if the given scannable is part of the array of scannables which this scan is to operate in its moveToStarts and moveBySteps methods.protected voidAsynchronously, readout detectors using parallel threads into ScanDataPoint and add to pipeline for possible completion and publishing.protected voidvoidsetAllChildScans(List<IConcurrentScanChild> allChildScans) voidsetAllDetectors(List<Detector> allDetectors) voidsetAllScannables(List<Scannable> allScannables) voidsetAllScanObjects(List<IScanObject> allScanObjects) voidsetChild(IConcurrentScanChild child) voidsetCommand(String command) voidsetMustBeFinal(boolean mustBeFinal) protected final voidsetPointPositionInLine(ConcurrentScanChild.PointPositionInLine pointPositionInLine) voidsetScannableLevels(SortedMap<Integer, Scannable[]> scannableLevels) voidsetStatus(Scan.ScanStatus status) To allow nests of scans to share a common status with each other.voidsetTotalNumberOfPoints(int totalNumberOfPoints) Enables parent scans, when creating the list of nested scans, to tell child scans the totalnumber of points in the overall multi-dimensional scanprotected voidsetUp()This should be called by all scans during their constructor.voidBlocks while detectors are readout and point is added to pipeline.Methods inherited from class gda.scan.ScanBase
callAtCommandFailureHooks, callDetectorsEndCollection, callScannablesAtScanEnd, callScannablesAtScanLineEnd, callScannablesAtScanLineStart, callScannablesAtScanStart, checkStartStopStep, checkThreadInterrupted, collectData, createScanDataPoint, createScanDataPointPipeline, createScanDataPointPipeline, doCollection, endScan, generateRandomName, 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, 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
doCollection, getDataWriter, getDetectors, getDimension, 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
-
scannableLevels
-
allScanObjects
-
allChildScans
-
detectorReadoutTask
-
-
Constructor Details
-
ConcurrentScanChild
public ConcurrentScanChild()
-
-
Method Details
-
getPointPositionInLine
-
setPointPositionInLine
protected final void setPointPositionInLine(ConcurrentScanChild.PointPositionInLine pointPositionInLine) -
isReadoutConcurrent
public boolean isReadoutConcurrent() -
getChild
-
setChild
- Specified by:
setChildin interfaceIConcurrentScanChild- Parameters:
child-
-
getScannableLevels
- Specified by:
getScannableLevelsin interfaceIConcurrentScanChild- Returns:
- Returns the scannableLevels.
-
setScannableLevels
- Specified by:
setScannableLevelsin interfaceIConcurrentScanChild- Parameters:
scannableLevels- The scannableLevels to set.
-
getAllScanObjects
- Specified by:
getAllScanObjectsin interfaceIConcurrentScanChild- Returns:
- Returns the allScanObjects.
-
setAllScanObjects
- Specified by:
setAllScanObjectsin interfaceIConcurrentScanChild- Parameters:
allScanObjects- The allScanObjects to set.
-
getAllChildScans
- Specified by:
getAllChildScansin interfaceIConcurrentScanChild- Returns:
- Returns the allChildScans.
-
setAllChildScans
- Specified by:
setAllChildScansin interfaceIConcurrentScanChild- Parameters:
allChildScans- The allChildScans to set.
-
getAllScannables
- Specified by:
getAllScannablesin interfaceIConcurrentScanChild- Returns:
- Returns the allScannables.
-
setAllScannables
- Specified by:
setAllScannablesin interfaceIConcurrentScanChild- Parameters:
allScannables- The allScannables to set.
-
getAllDetectors
- Specified by:
getAllDetectorsin interfaceIConcurrentScanChild- Returns:
- Returns the allDetectors.
-
setAllDetectors
- Specified by:
setAllDetectorsin interfaceIConcurrentScanChild- Parameters:
allDetectors- The allDetectors to set.
-
getCommand
- Specified by:
getCommandin interfaceIConcurrentScanChild- Returns:
- Returns the command.
-
setCommand
- Specified by:
setCommandin interfaceIConcurrentScanChild
-
setMustBeFinal
public void setMustBeFinal(boolean mustBeFinal) -
isMustBeFinal
public boolean isMustBeFinal()- Specified by:
isMustBeFinalin interfaceIConcurrentScanChild- Returns:
- true if the type of scan must tbe the innermost dimension of a set of nested scans (a multi-dimensional scan)
-
setTotalNumberOfPoints
public void setTotalNumberOfPoints(int totalNumberOfPoints) Description copied from interface:IConcurrentScanChildEnables parent scans, when creating the list of nested scans, to tell child scans the totalnumber of points in the overall multi-dimensional scan- Specified by:
setTotalNumberOfPointsin interfaceIConcurrentScanChild- Parameters:
totalNumberOfPoints-
-
acquirePoint
Moves to the next step unless start is true, then moves to the start of the current (possibly child) scan.- Throws:
Exception
-
generateDevicesToMoveByLevel
-
isScannableToBeMoved
Asks if the given scannable is part of the array of scannables which this scan is to operate in its moveToStarts and moveBySteps methods. If true returns the ScanObject else returns null.- Parameters:
scannable-- Returns:
- the ScanObject
-
isScannableActuallyToBeMoved
-
checkAllMovesComplete
- Throws:
Exception
-
setUp
protected void setUp()Description copied from class:ScanBaseThis should be called by all scans during their constructor. In this method the objects to scan over and the detectors to use are identified, and the data handlers objects are created and setup. -
reorderAllScanObjects
protected void reorderAllScanObjects() -
readoutDetectorsAndPublish
Asynchronously, readout detectors using parallel threads into ScanDataPoint and add to pipeline for possible completion and publishing. CallwaitForDetectorReadoutAndPublishCompletion()to wait for this task to complete, orcancelReadoutAndPublishCompletion()to cancel and interrupt it.If the property
LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLYis its default false value then simply block while reading out each detector in series and then adding the ScanDataPoint to the pipeline.- Overrides:
readoutDetectorsAndPublishin classScanBase- Parameters:
point-- Throws:
Exception
-
waitForDetectorReadoutAndPublishCompletion
public void waitForDetectorReadoutAndPublishCompletion() throws InterruptedException, ExecutionExceptionBlocks while detectors are readout and point is added to pipeline. Throws an exception if one was thrown while reading out the detectors or adding the point to the pipeline.- Overrides:
waitForDetectorReadoutAndPublishCompletionin classScanBase- Throws:
InterruptedExceptionExecutionException
-
cancelReadoutAndPublishCompletion
protected void cancelReadoutAndPublishCompletion()Cancels readout and publish completion task.- Overrides:
cancelReadoutAndPublishCompletionin classScanBase
-
setStatus
To allow nests of scans to share a common status with each other.- Parameters:
status-
-