Class DummyValve

All Implemented Interfaces:
Device, EnumPositioner, Scannable, Configurable, Findable, gda.observable.IObservable

A dummy class to imitate an EpicsValve

It accepts three commands: OPEN, CLOSE invalid input: '&' RESET: see ValvePosition

If OPEN is specified, the object will first go into OPENING state, then OPEN
If CLOSE is specified, the object will first go into CLOSING state, then CLOSED
If RESET is specified, the object will first go into RESET state, then back to its original state

The time taken to go into a requested state can be set by calling setTimeToMove(long)

  • Constructor Details

    • DummyValve

      public DummyValve()
  • 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
    • rawAsynchronousMoveTo

      public void rawAsynchronousMoveTo(Object position) throws DeviceException
      Set off a move on a thread, creating a future to contain the result of the move
      This function will fail if the valve is already moving, or if there is already an active future.
      Overrides:
      rawAsynchronousMoveTo in class ScannableBase
      Parameters:
      position - Position in its internal/hardware representation. e.g. with units and offsets removed
      Throws:
      DeviceException
      See Also:
    • isBusy

      public boolean isBusy() throws DeviceException
      Check whether the valve is moving or a move has been queued
      Specified by:
      isBusy in interface Scannable
      Overrides:
      isBusy in class EnumPositionerBase
      Returns:
      true if moving or there is a pending move, false otherwise
      Throws:
      DeviceException
    • moveTo

      public void moveTo(Object position) throws DeviceException
      Description copied from class: ScannableBase
      Trigger a move/operation and block until completion. If this is overridden, asynchronousMoveTo must also be valid, and the externalToInternal conversion must be applied.
      Specified by:
      moveTo in interface Scannable
      Overrides:
      moveTo in class ScannableBase
      Parameters:
      position -
      Throws:
      DeviceException
    • getPosition

      public String 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
    • setPosition

      public void setPosition(String position)
      Parameters:
      position - The initial position to set.
    • setTimeToMove

      public void setTimeToMove(long timeToMove)
      Set the time to execute a move
      Parameters:
      timeToMove - Time in milliseconds to execute move