Class CoordinatedScannableGroup
- All Implemented Interfaces:
Device,Scannable,IScannableGroup,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver
- Direct Known Subclasses:
DeferredScannableGroup
Note that even though the group may be in the internal state TARGETING, it is still possible that some of the components may have been asked to move externally, and that they may be moving, i.e. the group performs no locking.
Members passed in to be added to the group will be wrapped in one of CoordinatedElementScannableMotionUnits, CoordinatedElementScannableMotion or CoordinatedElementScannable determined by the interface they support. This means that any methods not in one of these interfaces will not be accessible.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected gda.device.scannable.scannablegroup.CoordinatedParentScannableComponentFields 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 TypeMethodDescription__repr__()Jython method to return a string representation of the object__str__()Jython method to return string description of the objectvoidaddChildToMove(gda.device.scannable.scannablegroup.ICoordinatedChildScannable element) voidaddGroupMember(Scannable groupMember) Adds a scannable to this group.voidaddPositionValidator(String name, PositionValidator validator) Validators will be tested in the order that they have been added.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.voidCalled by both the pos and scan commands at the start of each subsequent level move only on Scannables that will be moved as part that level's movement.protected StringcheckAdditionalPositionValidators(Object externalPos) checkPositionValid(Object pos) This default behaviour should be extended by most subclasses! This default behaviour should be extended by most subclasses! Tests if the given object is meaningful to this Scannable and so could be used by one of the move commands.getPositionWhileMovingContinuousely(gda.device.scannable.scannablegroup.ICoordinatedScannableGroupChildScannable childScannable) booleanisBusy()Check if the Scannable is moving/operating.booleanvoidsetAdditionalPositionValidators(LinkedHashMap<String, PositionValidator> additionalPositionValidators) Set the additional position validators.voidsetChildTarget(gda.device.scannable.scannablegroup.ICoordinatedChildScannable element, Object position) voidsetGroupMembers(List<Scannable> groupMembers) Sets the group members that make up this scannable group.protected gda.device.scannable.scannablegroup.ICoordinatedChildScannablewrapScannable(Scannable delegate) Wraps a scannable with an ICoordinatedScannableElement to mediates access to the 'real' delegate scannable.Methods inherited from class gda.device.scannable.scannablegroup.ScannableGroup
__getattr__, addGroupMember, atLevelEnd, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, configure, extractPositionsFromObject, getExtraNames, getGroupMember, getGroupMemberNames, getGroupMembers, getGroupMembersAsArray, getInputNames, getOutputFormat, getPosition, getUnits, isDemandAllScannablePositions, removeGroupMemberByIndex, removeGroupMemberByScannable, setDemandAllScannablePositions, setExtraNames, setGroupMembersWithArray, setGroupMembersWithList, setInputNames, stop, toFormattedString, toString, update, waitWhileBusyMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, externalToInternal, getLevel, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, validateScannable, valueUnavailableString, 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
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, deleteIObserversMethods inherited from interface gda.device.Scannable
atLevelEnd, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString, waitWhileBusy
-
Field Details
-
coordinatedScannableComponent
protected gda.device.scannable.scannablegroup.CoordinatedParentScannableComponent coordinatedScannableComponent
-
-
Constructor Details
-
CoordinatedScannableGroup
public CoordinatedScannableGroup()Create the group. Members must be added for the group to do anything useful.
-
-
Method Details
-
checkPositionValid
Description copied from class:ScannableBaseThis default behaviour should be extended by most subclasses! Tests if the given object is meaningful to this Scannable and so could be used by one of the move commands. May check limits and other things too. This is the method called by scans on all points before the scan is run.- Specified by:
checkPositionValidin interfaceScannable- Overrides:
checkPositionValidin classScannableGroup- Parameters:
pos-- Returns:
- null if position is valid, or returns a description if not.
- Throws:
DeviceException- See Also:
-
setGroupMembers
Description copied from class:ScannableGroupSets the group members that make up this scannable group. If this ScannableGroup is configured, sets it to unconfigured, to allow all the scannables to be configured by call this.configure()- Specified by:
setGroupMembersin interfaceIScannableGroup- Overrides:
setGroupMembersin classScannableGroup- Parameters:
groupMembers- the group members- Throws:
FactoryException
-
addGroupMember
Description copied from class:ScannableGroupAdds a scannable to this group. This will not add a Scannable if it is already included Will configure the Scannable if the ScannableGroup is already configured- Specified by:
addGroupMemberin interfaceIScannableGroup- Overrides:
addGroupMemberin classScannableGroup- Parameters:
groupMember-- Throws:
FactoryException
-
wrapScannable
protected gda.device.scannable.scannablegroup.ICoordinatedChildScannable wrapScannable(Scannable delegate) Wraps a scannable with an ICoordinatedScannableElement to mediates access to the 'real' delegate scannable. coordinated moves. Note that only methods on ScannableMotionUnits, ScannableMotion or Scannable will be brought out.- Parameters:
delegate-- Returns:
- the wrapped scannable
-
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 classScannableGroup- Parameters:
position- Position to move to should have an element for each input field.- Throws:
DeviceException
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Specified by:
isBusyin interfaceScannable- Overrides:
isBusyin classScannableGroup- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
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 classScannableGroup- Throws:
DeviceException- See Also:
-
atLevelMoveStart
public void atLevelMoveStart()Description copied from class:ScannableBaseCalled by both the pos and scan commands at the start of each subsequent level move only on Scannables that will be moved as part that level's movement.For example "pos a 1 b 2 c 3", will, if a and b have the same level and c a higher level will result in:
This hook is used by CoordinatedMotionScannables. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.a.atLevelMoveStart() invalid input: '<'---- b.atLevelMoveStart() invalid input: '<'---- a.asynchronousMoveTo() b.asynchronousMoveTo() a.waitWhileBusy() b.waitWhileBusy() c.atLevelMoveStart() invalid input: '<'---- c.asynchronousMoveTo() c.waitWhileBusy()
- Specified by:
atLevelMoveStartin interfaceScannable- Overrides:
atLevelMoveStartin classScannableGroup- See Also:
-
addChildToMove
public void addChildToMove(gda.device.scannable.scannablegroup.ICoordinatedChildScannable element) -
isTargeting
public boolean isTargeting() -
setChildTarget
public void setChildTarget(gda.device.scannable.scannablegroup.ICoordinatedChildScannable element, Object position) throws DeviceException - Throws:
DeviceException
-
getPositionWhileMovingContinuousely
public Object getPositionWhileMovingContinuousely(gda.device.scannable.scannablegroup.ICoordinatedScannableGroupChildScannable childScannable) throws DeviceException - Throws:
DeviceException
-
checkAdditionalPositionValidators
- Throws:
DeviceException
-
setAdditionalPositionValidators
public void setAdditionalPositionValidators(LinkedHashMap<String, PositionValidator> additionalPositionValidators) Set the additional position validators. An ordered map is used so that the validators can be compared in the same order each time. NOTE: Spring uses ordered maps by default when injecting maps.- Parameters:
additionalPositionValidators-
-
addPositionValidator
Validators will be tested in the order that they have been added.- Parameters:
name-validator-
-
getAdditionalPositionValidators
-
__str__
Description copied from class:ScannableBaseJython method to return string description of the object- Overrides:
__str__in classScannableBase- Returns:
- the result of the toString method
-
__repr__
Description copied from class:ScannableBaseJython method to return a string representation of the object- Overrides:
__repr__in classScannableBase- Returns:
- the result of the toString method
-