Class JythonScannableWrapper

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

@ServiceInterface(Scannable.class) public class JythonScannableWrapper extends ScannableMotionBase
  • Constructor Details

    • JythonScannableWrapper

      public JythonScannableWrapper()
    • JythonScannableWrapper

      public JythonScannableWrapper(String scannableName)
  • Method Details

    • setScannableName

      public void setScannableName(String scannableName)
    • connectScannable

      public void connectScannable()
      connect to the Jython scannable for the scannable name set in this wrapper and add IOBserver to it. This method is required to re-connect this wrapper to Jython scannable on 'reset_namespace'. This method must be called in localStation.py to initialize this wrapper properly after the wrapped scannable is available in Jython namespace.
    • disconnectScannable

      public void disconnectScannable()
      remove IObservers from connected Jython scannable as reset_namespace does not do observer clean up of Java Scannable if any. This should be called before Jython Server restart to ensure Observer added to Java Object does not increase on each reset_namespace command.
    • 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
    • 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
    • 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:
    • moveTo

      public void moveTo(Object position) throws DeviceException
      Description copied from class: ScannableMotionBase
      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:
    • 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:
    • getCommand

      public String getCommand()
    • setCommand

      public void setCommand(String command)