Package gda.device.scannable
Class XesSpectrometerScannableBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.ScannableMotionBase
gda.device.scannable.ScannableMotionUnitsBase
gda.device.scannable.XesSpectrometerScannableBase
- All Implemented Interfaces:
INeXusInfoWriteable,Device,Scannable,ScannableMotion,ScannableMotionUnits,IXesSpectrometerScannable,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver
- Direct Known Subclasses:
JohannSpectrometer,XesSpectrometerScannable
public abstract class XesSpectrometerScannableBase
extends ScannableMotionUnitsBase
implements gda.observable.IObserver, IXesSpectrometerScannable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<XesSpectrometerCrystal> List of spectrometer crystals extracted from crystals ScannableGroupprotected ScannableGroupScannableGroup containing Positioners that control which of the crystals are allowed to be moved.protected ScannableGroupScannableGroup containing the XesSpectrometerCrystal objects for the spectrometer.protected ScannableGroupScannableGroup containing the detector x, y and rotation scannablesprotected doubleprotected doubleprotected doubleprotected ScannableFields 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 TypeMethodDescriptionprotected voidcheckPositionValid(XesSpectrometerCrystal scannableGroup, double[] target) Check that a target position is finite and within limits of a scannable group.protected voidcheckPositionValid(Scannable scannable, Object target) Check that a target position is finite and within limits of a scannable.protected DoubleextractDouble(Object position) Extract a double value from position Object (first value is returned if there is more than one present)Return a list ofXesSpectrometerCrystalobjects extracted from crystals ScannableGroup (set bysetCrystalsGroup(ScannableGroup)).protected ScannableGroupdoubledoubledoubleprotected <T> List<T> getScannablesOfTypeFromGroup(ScannableGroup scnGroup, Class<T> classType) booleanisBusy()Check if the Scannable is moving/operating.voidsetCrystalsAllowedToMove(ScannableGroup crystalsAllowedToMove) voidsetCrystalsGroup(ScannableGroup crystalsGroup) voidsetDetectorGroup(ScannableGroup detectorGroup) voidsetMaxTheta(double maxTheta) voidsetMinTheta(double minTheta) voidsetRadius(double radius) Set the radius of the Rowland circlevoidsetRadiusScannable(Scannable radiusScannable) voidstop()Stop the current move/operation.protected voidvoidprotected voidUpdate the 'allowedToMove' flag of eachXesSpectrometerCrystalin thecrystalListbased on thecrystalsAllowedToMovepositioners.protected voidprotected voidPerform a number of validation and initialisation steps, typically called during Spring configuration by 'configure' method : Check that all required scannables have been set SetcrystalListusing scannables extracted fromcrystalsGroupobject.protected StringvalidatePosition(Object[] position) Check to make sure angle position is valid.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, asynchronousMoveTo, 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, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, rawAsynchronousMoveTo, rawGetPosition, 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
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
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.exafs.xes.IXesSpectrometerScannable
getSpectrometerPositionsMethods 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, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, 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
-
Field Details
-
crystalsGroup
ScannableGroup containing the XesSpectrometerCrystal objects for the spectrometer. -
crystalList
List of spectrometer crystals extracted from crystals ScannableGroup -
crystalsAllowedToMove
ScannableGroup containing Positioners that control which of the crystals are allowed to be moved. // If these are left as null allowedToMove is not modified. -
detectorGroup
ScannableGroup containing the detector x, y and rotation scannables -
radiusScannable
-
radius
protected double radius -
minTheta
protected double minTheta -
maxTheta
protected double maxTheta
-
-
Constructor Details
-
XesSpectrometerScannableBase
public XesSpectrometerScannableBase()
-
-
Method Details
-
validateAndSetup
Perform a number of validation and initialisation steps, typically called during Spring configuration by 'configure' method :- Check that all required scannables have been set
- Set
crystalListusing scannables extracted fromcrystalsGroupobject.- Set initial rowland circle radius from current value of
radiusScannable.- Add
validatePosition(Object[])as position validator to the scannable- Throws:
FactoryException
-
getCrystalsList
Return a list ofXesSpectrometerCrystalobjects extracted from crystals ScannableGroup (set bysetCrystalsGroup(ScannableGroup)).- Returns:
- List of XesSpecrtometerCrystal objects
-
getScannablesOfTypeFromGroup
-
getRadius
public double getRadius()- Specified by:
getRadiusin interfaceIXesSpectrometerScannable- Returns:
- Radius of the Rowland circle
-
setRadius
public void setRadius(double radius) Description copied from interface:IXesSpectrometerScannableSet the radius of the Rowland circle- Specified by:
setRadiusin interfaceIXesSpectrometerScannable- Parameters:
radius-
-
updateRadiusFromScannable
- Throws:
DeviceException
-
tryToUpdateRadiusFromScannable
protected void tryToUpdateRadiusFromScannable() -
getMaxTheta
public double getMaxTheta()- Specified by:
getMaxThetain interfaceIXesSpectrometerScannable- Returns:
- The maximum allowed Bragg angle.
-
getMinTheta
public double getMinTheta()- Specified by:
getMinThetain interfaceIXesSpectrometerScannable- Returns:
- The minimum allowed Bragg angle.
-
getScannables
- Specified by:
getScannablesin interfaceIXesSpectrometerScannable- Returns:
- List of all scannables controlled by the spectrometer
-
validatePosition
Check to make sure angle position is valid. i.e. is finite and between minTheta and maxTheta (This is usedScannableMotionBase.checkPositionValid(Object)to check demand position is valid).- Parameters:
position-- Returns:
- null if position is valid
- Throws:
DeviceException
-
checkPositionValid
Check that a target position is finite and within limits of a scannable. A DeviceException is thrown if it's not.- Parameters:
scannable-target-- Throws:
DeviceException
-
checkPositionValid
protected void checkPositionValid(XesSpectrometerCrystal scannableGroup, double[] target) throws DeviceException Check that a target position is finite and within limits of a scannable group. A DeviceException is thrown if it's not.- Parameters:
scannableGroup-target-- Throws:
DeviceException
-
getGroupedScannables
- Returns:
- ScannableGroup containing all scannables used by spectrometer (i.e. scannables returned by
getScannables()) - Throws:
DeviceException
-
updateActiveGroups
protected void updateActiveGroups()Update the 'allowedToMove' flag of eachXesSpectrometerCrystalin thecrystalListbased on thecrystalsAllowedToMovepositioners. -
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:
-
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:
-
extractDouble
Extract a double value from position Object (first value is returned if there is more than one present)- Parameters:
position-- Returns:
- double
-
update
- Specified by:
updatein interfacegda.observable.IObserver
-
getCrystalsGroup
-
setCrystalsGroup
-
getCrystalsAllowedToMove
-
setCrystalsAllowedToMove
-
getDetectorGroup
-
setDetectorGroup
-
setMinTheta
public void setMinTheta(double minTheta) -
setMaxTheta
public void setMaxTheta(double maxTheta) -
getDetXScannable
-
getDetYScannable
-
getDetRotScannable
-
getRadiusScannable
-
setRadiusScannable
-