Package gda.device.zebra
Class ZebraConstantVelocityMoveController
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.zebra.ZebraConstantVelocityMoveController
- All Implemented Interfaces:
ConstantVelocityMoveController,ConstantVelocityMoveController2,ContinuousMoveController,HardwareTriggerProvider,Device,Scannable,ContinuouslyScannableViaController,PositionCallableProvider<Double>,PositionStreamIndexerProvider<Double>,Configurable,Findable,gda.observable.IObservable,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
P2RZebraConstantVelMoveController
public class ZebraConstantVelocityMoveController
extends ScannableBase
implements ConstantVelocityMoveController2, PositionCallableProvider<Double>, PositionStreamIndexerProvider<Double>, ContinuouslyScannableViaController, org.springframework.beans.factory.InitializingBean
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleprotected doubleprotected doublestatic final intstatic final intFields 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_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.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)static voidvoidDefault 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.createScannable(Scannable delegate) doublegetEnd()getMaxCollectionTimeAndMinAccelerationTimeFromDetectors(Collection<HardwareTriggeredDetector> detectors, int pointBeingPrepared) doubleintgetMode()intstatic shortgetPcCaptureBitField(int pcEnc) doubledoubleintgetPositionSteamIndexer(int index) Get a PositionStreamIndexer for a Zebra position capture stream.doubledoubledoublegetStart()doublegetStep()List<gda.device.zebra.ZebraCaptureInputStreamCollection> static doublegetTimeUnitConversionAndSetTimeUnit(double maxCollectionTimeFromDetectors, Zebra zebra) doubledoublegetZebra()booleanisBusy()Check if the Scannable is moving/operating.booleanisMoving()Check if the controller is moving axes.booleanIndicates whether the Scannable has deferred control to the he configuredContinuousMoveControllerbooleanprotected voidDeprecated.voidPrepare the already configured controller to move, waiting until ready.[Consider abstract] Read the position in its internal (user) representation.voidvoidsetContinuousMoveController(ContinuousMoveController controller) voidsetDetectors(Collection<HardwareTriggeredDetector> detectors) voidsetEnd(double end) Set the end location for the move in hardware units/offset/scale.final voidsetMinimumAccelerationDistance(double minimumAccelerationDistance) Set the minimum allowable acceleration distance.voidsetMode(int mode) voidsetOperatingContinuously(boolean b) Enable or disable control through the configuredContinuousMoveControllervoidsetPcPulseGateNotTrigger(boolean pcPulseGateNotTrigger) voidsetPcPulseGateTrim(double pcPulseGateTrim) voidsetPcPulseTriggerWidth(double pcPulseTriggerWidth) voidsetRequiredSpeed(double requiredSpeed) voidsetScannableMotor(IScannableMotor scannableMotor) voidsetScannableMotorEndPosition(double scannableMotorEndPosition) voidsetScannableToMove(Collection<ContinuouslyScannableViaController> scannablesToMove) voidsetStart(double start) Set the start location for the move in hardware units/offset/scale.voidsetStep(double step) Set the step size for the move in hardware units/scale.voidsetTimeSeriesCollection(List<gda.device.zebra.ZebraCaptureInputStreamCollection> timeSeriesCollection) voidsetTriggeredControllers(Collection<ZebraMonitorController> triggeredControllers) voidsetTriggerPeriod(double seconds) protected voidsetupGateAndArm(double pcGateStart, double pcGateWidth, double step2, double gateWidthTimeInS) voidvoidsetZebraMotorInfoProvider(ZebraMotorInfoProvider zebraMotorInfoProvider) voidStart the prepared move and return immediately.voidstop()Stop the current move/operation.voidStop a move if one is in progress and then reset the controller.voidWait until the controller has completed moving axesMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, asynchronousMoveTo, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toFormattedString, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, 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, 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, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString, waitWhileBusy
-
Field Details
-
DEFAULT_PC_PULSE_GATE_TRIM
public static final double DEFAULT_PC_PULSE_GATE_TRIM- See Also:
-
pcGateWidthRBV
protected double pcGateWidthRBV -
pcGateStartRBV
protected double pcGateStartRBV -
PRIMARY_INDEXERS
public static final int PRIMARY_INDEXERS- See Also:
-
SECONDARY_INDEXERS
public static final int SECONDARY_INDEXERS- See Also:
-
-
Constructor Details
-
ZebraConstantVelocityMoveController
public ZebraConstantVelocityMoveController()
-
-
Method Details
-
prepareControllerToBeUsedForUpcomingScan
@Deprecated(since="GDA 8.40") protected void prepareControllerToBeUsedForUpcomingScan() throws DeviceExceptionDeprecated.This method should not be necessary. We have added it so that the scannable giving this controller to a scan can reset it to a known state. We hope this help us work around numerous hard to track down issues.- Throws:
DeviceException
-
getPcCaptureBitField
public static short getPcCaptureBitField(int pcEnc) -
resetPointBeingPrepared
public void resetPointBeingPrepared()- Specified by:
resetPointBeingPreparedin interfaceConstantVelocityMoveController2
-
getPointBeingPrepared
public int getPointBeingPrepared()- Specified by:
getPointBeingPreparedin interfaceConstantVelocityMoveController2
-
prepareForMove
Description copied from interface:ContinuousMoveControllerPrepare the already configured controller to move, waiting until ready. Normally this should move motors to the start position.- Specified by:
prepareForMovein interfaceContinuousMoveController- Throws:
InterruptedExceptionDeviceException
-
getMaxCollectionTimeAndMinAccelerationTimeFromDetectors
public static ZebraConstantVelocityMoveController.MaxCollectionTimeAndMinAccelerationTime getMaxCollectionTimeAndMinAccelerationTimeFromDetectors(Collection<HardwareTriggeredDetector> detectors, int pointBeingPrepared) throws DeviceException - Throws:
DeviceException
-
getTimeUnitConversionAndSetTimeUnit
public static double getTimeUnitConversionAndSetTimeUnit(double maxCollectionTimeFromDetectors, Zebra zebra) throws Exception - Throws:
Exception
-
setupGateAndArm
protected void setupGateAndArm(double pcGateStart, double pcGateWidth, double step2, double gateWidthTimeInS) throws Exception - Throws:
Exception
-
checkRBV
-
getMode
public int getMode() -
setMode
public void setMode(int mode) -
isPcPulseGateNotTrigger
public boolean isPcPulseGateNotTrigger() -
setPcPulseGateNotTrigger
public void setPcPulseGateNotTrigger(boolean pcPulseGateNotTrigger) -
startMove
Description copied from interface:ContinuousMoveControllerStart the prepared move and return immediately.- Specified by:
startMovein interfaceContinuousMoveController- Throws:
DeviceException
-
isMoving
Description copied from interface:ContinuousMoveControllerCheck if the controller is moving axes.- Specified by:
isMovingin interfaceContinuousMoveController- Returns:
- true if moving.
- Throws:
DeviceException
-
waitWhileMoving
Description copied from interface:ContinuousMoveControllerWait until the controller has completed moving axes- Specified by:
waitWhileMovingin interfaceContinuousMoveController- Throws:
InterruptedExceptionDeviceException
-
stopAndReset
Description copied from interface:ContinuousMoveControllerStop a move if one is in progress and then reset the controller.- Specified by:
stopAndResetin interfaceContinuousMoveController- Throws:
DeviceExceptionInterruptedException
-
setTriggerPeriod
- Specified by:
setTriggerPeriodin interfaceHardwareTriggerProvider- Throws:
DeviceException
-
getTriggerPeriod
public double getTriggerPeriod() -
getNumberTriggers
public int getNumberTriggers()- Specified by:
getNumberTriggersin interfaceHardwareTriggerProvider
-
getTotalTime
- Specified by:
getTotalTimein interfaceHardwareTriggerProvider- Throws:
DeviceException
-
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
-
setStart
Description copied from interface:ConstantVelocityMoveControllerSet the start location for the move in hardware units/offset/scale.- Specified by:
setStartin interfaceConstantVelocityMoveController- Parameters:
start-- Throws:
DeviceException
-
getStart
public double getStart()- Specified by:
getStartin interfaceConstantVelocityMoveController
-
setEnd
Description copied from interface:ConstantVelocityMoveControllerSet the end location for the move in hardware units/offset/scale.- Specified by:
setEndin interfaceConstantVelocityMoveController- Parameters:
end-- Throws:
DeviceException
-
getEnd
public double getEnd()- Specified by:
getEndin interfaceConstantVelocityMoveController
-
setStep
Description copied from interface:ConstantVelocityMoveControllerSet the step size for the move in hardware units/scale.- Specified by:
setStepin interfaceConstantVelocityMoveController- Parameters:
step-- Throws:
DeviceException
-
getStep
public double getStep()- Specified by:
getStepin interfaceConstantVelocityMoveController
-
getTimeSeriesCollection
-
setTimeSeriesCollection
public void setTimeSeriesCollection(List<gda.device.zebra.ZebraCaptureInputStreamCollection> timeSeriesCollection) -
addPoint
-
getLastPointAdded
-
getZebra
-
setZebra
-
getScannableMotor
-
setScannableMotor
-
getZebraMotorInfoProvider
-
setZebraMotorInfoProvider
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getPositionSteamIndexer
Get a PositionStreamIndexer for a Zebra position capture stream. Since each stream can only be used once, allow secondary clients to access copies of position streams by using an offset on the index. Indices 0 to 4 are ENC1-4, 6 to 9 are DIV1-4 and 10 is Capture time. Primary indices 0 to 10 are mapped onto secondary indices 11 to 21.- Specified by:
getPositionSteamIndexerin interfacePositionStreamIndexerProvider<Double>
-
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:
-
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:
-
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:
-
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:
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Specified by:
isBusyin interfaceScannable- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
getPositionCallable
- Specified by:
getPositionCallablein interfacePositionCallableProvider<Double>- 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:
-
setOperatingContinuously
Description copied from interface:ContinuouslyScannableViaControllerEnable or disable control through the configuredContinuousMoveController- Specified by:
setOperatingContinuouslyin interfaceContinuouslyScannableViaController- Parameters:
b-- Throws:
DeviceException
-
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
-
getContinuousMoveController
- Specified by:
getContinuousMoveControllerin interfaceContinuouslyScannableViaController
-
setContinuousMoveController
- Specified by:
setContinuousMoveControllerin interfaceContinuouslyScannableViaController
-
createScannable
-
setScannableToMove
- Specified by:
setScannableToMovein interfaceConstantVelocityMoveController2
-
setDetectors
- Specified by:
setDetectorsin interfaceConstantVelocityMoveController2
-
getDetectors
-
setMinimumAccelerationDistance
public final void setMinimumAccelerationDistance(double minimumAccelerationDistance) Set the minimum allowable acceleration distance. If this value is less than distanceToAccToVelocity at the requiredSpeed then it will be used instead of the calculated value. Note: This will result in a change to the time it takes for the motor to get to the start position. This value defaults to .5 ("degrees otherwise we may get error due to encoder noise") but should never be less than the deadband of the motor, otherwise the motor may already be in the gated area at the start of the move and the gate (and this pulse) will never be triggered.- Parameters:
minimumAccelerationDistance-
-
getMinimumAccelerationDistance
public double getMinimumAccelerationDistance() -
getRequiredSpeed
public double getRequiredSpeed() -
setRequiredSpeed
public void setRequiredSpeed(double requiredSpeed) -
getScannableMotorEndPosition
public double getScannableMotorEndPosition() -
setScannableMotorEndPosition
public void setScannableMotorEndPosition(double scannableMotorEndPosition) -
getPcPulseTriggerWidth
public double getPcPulseTriggerWidth() -
setPcPulseTriggerWidth
public void setPcPulseTriggerWidth(double pcPulseTriggerWidth) -
getPcPulseGateTrim
public double getPcPulseGateTrim() -
setPcPulseGateTrim
public void setPcPulseGateTrim(double pcPulseGateTrim) -
getTriggeredControllers
-
setTriggeredControllers
-