Package gda.device.scannable
Class MonitorZebraAndMoveScannable
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.MonitorZebraAndMoveScannable
- All Implemented Interfaces:
Device,Scannable,Configurable,Findable,gda.observable.IObservable
Class that monitors the number of captured pulses on Zebra and moves a scannable to positions after
certain numbers of spectra have been captured.
Set the scannable to be moved using
Add position to move scannable to at end of a spectrum using
setScannableToMove(Scannable).addPositionForSpectrum(Integer, Object).The spectrum number - position Map is maintained in order of ascending spectrum number and has one position per spectrum. (i.e. adding a new position with same spectrum number as already in the map will overwrite it).
-
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, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPositionForSpectrum(Integer spectrum, Object position) Add a position to be moved to at end of a spectrum.voidCalled for every Scannable at the start of every scanintgetZebra()booleanisBusy()Check if the Scannable is moving/operating.voidsetNumReadoutsPerSpectrum(int numReadoutsPerSpectrum) voidsetPositionForSpectrumMap(SortedMap<Integer, Object> positionForSpectrumMap) voidsetScannableToMove(Scannable scannableToMove) voidsetTimeOutSeconds(int timeOutSeconds) voidvoidLoop over positionForSpectrumMap and for each entry wait for required number of spectra (pulses) to be captured on Zebra, then move the scannable to the requested position.Methods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toFormattedString, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, 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.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Constructor Details
-
MonitorZebraAndMoveScannable
public MonitorZebraAndMoveScannable()
-
-
Method Details
-
atScanLineStart
public void atScanLineStart()Description copied from class:ScannableBaseCalled for every Scannable at the start of every scan Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanLineStartin interfaceScannable- Overrides:
atScanLineStartin classScannableBase- See Also:
-
setNumReadoutsPerSpectrum
public void setNumReadoutsPerSpectrum(int numReadoutsPerSpectrum) -
startRunning
public void startRunning()Loop over positionForSpectrumMap and for each entry wait for required number of spectra (pulses) to be captured on Zebra, then move the scannable to the requested position. -
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
getScannableToMove
-
setScannableToMove
-
getPositionForSpectrumMap
-
setPositionForSpectrumMap
-
addPositionForSpectrum
Add a position to be moved to at end of a spectrum.- Parameters:
spectrum-position-
-
getZebra
-
setZebra
-
getTimeOutSeconds
public int getTimeOutSeconds() -
setTimeOutSeconds
public void setTimeOutSeconds(int timeOutSeconds)
-