Class PVScannable

All Implemented Interfaces:
Device, Scannable, InitializationListener, Configurable, Findable, gda.observable.IObservable, gov.aps.jca.event.MonitorListener, gov.aps.jca.event.PutListener, EventListener
Direct Known Subclasses:
PVStringScannable, SpELExpressionScannable

@ServiceInterface(Scannable.class) public class PVScannable extends ScannableBase implements gov.aps.jca.event.MonitorListener, InitializationListener, gov.aps.jca.event.PutListener
Represents and controls a PV. Unlike gda.device.controlpoint classes, this operates a single pv.

The isBusy value is based on whether the CAPutCallBack has returned after a call to asynchronousMoveTo.

There is an optional deadband value to restrict the amount of messages distributed by this class.

There is also a canMove flag to restrict changes to the PV.

  • Field Details

    • UNITSATTRIBUTE

      public static final String UNITSATTRIBUTE
      The attribute to get to retrieve the units string from Epics.
      See Also:
    • pvName

      protected String pvName
    • theChannel

      protected gov.aps.jca.Channel theChannel
    • controller

      protected EpicsController controller
  • Constructor Details

    • PVScannable

      public PVScannable()
    • PVScannable

      public PVScannable(String name, String pv)
  • 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
    • reconfigure

      public void reconfigure() throws FactoryException
      Description copied from interface: Configurable
      Re-initialisation of values and states.

      Moved from Reconfigurable which has been deleted

      Specified by:
      reconfigure in interface Configurable
      Overrides:
      reconfigure in class ConfigurableBase
      Throws:
      FactoryException
    • getPvName

      public String getPvName()
    • setPvName

      public void setPvName(String pvName)
    • getDeadband

      public double getDeadband()
      Returns:
      the deadband used when notifying IObservers of changes
    • setDeadband

      public void setDeadband(double deadband)
    • isCanMove

      public boolean isCanMove()
    • setCanMove

      public void setCanMove(boolean canMove)
    • getUnitsPvName

      public String getUnitsPvName()
    • setUnitsPvName

      public void setUnitsPvName(String unitsPvName)
    • getUnits

      public String getUnits()
    • setUnits

      public void setUnits(String units)
    • 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
    • monitorChanged

      public void monitorChanged(gov.aps.jca.event.MonitorEvent event)
      Specified by:
      monitorChanged in interface gov.aps.jca.event.MonitorListener
    • notifyObserversOfNewPosition

      protected void notifyObserversOfNewPosition(Serializable newPosition)
    • initializationCompleted

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

      public void putCompleted(gov.aps.jca.event.PutEvent arg0)
      Specified by:
      putCompleted in interface gov.aps.jca.event.PutListener
    • getAttribute

      public Object getAttribute(String attributename) throws DeviceException
      Description copied from interface: Device
      Get the value of the specified attribute
      Specified by:
      getAttribute in interface Device
      Overrides:
      getAttribute in class DeviceBase
      Parameters:
      attributename - is the name of the attribute
      Returns:
      the value of the attribute as an Object type
      Throws:
      DeviceException - if an attribute cannot be retrieved
    • toString

      public String toString()
      Overrides:
      toString in class ScannableBase