Package xal.smf

Class ChannelSuite

java.lang.Object
xal.smf.ChannelSuite
All Implemented Interfaces:
DataListener

public class ChannelSuite extends Object implements DataListener
Manage the mapping of handles to signals and channels for a node. A signal is the unique PV name used for accessing EPICS records. A handle is a high level name used to access a PV in a specific context. For example a channel suite instance typically represents a suite of PVs associated with a particular element. Consider a BPM element. It has several PVs associated with it. The handles are labels common to all BPMs such as "xAvg", "yAvg", ... The handle is used to access a particular PV when applied to an element. So for example "xAvg" applied to BPM 1 of the MEBT refers to the specific PV "MEBT_Diag:BPM01:xAvg". Thus a handle is to a ChannelSuite instance much like an instance variable is to an instance of a class.
Author:
tap
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of ChannelSuite using the default channel factory
    ChannelSuite(ChannelFactory channelFactory)
    Primary constructor for creating an instance of channel suite
  • Method Summary

    Modifier and Type
    Method
    Description
    dataLabel() provides the name used to identify the class in an external data source.
    Get the channel corresponding to the specified handle.
    get the channel factory
    Get all of the handles managed by the is channel suite.
    final String
    getSignal(String handle)
    Get the channel signal corresponding to the handle.
    Get the transform associated with the specified handle.
    final boolean
    hasHandle(String handle)
    See if this channel suite manages the specified handle.
    protected boolean
    hasSignal(String signal)
    See if this channel suite manages the specified signal.
    boolean
    Determine whether the handle's corresponding PV is settable.
    final boolean
    isValid(String handle)
    Determine whether the handle's corresponding PV is valid.
    void
    putChannel(String handle, String signal, boolean settable)
    Convenience method to programmatically add or replace a channel corresponding to the specified handle with valid set to true and no transform
    void
    putChannel(String handle, String signal, boolean settable, String transformKey)
    Convenience method to programmatically add or replace a channel corresponding to the specified handle with valid set to true
    void
    putChannel(String handle, String signal, boolean settable, String transformKey, boolean valid)
    Programmatically add or replace a channel corresponding to the specified handle
    void
    Programmatically assign a transform for the specified name
    void
    set a new channel factory and clears the old channel map
    void
    setSettable(String handle, boolean settable)
    Set settable property for the PV associated with the handle.
    void
    Update the data based on the information provided by the data provider.
    void
    write(DataAdaptor adaptor)
    Write data to the data adaptor for storage.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ChannelSuite

      public ChannelSuite()
      Creates a new instance of ChannelSuite using the default channel factory
    • ChannelSuite

      public ChannelSuite(ChannelFactory channelFactory)
      Primary constructor for creating an instance of channel suite
      Parameters:
      channelFactory - channel factory (or null for default factory) for generating channels
  • Method Details

    • getChannelFactory

      public ChannelFactory getChannelFactory()
      get the channel factory
    • setChannelFactory

      public void setChannelFactory(ChannelFactory channelFactory)
      set a new channel factory and clears the old channel map
    • dataLabel

      public String dataLabel()
      dataLabel() provides the name used to identify the class in an external data source.
      Specified by:
      dataLabel in interface DataListener
      Returns:
      a tag that identifies the receiver's type
    • update

      public void update(DataAdaptor adaptor)
      Update the data based on the information provided by the data provider.
      Specified by:
      update in interface DataListener
      Parameters:
      adaptor - The adaptor from which to update the data
    • write

      public void write(DataAdaptor adaptor)
      Write data to the data adaptor for storage.
      Specified by:
      write in interface DataListener
      Parameters:
      adaptor - The adaptor to which the receiver's data is written
    • putChannel

      public void putChannel(String handle, String signal, boolean settable, String transformKey, boolean valid)
      Programmatically add or replace a channel corresponding to the specified handle
      Parameters:
      handle - The handle referring to the signal
      signal - PV signal associated with the handle
      settable - indicates whether the channel is settable
      transformKey - Key of the signal's transformation
      valid - specifies whether the channel is marked valid
    • putChannel

      public void putChannel(String handle, String signal, boolean settable, String transformKey)
      Convenience method to programmatically add or replace a channel corresponding to the specified handle with valid set to true
      Parameters:
      handle - The handle referring to the signal
      signal - PV signal associated with the handle
      settable - indicates whether the channel is settable
      transformKey - Key of the signal's transformation
    • putChannel

      public void putChannel(String handle, String signal, boolean settable)
      Convenience method to programmatically add or replace a channel corresponding to the specified handle with valid set to true and no transform
      Parameters:
      handle - The handle referring to the signal
      signal - PV signal associated with the handle
      settable - indicates whether the channel is settable
    • putTransform

      public void putTransform(String name, ValueTransform transform)
      Programmatically assign a transform for the specified name
      Parameters:
      name - key for associating the transform
      transform - the value transform
    • hasSignal

      protected boolean hasSignal(String signal)
      See if this channel suite manages the specified signal.
      Parameters:
      signal - The PV signal to check for availability.
      Returns:
      true if the PV signal is available and false if not.
    • hasHandle

      public final boolean hasHandle(String handle)
      See if this channel suite manages the specified handle.
      Parameters:
      handle - The handle to check for availability.
      Returns:
      true if the handle is available and false if not.
    • getHandles

      public final Collection<String> getHandles()
      Get all of the handles managed by the is channel suite.
      Returns:
      The handles managed by this channel suite.
    • getSignal

      public final String getSignal(String handle)
      Get the channel signal corresponding to the handle.
      Parameters:
      handle - The handle for which to get the PV signal name.
      Returns:
      Get the PV signal name associated with the specified handle or null if it is not found.
    • getTransform

      public final ValueTransform getTransform(String handle)
      Get the transform associated with the specified handle.
      Parameters:
      handle - The handle for which to get the transform.
      Returns:
      The transform for the specified handle.
    • isValid

      public final boolean isValid(String handle)
      Determine whether the handle's corresponding PV is valid.
      Parameters:
      handle - The handle for which to get the validity.
      Returns:
      validity state of the PV or false if there is no entry for the handle
    • isSettable

      public boolean isSettable(String handle)
      Determine whether the handle's corresponding PV is settable.
      Parameters:
      handle - The handle for which to get the attribute.
      Returns:
      set parameter of the PV or false if there is no entry for the handle
    • setSettable

      public void setSettable(String handle, boolean settable)
      Set settable property for the PV associated with the handle.
      Parameters:
      handle - The handle for which to set the settable property.
      settable - Set parameter.
    • getChannel

      public Channel getChannel(String handle)
      Get the channel corresponding to the specified handle.
      Parameters:
      handle - The handle for which to get the associated Channel.
      Returns:
      The channel associated with the specified handle.