Class QexafsTestingScannable
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.ScannableMotionBase
gda.device.scannable.ScannableMotionUnitsBase
uk.ac.gda.server.exafs.epics.device.scannable.QexafsTestingScannable
- All Implemented Interfaces:
INeXusInfoWriteable,Device,Scannable,ContinuouslyScannable,ScannableMotion,ScannableMotionUnits,Configurable,Findable,gda.observable.IObservable
public class QexafsTestingScannable
extends ScannableMotionUnitsBase
implements ContinuouslyScannable
This class is a simple ScannableMotor for use in a Continuous scan. The underlying motor can be either a real or dummy motor.
The motor will move from start to end position at constant velocity in the time specified by the A rampDistance either end of the start and end positions can be used to help ensure the motor
is moving at a uniform speed within the scan range.
The motor move to the initial position is carried out at the maxMotorSpeed.
The initial motor speed before the scan is restored after the move is complete.
ContinuousParameters.
-
Field Summary
Fields 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.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 position) Trigger a move/operation and return immediately.doublecalculateEnergy(int frameIndex) As this scannable controls the motion, it is responsible for knowing the energy at each framevoidDefault 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.voidOnce move and data collection complete, reverts any hardware settings etc.String[]Additional names for extra values that returned by getPosition().doubleintThe actual hardware might not be able to return exactly the numbner of points requested.String[]Returns an array of strings which are the format strings to use when pretty printing parts of the outputReturns the current position of the Scannable.doublebooleanisBusy()Check if the Scannable is moving/operating.voidPerform the move based on the supplied continuous parameters.voidPrepare hardware for the continuous move.voidrawAsynchronousMoveTo(Object position) [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.voidsetContinuousParameters(ContinuousParameters parameters) Sets the parameters which define the continuous movement to usevoidsetDelegateScannable(Scannable delegateScannable) voidsetMaxMotorSpeed(double maxMotorSpeed) voidsetRampDistance(double rampDistance) Methods inherited from class gda.device.scannable.ScannableMotionUnitsBase
addAcceptableUnit, externalToInternal, getAcceptableUnits, getAttribute, getHardwareUnitString, getInitialUserUnits, getOffset, getUserUnits, internalToExternal, isAt, setHardwareUnitString, setInitialUserUnits, setOffset, setOffset, setUserUnits, toFormattedStringMethods inherited from class gda.device.scannable.ScannableMotionBase
a, addPositionValidator, ar, checkPositionValid, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, generateScannableLimitsReport, getAdditionalPositionValidators, getFirstInputLimits, getInputLimits, getInputLimits, getLimitsComponent, getLowerGdaLimits, getNumberTries, getScalingFactor, getTolerances, getUpperGdaLimits, moveTo, 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, getInputNames, getLevel, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toString, 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, 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, getInputNames, getLevel, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString, waitWhileBusyMethods 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
-
QexafsTestingScannable
public QexafsTestingScannable()
-
-
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
-
getDelegateScannable
-
setDelegateScannable
-
prepareForContinuousMove
Description copied from interface:ContinuouslyScannablePrepare hardware for the continuous move. This assumes that continuous parameters have been supplied.- Specified by:
prepareForContinuousMovein interfaceContinuouslyScannable- Throws:
DeviceException
-
performContinuousMove
Description copied from interface:ContinuouslyScannablePerform the move based on the supplied continuous parameters.- Specified by:
performContinuousMovein interfaceContinuouslyScannable- Throws:
DeviceException
-
continuousMoveComplete
public void continuousMoveComplete()Description copied from interface:ContinuouslyScannableOnce move and data collection complete, reverts any hardware settings etc. set for the move.- Specified by:
continuousMoveCompletein interfaceContinuouslyScannable
-
getContinuousParameters
- Specified by:
getContinuousParametersin interfaceContinuouslyScannable- Returns:
- ContinuousParameters
-
setContinuousParameters
Description copied from interface:ContinuouslyScannableSets the parameters which define the continuous movement to use- Specified by:
setContinuousParametersin interfaceContinuouslyScannable- Parameters:
parameters-
-
calculateEnergy
public double calculateEnergy(int frameIndex) Description copied from interface:ContinuouslyScannableAs this scannable controls the motion, it is responsible for knowing the energy at each frame- Specified by:
calculateEnergyin interfaceContinuouslyScannable- Parameters:
frameIndex-- Returns:
- double energy in eV of the given frame
-
getNumberOfDataPoints
public int getNumberOfDataPoints()Description copied from interface:ContinuouslyScannableThe actual hardware might not be able to return exactly the numbner of points requested. This method returns the actaul number the scan should expect.- Specified by:
getNumberOfDataPointsin interfaceContinuouslyScannable- Returns:
- int - the number of data points which would be actually returned based on the given ContinuousParameters
-
getRampDistance
public double getRampDistance() -
setRampDistance
public void setRampDistance(double rampDistance) -
getMaxMotorSpeed
public double getMaxMotorSpeed() -
setMaxMotorSpeed
public void setMaxMotorSpeed(double maxMotorSpeed) -
rawAsynchronousMoveTo
Description copied from class:ScannableBase[Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.- Overrides:
rawAsynchronousMoveToin classScannableBase- Parameters:
position- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
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:
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
-
getOutputFormat
Description copied from interface:ScannableReturns an array of strings which are the format strings to use when pretty printing parts of the output- Specified by:
getOutputFormatin interfaceScannable- Overrides:
getOutputFormatin classScannableBase- Returns:
- string array
-
getExtraNames
Description copied from interface:ScannableAdditional names for extra values that returned by getPosition().- Specified by:
getExtraNamesin interfaceScannable- Overrides:
getExtraNamesin classScannableBase- Returns:
- array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
-
isBusy
Description copied from class:ScannableMotionBaseCheck if the Scannable is moving/operating.. Calls onto rawIsBusy for historical reasons, although there is currently no need for this.- Specified by:
isBusyin interfaceScannable- Overrides:
isBusyin classScannableMotionBase- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException- See Also:
-