Class ConvertorScannable<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>>

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

@ServiceInterface(ScannableMotionUnits.class) public class ConvertorScannable<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>> extends ScannableMotionUnitsBase implements gda.observable.IObserver
Replacement for CombinedDOF. This Scannable operates a ScannableMotionUnits scannable via a LookupTableQuantityConverter: the table this converter uses is used to convert between the 'user' position and the position fetched from / commanded to the underlying Scannable.

The underlying Scannable should only have a single value input (getInputNames().length ==1);

  • Constructor Details

    • ConvertorScannable

      public ConvertorScannable()
  • Method Details

    • configure

      public void configure()
      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
    • asynchronousMoveTo

      public void asynchronousMoveTo(Object externalPosition) 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:
      externalPosition - Position to move to should have an element for each input field.
      Throws:
      DeviceException
    • rawAsynchronousMoveTo

      public void rawAsynchronousMoveTo(Object internalPositionAmount) 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:
      internalPositionAmount - Position in its internal/hardware representation. e.g. with units and offsets removed
      Throws:
      DeviceException
      See Also:
    • 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:
    • checkPositionValid

      public String checkPositionValid(Object externalPosition) throws DeviceException
      Checks the ConvertorScannable's Scannable limits, and then wrapped Scannable's limits (using converted values)
      Specified by:
      checkPositionValid in interface Scannable
      Overrides:
      checkPositionValid in class ScannableMotionBase
      Parameters:
      externalPosition -
      Returns:
      null if position is valid, or returns a description if not.
      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:
    • getConvertorName

      public String getConvertorName()
      Returns:
      Returns the convertorName.
    • setConvertorName

      public void setConvertorName(String convertorName)
      Parameters:
      convertorName - The convertorName to set.
    • getScannableName

      public String getScannableName()
      Returns:
      Returns the theScannableNames.
    • setScannableName

      public void setScannableName(String newScannableName)
      Parameters:
      newScannableName - The Scannable name to add.
    • getScannable

      public ScannableMotionUnits getScannable()
    • setScannable

      public void setScannable(ScannableMotionUnits scannable)
    • getConvertor

      public IQuantityConverter<S,T> getConvertor()
    • setConvertor

      public void setConvertor(IQuantityConverter<S,T> convertor)
    • setConvertorUnitString

      public void setConvertorUnitString(String convertorUnitString)
    • getConvertorUnitString

      public String getConvertorUnitString()
    • update

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