Class ControllerScannable
- All Implemented Interfaces:
INeXusInfoWriteable,ControllerRecord,Device,IScannableMotor,Scannable,ScannableMotion,ScannableMotionUnits,Configurable,Findable,gda.observable.IObservable
-
Field Summary
Fields inherited from class gda.device.scannable.ScannableMotor
COPY_MOTOR_LIMITS_INTO_SCANNABLE_LIMITSFields inherited from class gda.device.scannable.ScannableMotionUnitsBase
unitsComponentFields inherited from class gda.device.scannable.ScannableMotionBase
numberTries, toleranceFields 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.IScannableMotor
WAS_ALREADY_BUSY_SO_COULD_NOT_BE_MOVEDFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLEFields inherited from interface gda.device.ScannableMotion
FIRSTINPUTLIMITSFields inherited from interface gda.device.ScannableMotionUnits
HARDWAREUNITS, USERUNITS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidasynchronousMoveTo(Object externalPosition) 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.voidcontinuousMove(double start, double width, double time) voidcontrollerMoveTo(Object position) intdoublegetSpeed()Get the speed of the underlying motordoublebooleanTests if the scannable is at (or if appropriate, close to) the value positionToTest.booleanbooleanbooleanbooleanbooleanbooleanvoidIf the numberTries and tolerance attributes have been set then repeatedly tries to move this Scannable until the position is within the tolerance range.voidrawAsynchronousMoveTo(Object internalPosition) Requests controller to test and trigger a motor to move.Return the last demanded motor/internal position if one has been set, otherwise return the current position.voidsetAxisNumber(int axisNumber) voidvoidsetNewportController(NewportVMCController newportController) voidsetResetSpeed(double speed) voidsetSpeed(double speed) Set the speed of the underlying motordoublesetTimeout(double timeout) voidstop()Stop the current move/operation.voidvoidReturns a string representation of the Scannable and its current position/value/statusvoidReturns when operation carried out by moveTo has completeddoubleWaits for timeout and returns Calling method to raise exception if required, depending on state of scannablevoidMethods inherited from class gda.device.scannable.ScannableMotor
attachMotorObserver, getActualPosition, getAttribute, getControllerRecordName, getDemandPosition, getDemandPositionTolerance, getFirstInputLimits, getLowerInnerLimit, getLowerMotorLimit, getMotor, getMotorLimitsComponent, getMotorName, getMotorResolution, getPosition, getTimeToVelocity, getUpperInnerLimit, getUpperMotorLimit, getUserOffset, isBusy, isReturningDemandPosition, rawGetPosition, setDemandPositionTolerance, setLogMoveRequestsWithInfo, setMotor, setMotorLimitsComponent, setMotorName, setNotifyObserverPositionChangeEvents, setPosition, setReturnDemandPosition, setTimeToVelocityMethods inherited from class gda.device.scannable.ScannableMotionUnitsBase
addAcceptableUnit, externalToInternal, getAcceptableUnits, getHardwareUnitString, getInitialUserUnits, getOffset, getUserUnits, internalToExternal, setHardwareUnitString, setInitialUserUnits, setOffset, setOffset, setUserUnitsMethods inherited from class gda.device.scannable.ScannableMotionBase
a, addPositionValidator, ar, checkPositionValid, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, generateScannableLimitsReport, getAdditionalPositionValidators, getInputLimits, getInputLimits, getLimitsComponent, getLowerGdaLimits, getNumberTries, getScalingFactor, getTolerances, getUpperGdaLimits, r, rawIsBusy, removePositionValidator, setAdditionalPositionValidators, setLimitsComponent, setLowerGdaLimits, setLowerGdaLimits, setNumberTries, setOffsetAndScalingComponent, setScalingFactor, setTolerance, setTolerances, setUpperGdaLimits, setUpperGdaLimits, writeNeXusInformation, writeNeXusInformationLimitsMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, 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, 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, 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, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributesMethods inherited from interface gda.device.ScannableMotion
a, ar, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, getLowerGdaLimits, getNumberTries, getOffset, getScalingFactor, getTolerances, getUpperGdaLimits, r, setLowerGdaLimits, setLowerGdaLimits, setNumberTries, setOffset, setScalingFactor, setTolerance, setTolerances, setUpperGdaLimits, setUpperGdaLimitsMethods inherited from interface gda.device.ScannableMotionUnits
addAcceptableUnit, getAcceptableUnits, getHardwareUnitString, getUserUnits, setHardwareUnitString, setOffset, setUserUnits
-
Constructor Details
-
ControllerScannable
public ControllerScannable()
-
-
Method Details
-
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 classScannableMotionBase- Parameters:
externalPosition- Position to move to should have an element for each input field.- Throws:
DeviceException
-
controllerMoveTo
- Throws:
DeviceException
-
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 classScannableMotor- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
continuousMove
public void continuousMove(double start, double width, double time) -
getAxisNumber
public int getAxisNumber() -
getControllerPosition
- Throws:
DeviceException
-
getNewportController
-
getResetSpeed
-
getSpeed
Description copied from class:ScannableMotorGet the speed of the underlying motor- Specified by:
getSpeedin interfaceIScannableMotor- Overrides:
getSpeedin classScannableMotor- Returns:
- speed in the motor's units
- Throws:
DeviceException
-
getTimeout
public double getTimeout() -
isAt
Description copied from class:ScannableMotionBaseTests if the scannable is at (or if appropriate, close to) the value positionToTest. If positionToTest is a string (as will be the case for valves or pneumatics for example), this is compared to the value obtained from getPosition(). An exception is thrown if this is not also a string.Otherwise if positionToTest is not a string the object is compared to the value from getPosition(), after having first pushed both values through objectToArray() from ScannableUtils.
This behaviour should be extended where possible, and has been in ScannableMotionBase If positionToTest is a string (as will be the case for valves or pneumatics for example), this is compared to the value obtained from getPosition(). An exception is thrown if this is not also a string.
Otherwise if positionToTest is not a string the object is compared to the value from getPosition() to see if they are within the tolerance specified in the scannable's tolerance array. Both values are first converted to arrays using objectToArray() from ScannableUtils.
- Specified by:
isAtin interfaceScannable- Overrides:
isAtin classScannableMotionUnitsBase- Parameters:
position- The position to compare the scannable's position to.- Returns:
- true if scannable is at positionToTest
- Throws:
DeviceException- See Also:
-
isBusyController
- Throws:
DeviceException
-
isBusyEpics
- Throws:
DeviceException
-
isInFaultEpics
- Throws:
DeviceException
-
isInTolerance
- Throws:
DeviceException
-
isProblemFlagSet
public boolean isProblemFlagSet() -
isReadyEpics
- Throws:
DeviceException
-
moveTo
Description copied from class:ScannableMotionBaseIf the numberTries and tolerance attributes have been set then repeatedly tries to move this Scannable until the position is within the tolerance range.- Specified by:
moveToin interfaceScannable- Overrides:
moveToin classScannableMotionBase- Parameters:
position-- Throws:
DeviceException- See Also:
-
rawAsynchronousMoveTo
Requests controller to test and trigger a motor to move. Throws a DeviceException if the motor is in alarm, in fault or is already busy. This method is synchronised so that another thread cannot enter it before the first thread has completed the motor's (asynchronous) moveTo call. For the DeviceException to be thrown properly when a move request is made of a moving motor, the motor's getStatus() method must *immediately* report BUSY after it's moveTo call has completed.- Overrides:
rawAsynchronousMoveToin classScannableMotor- Parameters:
internalPosition- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
rawGetDemandPosition
Return the last demanded motor/internal position if one has been set, otherwise return the current position. If the motor is stopped, and the actual position is not close to the the demand position, then the current position is returned instead.- Overrides:
rawGetDemandPositionin classScannableMotor- Throws:
DeviceException
-
resetSpeed
- Throws:
DeviceException
-
setAxisNumber
public void setAxisNumber(int axisNumber) -
setBasePV
-
setNewportController
-
setResetSpeed
public void setResetSpeed(double speed) -
setSpeed
Description copied from class:ScannableMotorSet the speed of the underlying motor- Specified by:
setSpeedin interfaceIScannableMotor- Overrides:
setSpeedin classScannableMotor- Parameters:
speed- in the motor's units- Throws:
DeviceException
-
setTimeout
public double setTimeout(double timeout) -
stop
Description copied from class:ScannableBaseStop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
stopin interfaceScannable- Overrides:
stopin classScannableMotor- Throws:
DeviceException- See Also:
-
stopController
- Throws:
DeviceException
-
stopEpics
- 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 classScannableMotor- Returns:
- string as defined above
-
waitWhileBusy
Description copied from class:ScannableBaseReturns when operation carried out by moveTo has completed If this is to be overriden, isBusy must also be valid. Although the pos and scan command currently use this method to determine if the Scannable is busy, this must not be relied upon.- Specified by:
waitWhileBusyin interfaceScannable- Overrides:
waitWhileBusyin classScannableMotor- Throws:
DeviceExceptionInterruptedException
-
waitWhileBusyScannable
- Throws:
DeviceExceptionInterruptedException
-
waitWhileBusyController
Waits for timeout and returns Calling method to raise exception if required, depending on state of scannable- Throws:
DeviceExceptionInterruptedException
-