Class ScannableMotionWithScannableFieldsBase.ScannableField
- All Implemented Interfaces:
INeXusInfoWriteable,Device,Scannable,ContinuouslyScannableViaController,ScannableMotion,ScannableMotionUnits,Configurable,Findable,gda.observable.IObservable
- Enclosing class:
ScannableMotionWithScannableFieldsBase
-
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
ConstructorsConstructorDescriptionScannableField(String fieldName, ScannableMotionWithScannableFieldsBase parent, boolean isInputField, int index) -
Method Summary
Modifier and TypeMethodDescriptionvoidasynchronousMoveTo(Object position) If the parent is targeting calls parent.setElementTarget(), otherwise triggers the move.voidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.voidCalled by both the pos and scan commands at the start of each subsequent level move only on Scannables that will be moved as part that level's movement.voidCalled on every Scannable at the end of every data point, for scans which are broken down into individual points (i.e.voidCalled on every Scannable at every data point, for scans which are broken down into individual points (i.e.voidCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).voidCalled for every Scannable at the end of every scanvoidCalled for every Scannable at the start of every scanvoidCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case)voidclose()Close and unconfigure the device.intgetLevel()get the operation level of this scannable.Double[]Get lower Scannable limits in external representation.intThis is the number of times the Scannable should attempt to move to the target position.Double[]Returns offset(s) in amounts of external quantities.String[]Returns an array of strings which are the format strings to use when pretty printing parts of the outputgda.device.scannable.scannablegroup.ICoordinatedParentintDouble[]Returns scaling factor(s) as Doubles.Double[]WARNING: This method will not work with units.Double[]Get upper Scannable limits in external representationbooleanisBusy()Check if the Scannable is moving/operating.booleanbooleanIndicates whether the Scannable has deferred control to the he configuredContinuousMoveControllervoidrawAsynchronousMoveTo(Object internalPosition) [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.[Consider abstract] Read the position in its internal (user) representation.voidsetContinuousMoveController(ContinuousMoveController controller) voidsetLevel(int level) Used for ordering the operations of Scannables during scansvoidsetLowerGdaLimits(Double lowerLim) Set lower Scannable limit in external representation.voidsetLowerGdaLimits(Double[] lowerLim) Set lower Scannable limits in external representation.voidsetNumberTries(int numberTries) voidSet offset(s) in amounts of external quantities.voidsetOperatingContinuously(boolean b) Enable or disable control through the configuredContinuousMoveControllervoidsetOutputFormat(String[] formats) Sets the array of strings describing how best to format the positions from this scannablevoidsetParent(gda.device.scannable.scannablegroup.ICoordinatedParent parent) voidsetProtectionLevel(int permissionLevel) Sets the permission level for this object.voidsetScalingFactor(Double... scaleArray) Set scaling factor(s) as Doubles.voidsetTolerance(Double tolerance) voidsetTolerances(Double[] tolerance) WARNING: This method will not work with units.voidsetUpperGdaLimits(Double upperLim) Set upper Scannable limit in external representation.voidsetUpperGdaLimits(Double[] upperLim) Set upper Scannable limits in external representation.voidstop()Stop the current move/operation.voidReturns when operation carried out by moveTo has completedMethods inherited from class gda.device.scannable.ScannableMotionUnitsBase
addAcceptableUnit, externalToInternal, getAcceptableUnits, getAttribute, getHardwareUnitString, getInitialUserUnits, getUserUnits, internalToExternal, isAt, setHardwareUnitString, setInitialUserUnits, setOffset, setUserUnits, toFormattedStringMethods inherited from class gda.device.scannable.ScannableMotionBase
a, addPositionValidator, ar, asynchronousMoveTo, checkPositionValid, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, generateScannableLimitsReport, getAdditionalPositionValidators, getFirstInputLimits, getInputLimits, getInputLimits, getLimitsComponent, moveTo, r, rawIsBusy, removePositionValidator, setAdditionalPositionValidators, setLimitsComponent, setOffsetAndScalingComponent, writeNeXusInformation, writeNeXusInformationLimitsMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atLevelEnd, atLevelStart, getExtraNames, getInputNames, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, setExtraNames, setInputNames, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, deleteIObserver, deleteIObservers, getName, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setNameMethods inherited from class gda.factory.ConfigurableBase
configure, 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
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
getAttribute, setAttributeMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
atLevelEnd, atLevelStart, checkPositionValid, getExtraNames, getInputNames, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedStringMethods inherited from interface gda.device.ScannableMotion
a, ar, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, r
-
Constructor Details
-
ScannableField
public ScannableField(String fieldName, ScannableMotionWithScannableFieldsBase parent, boolean isInputField, int index) - Parameters:
fieldName-parent-isInputField-index-
-
-
Method Details
-
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
-
rawAsynchronousMoveTo
Description copied from class:ScannableBase[Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.- Overrides:
rawAsynchronousMoveToin classScannableBase- Parameters:
internalPosition- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
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:
-
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 classScannableBase- Throws:
DeviceExceptionInterruptedException
-
atCommandFailure
Description copied from class:ScannableBaseHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then onlyScannable.stop()will be called by the Scan or pos command.Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
- Specified by:
atCommandFailurein interfaceScannable- Overrides:
atCommandFailurein classScannableBase- Throws:
DeviceException- See Also:
-
atLevelMoveStart
Description copied from class:ScannableBaseCalled by both the pos and scan commands at the start of each subsequent level move only on Scannables that will be moved as part that level's movement.For example "pos a 1 b 2 c 3", will, if a and b have the same level and c a higher level will result in:
This hook is used by CoordinatedMotionScannables. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.a.atLevelMoveStart() invalid input: '<'---- b.atLevelMoveStart() invalid input: '<'---- a.asynchronousMoveTo() b.asynchronousMoveTo() a.waitWhileBusy() b.waitWhileBusy() c.atLevelMoveStart() invalid input: '<'---- c.asynchronousMoveTo() c.waitWhileBusy()
- Specified by:
atLevelMoveStartin interfaceScannable- Overrides:
atLevelMoveStartin classScannableBase- Throws:
DeviceException- See Also:
-
getParent
public gda.device.scannable.scannablegroup.ICoordinatedParent getParent() -
isInputField
public boolean isInputField() -
setParent
public void setParent(gda.device.scannable.scannablegroup.ICoordinatedParent parent) -
atScanStart
Description copied from class:ScannableBaseCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanStartin interfaceScannable- Overrides:
atScanStartin classScannableBase- Throws:
DeviceException- See Also:
-
atScanEnd
Description copied from class:ScannableBaseCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See
Scannable.atCommandFailure()Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- Throws:
DeviceException- See Also:
-
atScanLineStart
Description copied from class:ScannableBaseCalled for every Scannable at the start of every scan Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanLineStartin interfaceScannable- Overrides:
atScanLineStartin classScannableBase- Throws:
DeviceException- See Also:
-
atScanLineEnd
Description copied from class:ScannableBaseCalled for every Scannable at the end of every scan Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanLineEndin interfaceScannable- Overrides:
atScanLineEndin classScannableBase- Throws:
DeviceException- See Also:
-
atPointStart
Description copied from class:ScannableBaseCalled on every Scannable at every data point, for scans which are broken down into individual points (i.e. non-continuous scans) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atPointStartin interfaceScannable- Overrides:
atPointStartin classScannableBase- Throws:
DeviceException- See Also:
-
atPointEnd
Description copied from class:ScannableBaseCalled on every Scannable at the end of every data point, for scans which are broken down into individual points (i.e. non-continous scans) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atPointEndin interfaceScannable- Overrides:
atPointEndin classScannableBase- Throws:
DeviceException- See Also:
-
close
Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Overrides:
closein classDeviceBase- Throws:
DeviceException
-
getLevel
public int getLevel()Description copied from interface:Scannableget the operation level of this scannable.- Specified by:
getLevelin interfaceScannable- Overrides:
getLevelin classScannableBase- Returns:
- int - the level
-
getNumberTries
public int getNumberTries()Description copied from interface:ScannableMotionThis is the number of times the Scannable should attempt to move to the target position. Useful when the underlying hardware is problematic and often fails or ignores calls without throwing an exception. This should be used in conjunction with setting the tolerance attribute.- Specified by:
getNumberTriesin interfaceScannableMotion- Overrides:
getNumberTriesin classScannableMotionBase- Returns:
- the numberTries
- See Also:
-
getProtectionLevel
public int getProtectionLevel()- Specified by:
getProtectionLevelin interfaceDevice- Overrides:
getProtectionLevelin classDeviceBase- Returns:
- int - the permission level for this object.
-
getTolerances
Description copied from class:ScannableMotionBaseWARNING: This method will not work with units.- Specified by:
getTolerancesin interfaceScannableMotion- Overrides:
getTolerancesin classScannableMotionBase- Returns:
- double[]
- Throws:
DeviceException- See Also:
-
getOffset
Description copied from interface:ScannableMotionReturns offset(s) in amounts of external quantities. May be null, or any element may be null, indicating no offset is to be applied/removed.- Specified by:
getOffsetin interfaceScannableMotion- Overrides:
getOffsetin classScannableMotionUnitsBase
-
getScalingFactor
Description copied from interface:ScannableMotionReturns scaling factor(s) as Doubles. May be null, or any element may be null, indicating no scale is to be applied/removed.- Specified by:
getScalingFactorin interfaceScannableMotion- Overrides:
getScalingFactorin classScannableMotionBase
-
setLevel
public void setLevel(int level) Description copied from interface:ScannableUsed for ordering the operations of Scannables during scans- Specified by:
setLevelin interfaceScannable- Overrides:
setLevelin classScannableBase- Parameters:
level-
-
setTolerance
- Specified by:
setTolerancein interfaceScannableMotion- Overrides:
setTolerancein classScannableMotionBase- Parameters:
tolerance-- Throws:
DeviceException- See Also:
-
setTolerances
Description copied from class:ScannableMotionBaseWARNING: This method will not work with units.- Specified by:
setTolerancesin interfaceScannableMotion- Overrides:
setTolerancesin classScannableMotionBase- Parameters:
tolerance-- Throws:
DeviceException
-
setOffset
Description copied from interface:ScannableMotionSet offset(s) in amounts of external quantities. May be null, or any element may be null, indicating no offset is to be applied/removed.- Specified by:
setOffsetin interfaceScannableMotion- Overrides:
setOffsetin classScannableMotionUnitsBase- Parameters:
offsetArray- must match number of input fields.
-
setScalingFactor
Description copied from interface:ScannableMotionSet scaling factor(s) as Doubles. May be null, or any element may be null, indicating no scale is to be applied/removed.- Specified by:
setScalingFactorin interfaceScannableMotion- Overrides:
setScalingFactorin classScannableMotionBase- Parameters:
scaleArray- must match number of input fields.
-
getLowerGdaLimits
Description copied from interface:ScannableMotionGet lower Scannable limits in external representation. Will be null if no lower limits are set. Otherwise, any element can be null indicating that the corresponding field has no limit.- Specified by:
getLowerGdaLimitsin interfaceScannableMotion- Overrides:
getLowerGdaLimitsin classScannableMotionBase- Returns:
- Double[] limit in external representation
-
getUpperGdaLimits
Description copied from interface:ScannableMotionGet upper Scannable limits in external representation- Specified by:
getUpperGdaLimitsin interfaceScannableMotion- Overrides:
getUpperGdaLimitsin classScannableMotionBase- Returns:
- Double[] limit in external representation
-
setLowerGdaLimits
Description copied from interface:ScannableMotionSet lower Scannable limit in external representation. Setting the input null will remove the lower limit from the Scannable.- Specified by:
setLowerGdaLimitsin interfaceScannableMotion- Overrides:
setLowerGdaLimitsin classScannableMotionBase- Parameters:
lowerLim- limit in external representation- Throws:
Exception
-
setUpperGdaLimits
Description copied from interface:ScannableMotionSet upper Scannable limit in external representation. Setting the input null will remove the upper limit from the Scannable.- Specified by:
setUpperGdaLimitsin interfaceScannableMotion- Overrides:
setUpperGdaLimitsin classScannableMotionBase- Parameters:
upperLim- limit in external representation- Throws:
Exception
-
setLowerGdaLimits
Description copied from interface:ScannableMotionSet lower Scannable limits in external representation. Setting the input null will remove lower limits from the Scannable. Otherwise, any element can be null indicating that the corresponding field has no limit.- Specified by:
setLowerGdaLimitsin interfaceScannableMotion- Overrides:
setLowerGdaLimitsin classScannableMotionBase- Parameters:
lowerLim- limit in external representation- Throws:
Exception
-
setUpperGdaLimits
Description copied from interface:ScannableMotionSet upper Scannable limits in external representation. Setting the input null will remove upper limits from the Scannable. Otherwise, any element can be null indicating that the corresponding field has no limit.- Specified by:
setUpperGdaLimitsin interfaceScannableMotion- Overrides:
setUpperGdaLimitsin classScannableMotionBase- Parameters:
upperLim- limit in external representation- Throws:
Exception
-
setOutputFormat
Description copied from interface:ScannableSets the array of strings describing how best to format the positions from this scannable- Specified by:
setOutputFormatin interfaceScannable- Overrides:
setOutputFormatin classScannableBase- Parameters:
formats-
-
setNumberTries
public void setNumberTries(int numberTries) - Specified by:
setNumberTriesin interfaceScannableMotion- Overrides:
setNumberTriesin classScannableMotionBase- Parameters:
numberTries- the numberTries to set- See Also:
-
setProtectionLevel
public void setProtectionLevel(int permissionLevel) Description copied from interface:DeviceSets the permission level for this object. If this is not set then a default value will be applied.- Specified by:
setProtectionLevelin interfaceDevice- Overrides:
setProtectionLevelin classDeviceBase- Parameters:
permissionLevel-
-
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:
-
getContinuousMoveController
- Specified by:
getContinuousMoveControllerin interfaceContinuouslyScannableViaController
-
setContinuousMoveController
- Specified by:
setContinuousMoveControllerin interfaceContinuouslyScannableViaController
-
isOperatingContinously
public boolean isOperatingContinously()Description copied from interface:ContinuouslyScannableViaControllerIndicates whether the Scannable has deferred control to the he configuredContinuousMoveController- Specified by:
isOperatingContinouslyin interfaceContinuouslyScannableViaController- Returns:
- true if control is defered
-
setOperatingContinuously
public void setOperatingContinuously(boolean b) Description copied from interface:ContinuouslyScannableViaControllerEnable or disable control through the configuredContinuousMoveController- Specified by:
setOperatingContinuouslyin interfaceContinuouslyScannableViaController- Parameters:
b-
-
asynchronousMoveTo
If the parent is targeting calls parent.setElementTarget(), otherwise triggers the move.- Specified by:
asynchronousMoveToin interfaceScannable- Parameters:
position-- Throws:
DeviceException- if move threw one, or if this is an input field.
-