Class QexafsTestingScannable

All Implemented Interfaces:
INeXusInfoWriteable, Device, Scannable, ContinuouslyScannable, ScannableMotion, ScannableMotionUnits, Configurable, Findable, gda.observable.IObservable

public class QexafsTestingScannable extends ScannableMotionUnitsBase implements ContinuouslyScannable
This class is a simple ScannableMotor for use in a Continuous scan. The underlying motor can be either a real or dummy motor.
  • The motor will move from start to end position at constant velocity in the time specified by the ContinuousParameters.
  • A rampDistance either end of the start and end positions can be used to help ensure the motor is moving at a uniform speed within the scan range.
  • The motor move to the initial position is carried out at the maxMotorSpeed.
  • The initial motor speed before the scan is restored after the move is complete.
    • Constructor Details

      • QexafsTestingScannable

        public QexafsTestingScannable()
    • 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 ConfigurableBase
        Throws:
        FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
      • getDelegateScannable

        public Scannable getDelegateScannable()
      • setDelegateScannable

        public void setDelegateScannable(Scannable delegateScannable)
      • 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
      • performContinuousMove

        public void performContinuousMove() throws DeviceException
        Description copied from interface: ContinuouslyScannable
        Perform the move based on the supplied continuous parameters.
        Specified by:
        performContinuousMove in interface ContinuouslyScannable
        Throws:
        DeviceException
      • continuousMoveComplete

        public void continuousMoveComplete()
        Description copied from interface: ContinuouslyScannable
        Once move and data collection complete, reverts any hardware settings etc. set for the move.
        Specified by:
        continuousMoveComplete in interface ContinuouslyScannable
      • getContinuousParameters

        public ContinuousParameters getContinuousParameters()
        Specified by:
        getContinuousParameters in interface ContinuouslyScannable
        Returns:
        ContinuousParameters
      • 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 -
      • calculateEnergy

        public double calculateEnergy(int frameIndex)
        Description copied from interface: ContinuouslyScannable
        As this scannable controls the motion, it is responsible for knowing the energy at each frame
        Specified by:
        calculateEnergy in interface ContinuouslyScannable
        Parameters:
        frameIndex -
        Returns:
        double energy in eV of the given frame
      • getNumberOfDataPoints

        public int getNumberOfDataPoints()
        Description copied from interface: ContinuouslyScannable
        The actual hardware might not be able to return exactly the numbner of points requested. This method returns the actaul number the scan should expect.
        Specified by:
        getNumberOfDataPoints in interface ContinuouslyScannable
        Returns:
        int - the number of data points which would be actually returned based on the given ContinuousParameters
      • getRampDistance

        public double getRampDistance()
      • setRampDistance

        public void setRampDistance(double rampDistance)
      • getMaxMotorSpeed

        public double getMaxMotorSpeed()
      • setMaxMotorSpeed

        public void setMaxMotorSpeed(double maxMotorSpeed)
      • rawAsynchronousMoveTo

        public void rawAsynchronousMoveTo(Object position) throws DeviceException
        Description copied from class: ScannableBase
        [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.
        Overrides:
        rawAsynchronousMoveTo in class ScannableBase
        Parameters:
        position - Position in its internal/hardware representation. e.g. with units and offsets removed
        Throws:
        DeviceException
        See Also:
      • asynchronousMoveTo

        public void asynchronousMoveTo(Object position) throws DeviceException
        Description copied from class: ScannableBase
        Trigger a move/operation and return immediately. Implementations of this method should be non-blocking to allow concurrent motion; the isBusy method will be used to determine when the move has completed. Converts the external (user) position to an internal position and passes this to rawAsynchronousMoveTo.
        Specified by:
        asynchronousMoveTo in interface Scannable
        Overrides:
        asynchronousMoveTo in class ScannableMotionBase
        Parameters:
        position - Position to move to should have an element for each input field.
        Throws:
        DeviceException
      • getPosition

        public Object getPosition() throws DeviceException
        Description copied from class: ScannableBase
        Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.
        Specified by:
        getPosition in interface Scannable
        Overrides:
        getPosition in class ScannableBase
        Returns:
        Current position with an element for each input and extra field. null if their are no fields.
        Throws:
        DeviceException
      • getOutputFormat

        public String[] getOutputFormat()
        Description copied from interface: Scannable
        Returns an array of strings which are the format strings to use when pretty printing parts of the output
        Specified by:
        getOutputFormat in interface Scannable
        Overrides:
        getOutputFormat in class ScannableBase
        Returns:
        string array
      • getExtraNames

        public String[] getExtraNames()
        Description copied from interface: Scannable
        Additional names for extra values that returned by getPosition().
        Specified by:
        getExtraNames in interface Scannable
        Overrides:
        getExtraNames in class ScannableBase
        Returns:
        array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
      • isBusy

        public boolean isBusy() throws DeviceException
        Description copied from class: ScannableMotionBase
        Check if the Scannable is moving/operating.. Calls onto rawIsBusy for historical reasons, although there is currently no need for this.
        Specified by:
        isBusy in interface Scannable
        Overrides:
        isBusy in class ScannableMotionBase
        Returns:
        true - if operation carried out by moveTo has not completed yet
        Throws:
        DeviceException
        See Also: