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 Details

    • continuousParameters

      protected ContinuousParameters continuousParameters
    • accelPV

      protected String accelPV
    • xtalSwitchPV

      protected String xtalSwitchPV
    • braggCurrentSpeedPV

      protected String braggCurrentSpeedPV
    • braggMaxSpeedPV

      protected String braggMaxSpeedPV
    • energySwitchPV

      protected String energySwitchPV
    • channelsConfigured

      protected boolean channelsConfigured
    • controller

      protected EpicsController controller
    • channelManager

      protected EpicsChannelManager 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

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default 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:
      configure in interface Configurable
      Overrides:
      configure in class ScannableMotor
      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.TimeoutException
      gov.aps.jca.CAException
      InterruptedException
    • getMaxSpeed

      protected double getMaxSpeed()
    • getContinuousParameters

      public ContinuousParameters getContinuousParameters()
      Specified by:
      getContinuousParameters in interface ContinuouslyScannable
      Returns:
      ContinuousParameters
    • stop

      public void stop() throws DeviceException
      Description copied from class: ScannableBase
      Stop 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:
      stop in interface Scannable
      Overrides:
      stop in class ScannableMotor
      Throws:
      DeviceException
      See Also:
    • atCommandFailure

      public void atCommandFailure() throws DeviceException
      Description copied from class: ScannableBase
      Hook 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 only Scannable.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:
      atCommandFailure in interface Scannable
      Overrides:
      atCommandFailure in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • prepareForContinuousMove

      public void prepareForContinuousMove() throws DeviceException
      Description copied from interface: ContinuouslyScannable
      Prepare hardware for the continuous move. This assumes that continuous parameters have been supplied.
      Specified by:
      prepareForContinuousMove in interface ContinuouslyScannable
      Throws:
      DeviceException
    • resetDCMSpeed

      protected void resetDCMSpeed() throws DeviceException
      Throws:
      DeviceException
    • toggleEnergyControl

      protected void toggleEnergyControl() throws DeviceException
      Throws:
      DeviceException
    • stopStartEnergyControl

      protected void stopStartEnergyControl() throws DeviceException
      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.TimeoutException
      gov.aps.jca.CAException
      InterruptedException
    • getAcceleration

      protected double getAcceleration() throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException
      Throws:
      gov.aps.jca.TimeoutException
      gov.aps.jca.CAException
      InterruptedException
    • isExafs

      public boolean isExafs()
    • calculateMotionInDegrees

      protected void calculateMotionInDegrees() throws gov.aps.jca.TimeoutException, gov.aps.jca.CAException, InterruptedException
      Throws:
      gov.aps.jca.TimeoutException
      gov.aps.jca.CAException
      InterruptedException
    • setContinuousParameters

      public void setContinuousParameters(ContinuousParameters parameters)
      Description copied from interface: ContinuouslyScannable
      Sets the parameters which define the continuous movement to use
      Specified by:
      setContinuousParameters in interface ContinuouslyScannable
      Parameters:
      parameters -
    • initializationCompleted

      public void initializationCompleted()
      Description copied from interface: InitializationListener
      Called when all critical channels are connected.
      Specified by:
      initializationCompleted in interface InitializationListener
    • getAccelPV

      public String getAccelPV()
    • setAccelPV

      public void setAccelPV(String accelPV)
    • getXtalSwitchPV

      public String getXtalSwitchPV()
    • setXtalSwitchPV

      public void setXtalSwitchPV(String xtalSwitchPV)
    • getBraggMaxSpeedPV

      public String getBraggMaxSpeedPV()
    • setBraggMaxSpeedPV

      public void setBraggMaxSpeedPV(String braggMaxSpeedPV)
    • getEnergySwitchPV

      public String getEnergySwitchPV()
    • setEnergySwitchPV

      public void setEnergySwitchPV(String energySwitchPV)
    • getBraggCurrentSpeedPV

      public String getBraggCurrentSpeedPV()
    • setBraggCurrentSpeedPV

      public void setBraggCurrentSpeedPV(String braggCurrentSpeedPV)
    • 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.TimeoutException
      gov.aps.jca.CAException
      InterruptedException
    • 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.TimeoutException
      gov.aps.jca.CAException
      InterruptedException