Package gda.device.enumpositioner
Class DummyValve
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.enumpositioner.EnumPositionerBase
gda.device.enumpositioner.DummyValve
- All Implemented Interfaces:
Device,EnumPositioner,Scannable,Configurable,Findable,gda.observable.IObservable
A dummy class to imitate an EpicsValve
It accepts three commands: OPEN, CLOSE invalid input: '&' RESET: see ValvePosition
If OPEN is specified, the object will first go into OPENING state, then OPEN
If CLOSE is specified, the object will first go into CLOSING state, then CLOSED
If RESET is specified, the object will first go into RESET state, then back to its original state
The time taken to go into a requested state can be set by calling setTimeToMove(long)
-
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 TypeMethodDescriptionvoidDefault 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.Returns the current position of the Scannable.booleanisBusy()Check whether the valve is moving or a move has been queuedvoidTrigger a move/operation and block until completion.voidrawAsynchronousMoveTo(Object position) Set off a move on a thread, creating a future to contain the result of the move
This function will fail if the valve is already moving, or if there is already an active future.voidsetPosition(String position) voidsetTimeToMove(long timeToMove) Set the time to execute a moveMethods inherited from class gda.device.enumpositioner.EnumPositionerBase
addPosition, addPositions, checkPositionValid, clearPositions, containsPosition, createFormattedListAcceptablePositions, getNumberOfPositions, getPosition, getPositionerStatus, getPositionIndex, getPositions, getPositionsList, getStatus, isInPos, setPositionerStatus, setPositionsInternal, toFormattedStringMethods 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, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, 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
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
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, waitWhileBusy
-
Constructor Details
-
DummyValve
public DummyValve()
-
-
Method Details
-
configure
public void 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 classConfigurableBase
-
rawAsynchronousMoveTo
Set off a move on a thread, creating a future to contain the result of the move
This function will fail if the valve is already moving, or if there is already an active future.- Overrides:
rawAsynchronousMoveToin classScannableBase- Parameters:
position- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
isBusy
Check whether the valve is moving or a move has been queued- Specified by:
isBusyin interfaceScannable- Overrides:
isBusyin classEnumPositionerBase- Returns:
- true if moving or there is a pending move, false otherwise
- Throws:
DeviceException
-
moveTo
Description copied from class:ScannableBaseTrigger a move/operation and block until completion. If this is overridden, asynchronousMoveTo must also be valid, and the externalToInternal conversion must be applied.- Specified by:
moveToin interfaceScannable- Overrides:
moveToin classScannableBase- Parameters:
position-- Throws:
DeviceException
-
getPosition
Description copied from class:ScannableBaseReturns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.- Specified by:
getPositionin interfaceScannable- Overrides:
getPositionin classScannableBase- Returns:
- Current position with an element for each input and extra field. null if their are no fields.
- Throws:
DeviceException
-
setPosition
- Parameters:
position- The initial position to set.
-
setTimeToMove
public void setTimeToMove(long timeToMove) Set the time to execute a move- Parameters:
timeToMove- Time in milliseconds to execute move
-