Package gda.device.scannable
Class TwoJawSlitPosition
- All Implemented Interfaces:
INeXusInfoWriteable,Device,Scannable,ScannableMotion,ScannableMotionUnits,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver
- Direct Known Subclasses:
TwoJawSlitGap
public class TwoJawSlitPosition
extends ScannableMotionUnitsBase
implements gda.observable.IObserver
Position of the centre of a gap in a two-jaw slit.
Works in two modes. First mode where motor position positive directions are in the same direction and the second where positive for both axes is away from the middle. In both cases zero is the central position where the two jaws meet.
It is assumed that the first jaw has the higher motor position than the second.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ScannableMotionUnitsprotected Stringprotected ScannableMotionUnitsprotected StringFields 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.protected voidprotected javax.measure.Quantity<javax.measure.quantity.Length>[]calculateTargets(Object position) given a position, where should the motors be moved to?checkPositionValid(Object illDefinedPosObject) Checks the position against the Scannable's limits and against any additional position validators added with additionalPositionValidators().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.protected javax.measure.Quantity<javax.measure.quantity.Length> what is the current position as a user unit quantity?protected javax.measure.Quantity<javax.measure.quantity.Length> what is the current position as a user unit quantity?protected double[]getLimits(javax.measure.Quantity<javax.measure.quantity.Length> firstJawMin, javax.measure.Quantity<javax.measure.quantity.Length> firstJawMax, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMin, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMax) booleanisBusy()Check if the Scannable is moving/operating.voidIf the numberTries and tolerance attributes have been set then repeatedly tries to move this Scannable until the position is within the tolerance range.[Consider abstract] Read the position in its internal (user) representation.voidsetFirstJaw(ScannableMotionUnits firstJaw) voidsetFirstJawName(String firstJawName) voidsetSecondJaw(ScannableMotionUnits secondJaw) voidsetSecondJawName(String secondJawName) voidstop()Stop the current move/operation.voidprotected javax.measure.Unit<javax.measure.quantity.Length> 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, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, generateScannableLimitsReport, getAdditionalPositionValidators, getFirstInputLimits, 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, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, rawAsynchronousMoveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, 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, 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, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, waitWhileBusyMethods inherited from interface gda.device.ScannableMotion
a, ar, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, getLowerGdaLimits, getNumberTries, getScalingFactor, getTolerances, getUpperGdaLimits, r, setLowerGdaLimits, setLowerGdaLimits, setNumberTries, setScalingFactor, setTolerance, setTolerances, setUpperGdaLimits, setUpperGdaLimits
-
Field Details
-
firstJaw
-
secondJaw
-
firstJawName
-
secondJawName
-
-
Constructor Details
-
TwoJawSlitPosition
public TwoJawSlitPosition()
-
-
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
-
moveTo
If 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:
-
getLimits
protected double[] getLimits(javax.measure.Quantity<javax.measure.quantity.Length> firstJawMin, javax.measure.Quantity<javax.measure.quantity.Length> firstJawMax, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMin, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMax) -
calculateLimits
protected void calculateLimits() -
userUnitFromUnitsComponent
protected javax.measure.Unit<javax.measure.quantity.Length> userUnitFromUnitsComponent() -
checkPositionValid
Description copied from class:ScannableMotionBaseChecks the position against the Scannable's limits and against any additional position validators added with additionalPositionValidators().- Specified by:
checkPositionValidin interfaceScannable- Overrides:
checkPositionValidin classScannableMotionBase- Parameters:
illDefinedPosObject-- Returns:
- null if position is valid, or returns a description if not.
- 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
-
rawGetPosition
Description copied from class:ScannableBase[Consider abstract] Read the position in its internal (user) representation.- Overrides:
rawGetPositionin classScannableBase- Returns:
- the value represented by this Scannable
- Throws:
DeviceException- See Also:
-
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:
-
getFirstJaw
- Returns:
- Returns the firstJaw.
-
setFirstJaw
- Parameters:
firstJaw- The firstJaw to set.
-
getSecondJaw
- Returns:
- Returns the secondJaw.
-
setSecondJaw
- Parameters:
secondJaw- The secondJaw to set.
-
getFirstJawName
- Returns:
- Returns the firstJawName.
-
setFirstJawName
- Parameters:
firstJawName- The firstJawName to set.
-
getSecondJawName
- Returns:
- Returns the secondJawName.
-
setSecondJawName
- Parameters:
secondJawName- The secondJawName to set.
-
calculateTargets
protected javax.measure.Quantity<javax.measure.quantity.Length>[] calculateTargets(Object position) throws DeviceException given a position, where should the motors be moved to?- Parameters:
position-- Returns:
- Quantity[2]
- Throws:
DeviceException
-
getCurrentPosition
protected javax.measure.Quantity<javax.measure.quantity.Length> getCurrentPosition() throws DeviceExceptionwhat is the current position as a user unit quantity?- Returns:
- Quantity
- Throws:
DeviceException
-
getCurrentGap
protected javax.measure.Quantity<javax.measure.quantity.Length> getCurrentGap() throws DeviceExceptionwhat is the current position as a user unit quantity?- Returns:
- Quantity
- Throws:
DeviceException
-
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 classScannableBase- Throws:
DeviceException- See Also:
-
update
- Specified by:
updatein interfacegda.observable.IObserver
-