Package gda.device
Interface ScannableMotionUnits
- All Superinterfaces:
Configurable,Device,Findable,gda.observable.IObservable,Scannable,ScannableMotion
- All Known Subinterfaces:
ContinuouslyScannable,IAirBearingScannableMotor,IScannableMotor,IScannableMotorObservable,ITweakableScannableMotor,IXesEnergyScannable,IXesSpectrometerScannable,SimulatedContinuouslyScannable
- All Known Implementing Classes:
AirBearingScannableMotor,B18EnergyScannable,BeamlineWavelength,BeamSize,BeforeAfterScannable,BeforeAfterScannables,BeforeCheckScannable,CalibratedAmplifier,ControllerScannable,ConvertorScannable,CoupledScannable,Crystal1PitchScannable,DeferredScannable,DummyContinuouslyScannable,DummyMultiFieldUnitsScannable,DummyPersistentUnitsScannable,DummyRealPositionReader,DummyScannableMotor,DummyUnitsScannable,EpicsScannable,GapControlCheckingEnergyController,I18SampleFocusScannable,I23FluoScanEnergyControllerWrapper,IdealBaseX,JohannSpectrometer,KeyenceLightScannable,MultiPVScannable,PassthroughScannableMotionUnitsDecorator,QexafsScannable,QexafsTestingScannable,QueuedScriptDrivenScannableMotionUnits,SampleXYZAxis,ScannableAttenuatorWedge,ScannableMotionUnitsBase,ScannableMotionUnitsObservableWrapper,ScannableMotionWithScannableFieldsBase.ScannableField,ScannableMotor,ScannableRotatingGonio,ScanResetDummyUnitScannable,ScriptDrivenScannableMotionUnits,SequentialScannable,SmarGonScannableMotor,TrajectoryScannableMotor,TurboXasScannable,TweakableScannableMotor,TwoJawSlitGap,TwoJawSlitPosition,VmxmJacksPiezoScannable,XESEnergyScannable,XesSpectrometerScannable,XesSpectrometerScannableBase,ZebraQexafsScannable,ZebraScannableMotor,ZebraScannableMotorForQexafs
An interface for ScannableMotion classes which provide a unit conversion from lower level hardware to an 'user unit'
from a list of 'acceptable units'.
This provides a set of standard methods to use to enable this conversion.
Classes implementing this interface are recommended to use the UnitsComponent component to make the conversion between 'user units' and 'hardware units' easier.
Strings are used rather than Unit objects to enable use of these classes in the Jython environment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe attribute to ask for to get the hardware unitsstatic final StringThe attribute to ask for to get the user unitsFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLEFields inherited from interface gda.device.ScannableMotion
FIRSTINPUTLIMITS -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAcceptableUnit(String newUnit) Adds a new unit to the list of acceptable units based on the supllied stringString[]Returns a string representation of the current reporting unitsvoidsetHardwareUnitString(String hardwareUnitString) Sets the hardware unit to hardwareUnitString.voidSet offset(s) in amounts of external quantities asScannableMotion.setOffset(Double...), but allows any position container containing objects that may be quantities.voidsetUserUnits(String userUnitsString) Sets the user unit to userUnitString.Methods inherited from interface gda.factory.Configurable
configure, 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, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, 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, setUpperGdaLimits
-
Field Details
-
USERUNITS
The attribute to ask for to get the user units- See Also:
-
HARDWAREUNITS
The attribute to ask for to get the hardware units- See Also:
-
-
Method Details
-
getUserUnits
String getUserUnits()Returns a string representation of the current reporting units- Returns:
- Returns the reportingUnitsString.
-
setUserUnits
Sets the user unit to userUnitString. If a hardware unit has not been explicitly set, then the hardware unit is also set to userUnitString. If a hardware unit has been set, and the userUnit is not compatible with this, then a DeviceException is thrown.- Parameters:
userUnitsString- The reportingUnitsString to set.- Throws:
DeviceException- if string not found in list of acceptable units
-
getHardwareUnitString
String getHardwareUnitString()- Returns:
- Returns the motorUnitString.
-
setHardwareUnitString
Sets the hardware unit to hardwareUnitString. If a user unit has not been explicitly set then the user unit is also set to hardwareUnitString. If the user unit has been explicitly set and the new hardware unit would invalidate this then a DeviceException is thrown.Based on this string, this method will build a list of acceptable user-units. Afterwards, the acceptable units list can be added to via the addAcceptableUnits method if the defaults do not cover enough.
- Parameters:
hardwareUnitString- The motorUnitString to set.- Throws:
DeviceException
-
getAcceptableUnits
String[] getAcceptableUnits()- Returns:
- Returns the acceptableUnitStrings.
-
addAcceptableUnit
Adds a new unit to the list of acceptable units based on the supllied string- Parameters:
newUnit- - string representation of the new acceptable unit- Throws:
DeviceException
-
setOffset
Set offset(s) in amounts of external quantities asScannableMotion.setOffset(Double...), but allows any position container containing objects that may be quantities.ScannableMotion.setOffset(Double...)- Parameters:
offsetPositionInExternalUnits-
-