Package gda.device.detector
Class DetectorMonitorDataProvider
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorMonitorDataProvider
- All Implemented Interfaces:
DetectorMonitorDataProviderInterface,Device,Scannable,Configurable,Findable,gda.observable.IObservable
@ServiceInterface(DetectorMonitorDataProviderInterface.class)
public class DetectorMonitorDataProvider
extends ScannableBase
implements DetectorMonitorDataProviderInterface
Class to to provide data used for a detector rate view.
An instance of this class runs on the server; calls are made to Any Xspress detector passed to collectData will be set to return only the FF value and has file writing switched off;
Any Tfg scaler scannables do not correct for dark current, and will not show time frame length.
These settings are restored at end of collectData.
Set This class can also be used in a scan to stop detector rate collection :
the
collectData(List), passing in a list of
scannables. This returns a list of positions for each of the scannables and detectors by performing the same sequence
of calls to atScanStart, prepareForCollection, etc. as would normally be done during a step scan.
setCollectionAllowed(boolean) to False to prevent collection of data. This can be used to be sure that no data is
being collected by the detector rate view whilst a scan is running.
atScanStart() sets the collection flag allowed flag to false, and blocks until the current collection has finished.-
Field Summary
Fields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIObserver(gda.observable.IObserver observer) voidasynchronousMoveTo(Object position) Trigger a move/operation and return immediately.voidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.voidReset collectionAllowed flagvoidSet collectionAllowed flag to false and block until current collection has finished.collectData(List<String> allScannableNames) voiddeleteIObserver(gda.observable.IObserver observer) voidbooleanbooleandoublegetOutputFields(List<String> scannableNames) booleanisBusy()Check if the Scannable is moving/operating.boolean[Consider abstract] Read the position in its internal (user) representation.voidsetCollectionAllowed(boolean collectionAllowed) voidsetCollectionTime(double collectionTime) voidsetNumberFormat(Map<String, String> numberFormat) Set a map containing the output format to be used when displaying quanties in the GUI.voidstop()Stop the current move/operation.voidWait for current collection to finish.Methods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toFormattedString, toString, validateScannable, valueUnavailableString, waitWhileBusyMethods inherited from class gda.device.DeviceBase
close, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
configure, isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.device.Scannable
atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Constructor Details
-
DetectorMonitorDataProvider
public DetectorMonitorDataProvider()
-
-
Method Details
-
getCollectionTime
public double getCollectionTime()- Specified by:
getCollectionTimein interfaceDetectorMonitorDataProviderInterface
-
setCollectionTime
public void setCollectionTime(double collectionTime) - Specified by:
setCollectionTimein interfaceDetectorMonitorDataProviderInterface
-
isScriptOrScanIsRunning
public boolean isScriptOrScanIsRunning()- Specified by:
isScriptOrScanIsRunningin interfaceDetectorMonitorDataProviderInterface
-
collectData
public List<String> collectData(List<String> allScannableNames) throws DeviceException, InterruptedException - Specified by:
collectDatain interfaceDetectorMonitorDataProviderInterface- Throws:
DeviceExceptionInterruptedException
-
getOutputFields
- Specified by:
getOutputFieldsin interfaceDetectorMonitorDataProviderInterface
-
addIObserver
public void addIObserver(gda.observable.IObserver observer) - Specified by:
addIObserverin interfacegda.observable.IObservable- Overrides:
addIObserverin classDeviceBase
-
deleteIObserver
public void deleteIObserver(gda.observable.IObserver observer) - Specified by:
deleteIObserverin interfacegda.observable.IObservable- Overrides:
deleteIObserverin classDeviceBase
-
deleteIObservers
public void deleteIObservers()- Specified by:
deleteIObserversin interfacegda.observable.IObservable- Overrides:
deleteIObserversin classDeviceBase
-
getCollectionAllowed
public boolean getCollectionAllowed()- Specified by:
getCollectionAllowedin interfaceDetectorMonitorDataProviderInterface
-
setCollectionAllowed
public void setCollectionAllowed(boolean collectionAllowed) - Specified by:
setCollectionAllowedin interfaceDetectorMonitorDataProviderInterface
-
setNumberFormat
Description copied from interface:DetectorMonitorDataProviderInterfaceSet a map containing the output format to be used when displaying quanties in the GUI. (i.e. key=field name in the 'extra name' of a scannable, value=output format to use)- Specified by:
setNumberFormatin interfaceDetectorMonitorDataProviderInterface- Parameters:
numberFormat-
-
asynchronousMoveTo
Description copied from class:ScannableBaseTrigger a move/operation and return immediately. Implementations of this method should be non-blocking to allow concurrent motion; the isBusy method will be used to determine when the move has completed. Converts the external (user) position to an internal position and passes this to rawAsynchronousMoveTo.- Specified by:
asynchronousMoveToin interfaceScannable- Overrides:
asynchronousMoveToin classScannableBase- Parameters:
position- Position to move to should have an element for each input field.
-
rawGetPosition
Description copied from class:ScannableBase[Consider abstract] Read the position in its internal (user) representation.- Overrides:
rawGetPositionin classScannableBase- Returns:
- the value represented by this Scannable
- Throws:
DeviceException- See Also:
-
atScanStart
public void atScanStart()Set collectionAllowed flag to false and block until current collection has finished.- Specified by:
atScanStartin interfaceScannable- Overrides:
atScanStartin classScannableBase- See Also:
-
atScanEnd
public void atScanEnd()Reset collectionAllowed flag- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- See Also:
-
atCommandFailure
Description copied from class:ScannableBaseHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then onlyScannable.stop()will be called by the Scan or pos command.Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
- Specified by:
atCommandFailurein interfaceScannable- Overrides:
atCommandFailurein classScannableBase- Throws:
DeviceException- See Also:
-
isBusy
public boolean isBusy()Description copied from interface:ScannableCheck if the Scannable is moving/operating. -
stop
public void stop()Description copied from class:ScannableBaseStop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
stopin interfaceScannable- Overrides:
stopin classScannableBase- See Also:
-
waitWhileBusy
public void waitWhileBusy()Wait for current collection to finish.- Specified by:
waitWhileBusyin interfaceScannable- Overrides:
waitWhileBusyin classScannableBase
-
getCollectionIsRunning
public boolean getCollectionIsRunning()- Specified by:
getCollectionIsRunningin interfaceDetectorMonitorDataProviderInterface- Returns:
- true if collection of detector values is currently taking place.
i.e.
collectData(List)is currently in progress.
-