Class Spin

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

Spin class
  • Field Details

    • currentposition

      public volatile String currentposition
  • Constructor Details

    • Spin

      public Spin()
      Constructor
  • 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
    • setSpeed

      public void setSpeed(double value) throws DeviceException
      Description copied from interface: ISpin
      set spin speed
      Specified by:
      setSpeed in interface ISpin
      Parameters:
      value -
      Throws:
      DeviceException
    • getSpeed

      public double getSpeed() throws DeviceException
      Description copied from interface: ISpin
      get spin speed
      Specified by:
      getSpeed in interface ISpin
      Returns:
      spin speed
      Throws:
      DeviceException
    • getState

      public String getState() throws DeviceException
      Description copied from interface: ISpin
      check spin state - i.e. Enabled or Disabled
      Specified by:
      getState in interface ISpin
      Returns:
      spin state
      Throws:
      DeviceException
    • getPositions

      public String[] getPositions() throws DeviceException
      gets the available positions from this device.
      Returns:
      available positions
      Throws:
      DeviceException
    • initializationCompleted

      public void initializationCompleted() throws DeviceException
      Description copied from interface: InitializationListener
      Called when all critical channels are connected.
      Specified by:
      initializationCompleted in interface InitializationListener
      Throws:
      DeviceException
    • atScanStart

      public void atScanStart() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atScanStart in interface Scannable
      Overrides:
      atScanStart in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atScanEnd

      public void atScanEnd() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the end of a group of nested scans (or a single scan if that is the case).

      Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See Scannable.atCommandFailure() Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atScanEnd in interface Scannable
      Overrides:
      atScanEnd in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • on

      public void on() throws DeviceException
      Description copied from interface: ISpin
      enable spin or switch on spin
      Specified by:
      on in interface ISpin
      Throws:
      DeviceException
    • off

      public void off() throws DeviceException
      Description copied from interface: ISpin
      disable spin or switch off spin
      Specified by:
      off in interface ISpin
      Throws:
      DeviceException
    • 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 ScannableBase
      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
    • isBusy

      public boolean isBusy() throws DeviceException
      Description copied from interface: Scannable
      Check if the Scannable is moving/operating.
      Specified by:
      isBusy in interface Scannable
      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
    • getEnablePV

      public String getEnablePV()
    • setEnablePV

      public void setEnablePV(String enablePV)
    • getSpeedPV

      public String getSpeedPV()
    • setSpeedPV

      public void setSpeedPV(String speedPV)