Package uk.ac.gda.component.model.core
Class AssemblyBase
- All Implemented Interfaces:
Device,Scannable,IScannableGroup,IScannableGroupNamed,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver,Assembly,CoordinatesMove,IndexMove,IndexPositioner
- Direct Known Subclasses:
AbstractPlateLoader,EndStationBase,GonioBase
Implementation of IScannableGroupNamed which manages names 'lightweight', i.e. only keeping in step with groupMembers after configuration and less tightly
coupled: Until configure() is called, Names are kept simply as a list, rather than using the Finder to add the Scannable After configuration
-
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
ConstructorsConstructorDescriptionAssemblyBase(String name) AssemblyBase(String name, Scannable[] groupMembers) AssemblyBase(String name, Scannable[] groupMembers, String[] groupMembersNames) AssemblyBase(String name, String[] groupMembersNames) AssemblyBase(String name, List<Scannable> groupMembers) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionRule(Scannable scannable, ActionRule rule, Device... devices) voidaddDefinedCoordinates(int index, Coordinates coordinates) voidaddDefinedCoordinates(String name, int index, Coordinates coordinates) voidvoidaddGroupMemberByName(String name) voidasynchronousMoveTo(Object position) Trigger a move/operation and return immediately.voidTrigger a move/operation and return immediately.voidasynchronousMoveToDefined(String coordinates) Trigger a move/operation to a pre-defined and indexed position and return immediately.voidasynchronousMoveToIndex(int index) booleancheckActionRules(Scannable scannable, Coordinates coords) booleanprotected booleancheckAssemblies(Set<Assembly> structure) booleancheckMovementValid(Coordinates start, Coordinates target) voidvoidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.protected CoordinatesconvertPositionArrayToCoordinates(Object position) voiddispose()voidgetAdapter(Class<? extends Assembly> adapter) Returns the current predefined coordinates holder.Returns an array of the names of registered defined coordinatesgetGroupMemberByName(String name) booleanTests if the coordinates are at (or if appropriate, close to) the values in coordinatesToTest.booleanisAt(Coordinates coord) booleanisAtIndex(int indexToTest) booleanbooleanTests if the underlying positioner is expected to only allow movements to the indexed positions.protected booleanbooleanisScannableAt(Position posn) protected booleanvoidTrigger a move/operation and block until completion.voidmoveToDefined(String coordinatesName) Trigger a move/operation and block until completion.voidmoveToIndex(int index) protected voidvoidremoveApprover(ActionApprover approver) voidremoveGroupMemberName(String name) voidsetDefinedCoordinates(List<Coordinates> coords) voidsetEnabled(boolean enabled) voidsetGroupMembersNamesWithArray(String[] scannableNames, boolean toConfigure) voidsetGroupMembersNamesWithList(List<String> scannableNames, boolean toConfigure) protected AssemblysetVisited(boolean isVisited) Returns a string representation of the Scannable and its current position/value/statustoString()updateCoordinates(Coordinates coord) Methods inherited from class gda.device.scannable.scannablegroup.ScannableGroupNamed
addGroupMember, getGroupMembersNamesAsArray, setGroupMembersNames, setGroupMembersNamesWithArrayMethods inherited from class gda.device.scannable.scannablegroup.ScannableGroup
__getattr__, addGroupMember, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, extractPositionsFromObject, getExtraNames, getGroupMember, getGroupMemberNames, getGroupMembers, getGroupMembersAsArray, getInputNames, getOutputFormat, getPosition, getUnits, isBusy, isDemandAllScannablePositions, removeGroupMemberByIndex, removeGroupMemberByScannable, setDemandAllScannablePositions, setExtraNames, setGroupMembers, setGroupMembersWithArray, setGroupMembersWithList, setInputNames, stop, update, waitWhileBusyMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, 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
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.scannablegroup.IScannableGroup
addGroupMember, addGroupMember, getGroupMemberNames, getGroupMembers, getGroupMembersAsArray, getUnits, removeGroupMemberByIndex, removeGroupMemberByScannable, setGroupMembers, setGroupMembersWithArray, setGroupMembersWithListMethods inherited from interface gda.device.scannable.scannablegroup.IScannableGroupNamed
getGroupMembersNamesAsArray, setGroupMembersNames, setGroupMembersNamesWithArrayMethods inherited from interface gda.device.Scannable
atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, waitWhileBusy
-
Constructor Details
-
AssemblyBase
public AssemblyBase() -
AssemblyBase
- Throws:
FactoryException
-
AssemblyBase
- Throws:
FactoryException
-
AssemblyBase
public AssemblyBase(String name, List<Scannable> groupMembers, List<String> groupMemberNames) throws FactoryException - Throws:
FactoryException
-
AssemblyBase
-
AssemblyBase
- Throws:
FactoryException
-
AssemblyBase
public AssemblyBase(String name, Scannable[] groupMembers, String[] groupMembersNames) throws FactoryException - Throws:
FactoryException
-
-
Method Details
-
addActionRule
public void addActionRule(Scannable scannable, ActionRule rule, Device... devices) throws DeviceException - Specified by:
addActionRulein interfaceAssembly- Throws:
DeviceException
-
addDefinedCoordinates
- Throws:
DeviceException
-
addDefinedCoordinates
public void addDefinedCoordinates(String name, int index, Coordinates coordinates) throws DeviceException - Specified by:
addDefinedCoordinatesin interfaceIndexPositioner- Throws:
DeviceException
-
addDevice
-
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
-
asynchronousMoveToCoordinates
Description copied from interface:CoordinatesMoveTrigger 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.- Specified by:
asynchronousMoveToCoordinatesin interfaceCoordinatesMove- Parameters:
c- Coordinates to move to- Throws:
DeviceException
-
asynchronousMoveToDefined
Description copied from interface:IndexMoveTrigger a move/operation to a pre-defined and indexed position and return immediately. Implementations of this method should be non-blocking to allow concurrent motion;- Specified by:
asynchronousMoveToDefinedin interfaceIndexMove- Parameters:
coordinates- Coordinates to move to- Throws:
DeviceException
-
asynchronousMoveToIndex
- Specified by:
asynchronousMoveToIndexin interfaceIndexMove- Throws:
DeviceException
-
checkActionRules
- Throws:
DeviceException
-
checkAssemblies
public boolean checkAssemblies()- Specified by:
checkAssembliesin interfaceAssembly
-
checkAssemblies
-
checkMovementValid
- Specified by:
checkMovementValidin interfaceCoordinatesMove
-
clearConfiguration
- Specified by:
clearConfigurationin interfaceAssembly- Throws:
DeviceExceptionFactoryException
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classScannableGroup- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
convertPositionArrayToCoordinates
-
dispose
public void dispose() -
disposeSubAssemblies
public void disposeSubAssemblies() -
getAdapter
- Specified by:
getAdapterin interfaceAssembly
-
getAllDevices
- Specified by:
getAllDevicesin interfaceAssembly
-
getCurrentCoordinates
Description copied from interface:CoordinatesMoveReturns the current predefined coordinates holder.- Specified by:
getCurrentCoordinatesin interfaceCoordinatesMove- Returns:
- Current Coordinate object with a position element for each scannable dimension.
- Throws:
DeviceException
-
getDefinedCoordinates
- Specified by:
getDefinedCoordinatesin interfaceCoordinatesMove
-
getDefinedCoordinatesNames
Description copied from interface:IndexMoveReturns an array of the names of registered defined coordinates- Specified by:
getDefinedCoordinatesNamesin interfaceIndexMove- Returns:
- an array of defined coordinates names
-
getDevice
- Specified by:
getDevicein interfaceAssembly- Throws:
DeviceException
-
getSubAssemblies
- Specified by:
getSubAssembliesin interfaceAssembly
-
isAt
- Throws:
DeviceException
-
isAt
Description copied from interface:IndexMoveTests if the coordinates are at (or if appropriate, close to) the values in coordinatesToTest.- Specified by:
isAtin interfaceIndexMove- Parameters:
coordinatesToTest- The position to compare the positioner's position to.- Returns:
- true if coordinates is at coordinatesToTest
- Throws:
DeviceException
-
isAtIndex
- Specified by:
isAtIndexin interfaceIndexMove- Throws:
DeviceException
-
isEnabled
public boolean isEnabled() -
isLockedToIndexPositions
public boolean isLockedToIndexPositions()Description copied from interface:IndexPositionerTests if the underlying positioner is expected to only allow movements to the indexed positions.- Specified by:
isLockedToIndexPositionsin interfaceIndexPositioner- Returns:
- true if implementer is locked to indexed positions only
-
isScannable
-
isScannableAt
- Throws:
DeviceException
-
isVisited
protected boolean isVisited() -
moveToCoordinates
Description copied from interface:CoordinatesMoveTrigger a move/operation and block until completion.- Specified by:
moveToCoordinatesin interfaceCoordinatesMove- Throws:
DeviceException
-
moveToDefined
Description copied from interface:IndexMoveTrigger a move/operation and block until completion.- Specified by:
moveToDefinedin interfaceIndexMove- Parameters:
coordinatesName- Coordinates to move to- Throws:
DeviceException
-
moveToIndex
- Specified by:
moveToIndexin interfaceIndexMove- Throws:
DeviceException
-
raiseVeto
- Throws:
DeviceException
-
removeApprover
-
setDefinedCoordinates
- Specified by:
setDefinedCoordinatesin interfaceIndexPositioner- Throws:
DeviceException
-
setEnabled
public void setEnabled(boolean enabled) -
setVisited
-
toFormattedString
Description copied from interface:ScannableReturns a string representation of the Scannable and its current position/value/statusTypically should return:
name : position
or for detectors, name : status
If the position/status cannot be determined, the function should return
Scannable.VALUE_UNAVAILABLEin its place.- Specified by:
toFormattedStringin interfaceScannable- Overrides:
toFormattedStringin classScannableGroup- Returns:
- string as defined above
-
updateCoordinates
- Specified by:
updateCoordinatesin interfaceIndexPositioner- Throws:
DeviceException
-
getGroupMemberByName
- Specified by:
getGroupMemberByNamein interfaceIScannableGroupNamed- Overrides:
getGroupMemberByNamein classScannableGroupNamed- Throws:
DeviceException
-
getGroupMembersNames
- Specified by:
getGroupMembersNamesin interfaceIScannableGroupNamed- Overrides:
getGroupMembersNamesin classScannableGroupNamed
-
setGroupMembersNamesWithList
public void setGroupMembersNamesWithList(List<String> scannableNames, boolean toConfigure) throws FactoryException - Specified by:
setGroupMembersNamesWithListin interfaceIScannableGroupNamed- Overrides:
setGroupMembersNamesWithListin classScannableGroupNamed- Parameters:
scannableNames- - the names of the Scannables to add to the grouptoConfigure- - Should this configure itself after setting the names? As Assemblies keep light-weight, this would perform the actual Finding of the Scannables as well as configure all the members- Throws:
FactoryException- if configuring a Scannable throws this Exception
-
setGroupMembersNamesWithArray
public void setGroupMembersNamesWithArray(String[] scannableNames, boolean toConfigure) throws FactoryException - Specified by:
setGroupMembersNamesWithArrayin interfaceIScannableGroupNamed- Overrides:
setGroupMembersNamesWithArrayin classScannableGroupNamed- Parameters:
scannableNames- - the names of the Scannables to add to the grouptoConfigure- - Should this configure itself after setting the names? As Assemblies keep light-weight, this would perform the actual Finding of the Scannables as well as configure all the members- Throws:
FactoryException- if configuring a Scannable throws this Exception
-
removeGroupMemberName
- Specified by:
removeGroupMemberNamein interfaceIScannableGroupNamed- Overrides:
removeGroupMemberNamein classScannableGroupNamed- Throws:
DeviceException
-
addGroupMemberByName
- Specified by:
addGroupMemberByNamein interfaceIScannableGroupNamed- Overrides:
addGroupMemberByNamein classScannableGroupNamed- Throws:
FactoryException
-
toString
- Overrides:
toStringin classScannableGroup
-