Class EpicsSimplePositioner

All Implemented Interfaces:
ControllerRecord, Device, EnumPositioner, Scannable, Configurable, Findable, gda.observable.IObservable, gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.MonitorListener, EventListener
Direct Known Subclasses:
PersistentEpicsAperturePositioner

@ServiceInterface(EnumPositioner.class) public class EpicsSimplePositioner extends EnumPositionerBase implements gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.MonitorListener, ControllerRecord
This classes addresses a positioner that is controlled by a single PV, in contrast to (for example) EpicsPositioner

It additionally allows the user to use different names for the preset positions than those defined in Epics. In this case, the object needs to be configured with a map of <user-facing name> to <Epics name>

  • Field Details

    • pvName

      protected String pvName
    • controller

      protected EpicsController controller
    • currentPositionChnl

      protected gov.aps.jca.Channel currentPositionChnl
    • monitorInstalledSet

      protected HashSet<gov.aps.jca.Channel> monitorInstalledSet
  • Constructor Details

    • EpicsSimplePositioner

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

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

      public String getPvName()
    • setPvName

      public void setPvName(String pvName)
    • getControllerRecordName

      public String getControllerRecordName()
      Description copied from interface: ControllerRecord
      Gets the name of the controller record, e.g. EPICS process variable name. For example, in NeXus this value can be written as the value of the controller_record field for the NXpositioner for the scannable.
      Specified by:
      getControllerRecordName in interface ControllerRecord
      Returns:
      controller record name
      See Also:
    • checkPositionValid

      public String checkPositionValid(Object position)
      Description copied from class: ScannableBase
      This default behaviour should be extended by most subclasses! Tests if the given object is meaningful to this Scannable and so could be used by one of the move commands. May check limits and other things too. This is the method called by scans on all points before the scan is run.
      Specified by:
      checkPositionValid in interface Scannable
      Overrides:
      checkPositionValid in class EnumPositionerBase
      Parameters:
      position -
      Returns:
      null if position is valid, or returns a description if not.
      See Also:
    • connectionChanged

      public void connectionChanged(gov.aps.jca.event.ConnectionEvent ev)
      Specified by:
      connectionChanged in interface gov.aps.jca.event.ConnectionListener
    • monitorChanged

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

      public String toFormattedString()
      Description copied from interface: Scannable
      Returns a string representation of the Scannable and its current position/value/status

      Typically should return:

      name : position

      or for detectors, name : status

      If the position/status cannot be determined, the function should return Scannable.VALUE_UNAVAILABLE in its place.

      Specified by:
      toFormattedString in interface Scannable
      Overrides:
      toFormattedString in class EnumPositionerBase
      Returns:
      string as defined above
    • getValues

      public Map<String,String> getValues()
      Returns:
      Returns the values.
    • setValues

      public void setValues(Map<String,String> values)
      Mapinvalid input: '<'String, String> - means invalid input: '<'GDA name, EPICS name>
      Parameters:
      values - The values to set.
    • isCanMove

      public boolean isCanMove()
    • setCanMove

      public void setCanMove(boolean canMove)