Package gda.device.monitor
Class DummyMonitor
- All Implemented Interfaces:
Device,Monitor,Scannable,Configurable,Findable,gda.observable.IObservable
A dummy implementation of the Monitor interface for testing / development.
-
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 TypeMethodDescriptionvoidasynchronousMoveTo(Object position) If called with a position this triggers a delay.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.intreturns the number of elements in this monitor.Returns the current position of the Scannable.getUnit()gets the physical unit of the monitor.booleanvoidsetConstantValue(Double constantValue) voidsetThrowExceptionOnAttemptedMove(boolean throwExceptionOnAttemptedMove) voidvoidsetUpdateInterval(int updateInterval) Set time between updatesvoidsetValue(double value) Sets the starting valueReturns a string representation of the Scannable and its current position/value/statusMethods inherited from class gda.device.monitor.MonitorBase
isBusyMethods 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, 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
atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, waitWhileBusy
-
Constructor Details
-
DummyMonitor
public DummyMonitor() -
DummyMonitor
-
DummyMonitor
-
-
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
-
asynchronousMoveTo
Description copied from class:MonitorBaseIf called with a position this triggers a delay. Very useful if the monitor is hooked up to something that calculates a running average, or that is not updated very often. Trigger 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 classMonitorBase- Parameters:
position- Position to move to should have an element for each input field.- Throws:
DeviceException- See Also:
-
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
-
setValue
public void setValue(double value) Sets the starting value- Parameters:
value-
-
getElementCount
Description copied from interface:Monitorreturns the number of elements in this monitor.- Specified by:
getElementCountin interfaceMonitor- Overrides:
getElementCountin classMonitorBase- Returns:
- int the element count
- Throws:
DeviceException
-
getUnit
Description copied from interface:Monitorgets the physical unit of the monitor.- Specified by:
getUnitin interfaceMonitor- Overrides:
getUnitin classMonitorBase- Returns:
- String the physical unit
- Throws:
DeviceException
-
setUnit
-
getConstantValue
- Returns:
- Returns the constantValue.
-
setConstantValue
- Parameters:
constantValue- The constantValue to set.
-
setUpdateInterval
public void setUpdateInterval(int updateInterval) Set time between updates- Parameters:
updateInterval- in milliseconds
-
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
-
isThrowExceptionOnAttemptedMove
public boolean isThrowExceptionOnAttemptedMove() -
setThrowExceptionOnAttemptedMove
public void setThrowExceptionOnAttemptedMove(boolean throwExceptionOnAttemptedMove)
-