Package gda.device.enumpositioner
Class EnumPositionerBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.enumpositioner.EnumPositionerBase
- All Implemented Interfaces:
Device,EnumPositioner,Scannable,Configurable,Findable,gda.observable.IObservable
- Direct Known Subclasses:
DummyValve,EditableEnumPositionerBase,EpicsAirBearingControl,EpicsCurrAmpQuadController,EpicsEnumPositioner,EpicsLimitBasedPositioner,EpicsPneumaticCallback,EpicsPositioner,EpicsQbpm,EpicsSimpleBinary,EpicsSimpleMbbinary,EpicsSimplePneumatic,EpicsSimplePositioner,EpicsValve,MapperBasedEnumPositionerBase,ME2Positioner,SamplePlateEnumPositioner,TfgChannelEnum,ZebraShutterPositioner
Base class for the EnumPositioner interface
-
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 TypeMethodDescriptionprotected voidaddPosition(String position) protected voidaddPositions(Collection<String> positions) checkPositionValid(Object position) 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.protected voidprotected booleancontainsPosition(String position) protected StringFormats the available positions into a list e.g ('pos1' 'pos2' 'pos3')protected intprotected StringgetPosition(int index) Get the current positioner status
This should also be made protected: see comment onsetPositionerStatus(EnumPositionerStatus)protected intgetPositionIndex(String position) String[]Returns an array of the positions which this device can be moved to.Returns a list of the positions which this device can be moved to.Returns the current statusbooleanisBusy()Check if the Scannable is moving/operating.booleanisInPos()Simple implementation that may not be reliable.
Devices with a PV that indicates whether the device is in position should use this instead.voidsetPositionerStatus(EnumPositionerStatus positionerStatus) Set the positioner statusprotected voidsetPositionsInternal(Collection<String> positions) Returns a string representation of the Scannable and its current position/value/statusMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, 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, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, waitWhileBusy
-
Constructor Details
-
EnumPositionerBase
public EnumPositionerBase()sets the OutputFormat
-
-
Method Details
-
getPositions
Description copied from interface:EnumPositionerReturns an array of the positions which this device can be moved to.- Specified by:
getPositionsin interfaceEnumPositioner- Returns:
- an array of positions
- Throws:
DeviceException
-
getPositionsList
Description copied from interface:EnumPositionerReturns a list of the positions which this device can be moved to.- Specified by:
getPositionsListin interfaceEnumPositioner- Returns:
- a list of positions
-
getPosition
-
containsPosition
-
getPositionIndex
-
getNumberOfPositions
protected int getNumberOfPositions() -
clearPositions
protected void clearPositions() -
setPositionsInternal
-
addPosition
-
addPositions
-
setPositionerStatus
Set the positioner statusIdeally, this function should be protected, but this causes runtime exceptions because of the interaction of three factors:
- Some of this class's subclasses reside in a different plugin (uk.ac.gda.epics)
- The run-time package of a class or interface is determined by the package name AND its class loader (see https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-5.html#jvms-5.3-300)
- In OSGi each plugin has a different class loader.
See DAQ-1598 and linked tickets, and also https://bugs.eclipse.org/bugs/show_bug.cgi?id=152568TODO: Make protected if/when we have a solution the above-mentioned issue.
- Parameters:
positionerStatus- The new value to set
-
getPositionerStatus
Get the current positioner status
This should also be made protected: see comment onsetPositionerStatus(EnumPositionerStatus)- Returns:
- Current status
-
getStatus
Description copied from interface:EnumPositionerReturns the current status- Specified by:
getStatusin interfaceEnumPositioner- Returns:
- the status
- Throws:
DeviceException
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Specified by:
isBusyin interfaceScannable- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
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 classScannableBase- Parameters:
position-- Returns:
- null if position is valid, or returns a description if not.
- See Also:
-
isInPos
Simple implementation that may not be reliable.
Devices with a PV that indicates whether the device is in position should use this instead.- Specified by:
isInPosin interfaceEnumPositioner- Throws:
DeviceException
-
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 classScannableBase- Returns:
- string as defined above
-
createFormattedListAcceptablePositions
Formats the available positions into a list e.g ('pos1' 'pos2' 'pos3')- Returns:
- formatted positions list
-