Package gda.device.scannable
Class PVScannable
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.PVScannable
- All Implemented Interfaces:
Device,Scannable,InitializationListener,Configurable,Findable,gda.observable.IObservable,gov.aps.jca.event.MonitorListener,gov.aps.jca.event.PutListener,EventListener
- Direct Known Subclasses:
PVStringScannable,SpELExpressionScannable
@ServiceInterface(Scannable.class)
public class PVScannable
extends ScannableBase
implements gov.aps.jca.event.MonitorListener, InitializationListener, gov.aps.jca.event.PutListener
Represents and controls a PV. Unlike gda.device.controlpoint classes, this operates a single pv.
The isBusy value is based on whether the CAPutCallBack has returned after a call to asynchronousMoveTo.
There is an optional deadband value to restrict the amount of messages distributed by this class.
There is also a canMove flag to restrict changes to the PV.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EpicsControllerprotected Stringprotected gov.aps.jca.Channelstatic final StringThe attribute to get to retrieve the units string from Epics.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 TypeMethodDescriptionvoidasynchronousMoveTo(Object position) Trigger a move/operation and return immediately.voidDefault 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.getAttribute(String attributename) Get the value of the specified attributedoubleReturns the current position of the Scannable.getUnits()voidCalled when all critical channels are connected.booleanisBusy()Check if the Scannable is moving/operating.booleanvoidmonitorChanged(gov.aps.jca.event.MonitorEvent event) protected voidnotifyObserversOfNewPosition(Serializable newPosition) voidputCompleted(gov.aps.jca.event.PutEvent arg0) voidRe-initialisation of values and states.voidsetCanMove(boolean canMove) voidsetDeadband(double deadband) voidvoidvoidsetUnitsPvName(String unitsPvName) toString()Methods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toFormattedString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Device
close, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
UNITSATTRIBUTE
The attribute to get to retrieve the units string from Epics.- See Also:
-
pvName
-
theChannel
protected gov.aps.jca.Channel theChannel -
controller
-
-
Constructor Details
-
PVScannable
public PVScannable() -
PVScannable
-
-
Method Details
-
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- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
reconfigure
Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase- Throws:
FactoryException
-
getPvName
-
setPvName
-
getDeadband
public double getDeadband()- Returns:
- the deadband used when notifying IObservers of changes
-
setDeadband
public void setDeadband(double deadband) -
isCanMove
public boolean isCanMove() -
setCanMove
public void setCanMove(boolean canMove) -
getUnitsPvName
-
setUnitsPvName
-
getUnits
-
setUnits
-
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 classScannableBase- Parameters:
position- Position to move to should have an element for each input field.- 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
-
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
-
monitorChanged
public void monitorChanged(gov.aps.jca.event.MonitorEvent event) - Specified by:
monitorChangedin interfacegov.aps.jca.event.MonitorListener
-
notifyObserversOfNewPosition
-
initializationCompleted
public void initializationCompleted()Description copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener
-
putCompleted
public void putCompleted(gov.aps.jca.event.PutEvent arg0) - Specified by:
putCompletedin interfacegov.aps.jca.event.PutListener
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- Parameters:
attributename- is the name of the attribute- Returns:
- the value of the attribute as an Object type
- Throws:
DeviceException- if an attribute cannot be retrieved
-
toString
- Overrides:
toStringin classScannableBase
-