Package gda.device.scannable.zebra
Class QexafsScannable
- All Implemented Interfaces:
INeXusInfoWriteable,ControllerRecord,Device,IScannableMotor,Scannable,ContinuouslyScannable,ScannableMotion,ScannableMotionUnits,InitializationListener,Configurable,Findable,gda.observable.IObservable
- Direct Known Subclasses:
ZebraQexafsScannable
public abstract class QexafsScannable
extends ScannableMotor
implements ContinuouslyScannable, InitializationListener
Under development for B18 only.
Proposed replacement for the current gda.device.scannable.QexafsScannable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected gov.aps.jca.Channelprotected Stringprotected Stringprotected Stringprotected EpicsChannelManagerprotected booleanprotected ContinuousParametersprotected EpicsControllerprotected gov.aps.jca.Channelprotected doubleprotected doubleprotected gov.aps.jca.Channelprotected Stringprotected doubleprotected doubleprotected gov.aps.jca.Channelprotected booleanprotected doubleprotected booleanprotected doubleprotected doubleprotected doubleprotected doubleprotected gov.aps.jca.Channelprotected StringFields inherited from class gda.device.scannable.ScannableMotor
COPY_MOTOR_LIMITS_INTO_SCANNABLE_LIMITSFields 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.IScannableMotor
WAS_ALREADY_BUSY_SO_COULD_NOT_BE_MOVEDFields 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 TypeMethodDescriptionvoidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.protected voidprotected voidcheckDeadbandAndMove(double positionInEV) 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 doubleconvertAngleToEnergy(double angle) protected doubleconvertEnergyToAngle(double energy) protected doubleprotected doublegetD()doubleprotected doubledoublevoidCalled when all critical channels are connected.booleanisExafs()booleanbooleanbooleanWhen true then the energy control PV will be toggled at the end of a qexafs.voidPrepare hardware for the continuous move.protected voidvoidsetAccelPV(String accelPV) voidsetBraggCurrentSpeedPV(String braggCurrentSpeedPV) voidsetBraggMaxSpeedPV(String braggMaxSpeedPV) voidsetContinuousParameters(ContinuousParameters parameters) Sets the parameters which define the continuous movement to usevoidsetEnergySwitchPV(String energySwitchPV) voidsetExtraRunUp(double extraRunUp) voidsetRunDownOn(boolean runDownOn) voidsetRunUpOn(boolean runUpOn) voidsetRunUpScaleFactor(double runUpScaleFactor) voidsetToggleEnergyControl(boolean toggleEnergyControl) voidsetXtalSwitchPV(String xtalSwitchPV) voidstop()Stop the current move/operation.protected voidprotected voidMethods inherited from class gda.device.scannable.ScannableMotor
attachMotorObserver, getActualPosition, getAttribute, getControllerRecordName, getDemandPosition, getDemandPositionTolerance, getFirstInputLimits, getLowerInnerLimit, getLowerMotorLimit, getMotor, getMotorLimitsComponent, getMotorName, getMotorResolution, getPosition, getSpeed, getTimeToVelocity, getUpperInnerLimit, getUpperMotorLimit, getUserOffset, isBusy, isReturningDemandPosition, rawAsynchronousMoveTo, rawGetDemandPosition, rawGetPosition, setDemandPositionTolerance, setLogMoveRequestsWithInfo, setMotor, setMotorLimitsComponent, setMotorName, setNotifyObserverPositionChangeEvents, setPosition, setReturnDemandPosition, setSpeed, setTimeToVelocity, toFormattedString, waitWhileBusyMethods inherited from class gda.device.scannable.ScannableMotionUnitsBase
addAcceptableUnit, externalToInternal, getAcceptableUnits, getHardwareUnitString, getInitialUserUnits, getOffset, getUserUnits, internalToExternal, isAt, setHardwareUnitString, setInitialUserUnits, setOffset, setOffset, setUserUnitsMethods inherited from class gda.device.scannable.ScannableMotionBase
a, addPositionValidator, ar, asynchronousMoveTo, checkPositionValid, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, generateScannableLimitsReport, getAdditionalPositionValidators, 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__, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, 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.scannable.ContinuouslyScannable
calculateEnergy, continuousMoveComplete, getNumberOfDataPoints, performContinuousMoveMethods 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, 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, 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
-
continuousParameters
-
accelPV
-
xtalSwitchPV
-
braggCurrentSpeedPV
-
braggMaxSpeedPV
-
energySwitchPV
-
channelsConfigured
protected boolean channelsConfigured -
controller
-
channelManager
-
accelChnl
protected gov.aps.jca.Channel accelChnl -
xtalSwitchChnl
protected gov.aps.jca.Channel xtalSwitchChnl -
currentSpeedChnl
protected gov.aps.jca.Channel currentSpeedChnl -
maxSpeedChnl
protected gov.aps.jca.Channel maxSpeedChnl -
energySwitchChnl
protected gov.aps.jca.Channel energySwitchChnl -
startAngle
protected double startAngle -
endAngle
protected double endAngle -
stepSize
protected double stepSize -
runupPosition
protected double runupPosition -
runDownPosition
protected double runDownPosition -
maxSpeed
protected double maxSpeed -
desiredSpeed
protected double desiredSpeed -
extraRunUp
protected double extraRunUp -
runUpOn
protected boolean runUpOn -
runDownOn
protected boolean runDownOn -
stepIncDemDeg
protected double stepIncDemDeg
-
-
Constructor Details
-
QexafsScannable
public QexafsScannable()
-
-
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 classScannableMotor- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
checkDeadbandAndMove
protected void checkDeadbandAndMove(double positionInEV) throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException - Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-
getMaxSpeed
protected double getMaxSpeed() -
getContinuousParameters
- Specified by:
getContinuousParametersin interfaceContinuouslyScannable- Returns:
- ContinuousParameters
-
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 classScannableMotor- Throws:
DeviceException- See Also:
-
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:
-
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
-
resetDCMSpeed
- Throws:
DeviceException
-
toggleEnergyControl
- Throws:
DeviceException
-
stopStartEnergyControl
- Throws:
DeviceException
-
getD
protected double getD() throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException- Returns:
- lattice spacing for the given Bragg crystal cut in use in Angstroms
- Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-
getAcceleration
protected double getAcceleration() throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException- Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-
isExafs
public boolean isExafs() -
calculateMotionInDegrees
protected void calculateMotionInDegrees() throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException- Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-
setContinuousParameters
Description copied from interface:ContinuouslyScannableSets the parameters which define the continuous movement to use- Specified by:
setContinuousParametersin interfaceContinuouslyScannable- Parameters:
parameters-
-
initializationCompleted
public void initializationCompleted()Description copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener
-
getAccelPV
-
setAccelPV
-
getXtalSwitchPV
-
setXtalSwitchPV
-
getBraggMaxSpeedPV
-
setBraggMaxSpeedPV
-
getEnergySwitchPV
-
setEnergySwitchPV
-
getBraggCurrentSpeedPV
-
setBraggCurrentSpeedPV
-
getExtraRunUp
public double getExtraRunUp() -
setExtraRunUp
public void setExtraRunUp(double extraRunUp) -
isRunUpOn
public boolean isRunUpOn() -
setRunUpOn
public void setRunUpOn(boolean runUpOn) -
isRunDownOn
public boolean isRunDownOn() -
setRunDownOn
public void setRunDownOn(boolean runDownOn) -
isToggleEnergyControl
public boolean isToggleEnergyControl()When true then the energy control PV will be toggled at the end of a qexafs. Default is false.- Returns:
- boolean
-
setToggleEnergyControl
public void setToggleEnergyControl(boolean toggleEnergyControl) -
getRunUpScaleFactor
public double getRunUpScaleFactor() -
setRunUpScaleFactor
public void setRunUpScaleFactor(double runUpScaleFactor) -
convertEnergyToAngle
protected double convertEnergyToAngle(double energy) throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException - Parameters:
energy- in eV- Returns:
- angle in degrees
- Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-
convertAngleToEnergy
protected double convertAngleToEnergy(double angle) throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException - Parameters:
angle- in degrees- Returns:
- energy in eV
- Throws:
gov.aps.jca.TimeoutExceptiongov.aps.jca.CAExceptionInterruptedException
-