Class TwoJawSlitPosition

All Implemented Interfaces:
INeXusInfoWriteable, Device, Scannable, ScannableMotion, ScannableMotionUnits, Configurable, Findable, gda.observable.IObservable, gda.observable.IObserver
Direct Known Subclasses:
TwoJawSlitGap

public class TwoJawSlitPosition extends ScannableMotionUnitsBase implements gda.observable.IObserver
Position of the centre of a gap in a two-jaw slit.

Works in two modes. First mode where motor position positive directions are in the same direction and the second where positive for both axes is away from the middle. In both cases zero is the central position where the two jaws meet.

It is assumed that the first jaw has the higher motor position than the second.

  • Field Details

  • Constructor Details

    • TwoJawSlitPosition

      public TwoJawSlitPosition()
  • 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
    • moveTo

      public void moveTo(Object position) throws DeviceException
      If the numberTries and tolerance attributes have been set then repeatedly tries to move this Scannable until the position is within the tolerance range.
      Specified by:
      moveTo in interface Scannable
      Overrides:
      moveTo in class ScannableMotionBase
      Parameters:
      position -
      Throws:
      DeviceException
      See Also:
    • getLimits

      protected double[] getLimits(javax.measure.Quantity<javax.measure.quantity.Length> firstJawMin, javax.measure.Quantity<javax.measure.quantity.Length> firstJawMax, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMin, javax.measure.Quantity<javax.measure.quantity.Length> secondJawMax)
    • calculateLimits

      protected void calculateLimits()
    • userUnitFromUnitsComponent

      protected javax.measure.Unit<javax.measure.quantity.Length> userUnitFromUnitsComponent()
    • checkPositionValid

      public String checkPositionValid(Object illDefinedPosObject) throws DeviceException
      Description copied from class: ScannableMotionBase
      Checks the position against the Scannable's limits and against any additional position validators added with additionalPositionValidators().
      Specified by:
      checkPositionValid in interface Scannable
      Overrides:
      checkPositionValid in class ScannableMotionBase
      Parameters:
      illDefinedPosObject -
      Returns:
      null if position is valid, or returns a description if not.
      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
    • rawGetPosition

      public Object rawGetPosition() throws DeviceException
      Description copied from class: ScannableBase
      [Consider abstract] Read the position in its internal (user) representation.
      Overrides:
      rawGetPosition in class ScannableBase
      Returns:
      the value represented by this Scannable
      Throws:
      DeviceException
      See Also:
    • 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:
    • getFirstJaw

      public ScannableMotionUnits getFirstJaw()
      Returns:
      Returns the firstJaw.
    • setFirstJaw

      public void setFirstJaw(ScannableMotionUnits firstJaw)
      Parameters:
      firstJaw - The firstJaw to set.
    • getSecondJaw

      public ScannableMotionUnits getSecondJaw()
      Returns:
      Returns the secondJaw.
    • setSecondJaw

      public void setSecondJaw(ScannableMotionUnits secondJaw)
      Parameters:
      secondJaw - The secondJaw to set.
    • getFirstJawName

      public String getFirstJawName()
      Returns:
      Returns the firstJawName.
    • setFirstJawName

      public void setFirstJawName(String firstJawName)
      Parameters:
      firstJawName - The firstJawName to set.
    • getSecondJawName

      public String getSecondJawName()
      Returns:
      Returns the secondJawName.
    • setSecondJawName

      public void setSecondJawName(String secondJawName)
      Parameters:
      secondJawName - The secondJawName to set.
    • calculateTargets

      protected javax.measure.Quantity<javax.measure.quantity.Length>[] calculateTargets(Object position) throws DeviceException
      given a position, where should the motors be moved to?
      Parameters:
      position -
      Returns:
      Quantity[2]
      Throws:
      DeviceException
    • getCurrentPosition

      protected javax.measure.Quantity<javax.measure.quantity.Length> getCurrentPosition() throws DeviceException
      what is the current position as a user unit quantity?
      Returns:
      Quantity
      Throws:
      DeviceException
    • getCurrentGap

      protected javax.measure.Quantity<javax.measure.quantity.Length> getCurrentGap() throws DeviceException
      what is the current position as a user unit quantity?
      Returns:
      Quantity
      Throws:
      DeviceException
    • 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 ScannableBase
      Throws:
      DeviceException
      See Also:
    • update

      public void update(Object theObserved, Object changeCode)
      Specified by:
      update in interface gda.observable.IObserver