Class ValueLinks

java.lang.Object
org.scictrl.csshell.epics.server.ValueLinks

public class ValueLinks extends Object

ValueLinks class.

Author:
igor@scictrl.com
  • Field Details

  • Constructor Details

    • ValueLinks

      public ValueLinks(String name, String linkName, PropertyChangeListener listener, String propertyType)
      Creates new link handler. Name is used as a context.
      Parameters:
      name - this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as in AbstractApplication.
      linkName - name of PV links to be established by this handler.
      listener - update listener
      propertyType - how to listen to links,c an be Record.PROPERTY_VALUE or Record.PROPERTY_ALARM
    • ValueLinks

      public ValueLinks(String name, String context, String linkName, PropertyChangeListener listener, String propertyType)
      Creates new link handler.
      Parameters:
      name - this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as in AbstractApplication.
      context - a context to the link, this is used in logging to distinguish who is using this link. if null then name is used.
      linkName - name of PV links to be established by this handler.
      listener - update listener
      propertyType - how to listen to links,c an be Record.PROPERTY_VALUE or Record.PROPERTY_ALARM
    • ValueLinks

      public ValueLinks(String name, String[] linkNames, PropertyChangeListener listener, String propertyType)
      Creates new link handler. Name is used as a context.
      Parameters:
      name - this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as in AbstractApplication.
      linkNames - name of PV links to be established by this handler.
      listener - update listener
      propertyType - how to listen to links,c an be Record.PROPERTY_VALUE or Record.PROPERTY_ALARM
    • ValueLinks

      public ValueLinks(String name, String context, String[] linkNames, PropertyChangeListener listener, String propertyType)
      Creates new link handler.
      Parameters:
      name - this name is used as identifier, so if several link handlers are used, they can be distinguished, for example as in AbstractApplication.
      context - a context to the link, this is used in logging to distinguish who is using this link. Can be null.
      linkNames - name of PV links to be established by this handler.
      listener - update listener
      propertyType - how to listen to links,c an be Record.PROPERTY_VALUE or Record.PROPERTY_ALARM
  • Method Details

    • getName

      public String getName()
      Returns the name of this links object.
      Returns:
      the name of this links object
    • activate

      public void activate(Database db)
      Activates links to database records or remote objects. But be called from activate method from Record or Application.
      Parameters:
      db - a Database object
    • deactivate

      public void deactivate()

      deactivate.

    • consume

      public ValueLinks.ValueHolder[] consume()
      Receives copy of array with received values. Values in array are in same order as link names. Resets consumed flag to true.
      Returns:
      copy of received values up to this point
    • consumeAsDoubles

      public double[] consumeAsDoubles()

      consumeAsDoubles.

      Returns:
      an array of
      invalid reference
      double
      objects
    • consumeAsLongs

      public long[] consumeAsLongs()

      consumeAsLongs.

      Returns:
      an array of
      invalid reference
      long
      objects
    • consumeAsLong

      public long consumeAsLong()

      consumeAsLong.

      Returns:
      a long
    • consumeAsBooleanAnd

      public boolean consumeAsBooleanAnd()

      consumeAsBooleanAnd.

      Returns:
      a boolean
    • getLastSeverity

      public gov.aps.jca.dbr.Severity getLastSeverity()

      Getter for the field lastSeverity.

      Returns:
      a Severity object
    • isLastSeverityInvalid

      public boolean isLastSeverityInvalid()

      isLastSeverityInvalid.

      Returns:
      a boolean
    • isLastSeverityHigh

      public boolean isLastSeverityHigh()

      isLastSeverityHigh.

      Returns:
      a boolean
    • getLastStatus

      public gov.aps.jca.dbr.Status getLastStatus()

      Getter for the field lastStatus.

      Returns:
      a Status object
    • isConsumed

      public boolean isConsumed()
      Returns true if after consume was called and no new values were delivered.
      Returns:
      true if after consume was called and no new values were delivered
    • resetConsumedFlag

      public void resetConsumedFlag()

      resetConsumedFlag.

    • isReady

      public boolean isReady()
      Return true when all values from all links has been received and there is no null in array of values.
      Returns:
      true when there is no more null among values
    • getNotConnected

      public String[] getNotConnected()

      getNotConnected.

      Returns:
      an array of String objects
    • isInvalid

      public boolean isInvalid()
      Returns true if some of the connection failed.
      Returns:
      true if some of the connection failed
    • printDebug

      public void printDebug(Appendable sb) throws IOException

      printDebug.

      Parameters:
      sb - a Appendable object
      Throws:
      IOException - if any.
    • fireUpdate

      protected void fireUpdate()

      fireUpdate.

    • copyMetaData

      public void copyMetaData(Record r)
      Copy meta data from this link representation to the provided record reference. If there is more than one link, first link is used.
      Parameters:
      r - the Record object for metadata to be copied to
    • copyMetaData

      public void copyMetaData(Record r, int link)
      Copy meta data from this link representation indicated by index to the provided record reference.
      Parameters:
      r - the Record object for metadata to be copied to
      link - the index of link to provide the data for copy
    • getMetaData

      public MetaData getMetaData(int link)

      getMetaData.

      Parameters:
      link - a int
      Returns:
      a MetaData object
    • setValue

      public void setValue(Object value) throws Exception

      setValue.

      Parameters:
      value - a Object object
      Throws:
      Exception - if any.
    • setValueToAll

      public void setValueToAll(double[] value) throws Exception

      setValueToAll.

      Parameters:
      value - an array of
      invalid reference
      double
      objects
      Throws:
      Exception - if any.
    • setValueToAll

      public void setValueToAll(Object value) throws Exception

      setValueToAll.

      Parameters:
      value - a Object object
      Throws:
      Exception - if any.
    • setValueToAll

      public void setValueToAll(Object value, boolean[] select) throws Exception

      setValueToAll.

      Parameters:
      value - a Object object
      select - an array of
      invalid reference
      boolean
      objects
      Throws:
      Exception - if any.
    • getValue

      public ValueLinks.ValueHolder[] getValue() throws Exception

      getValue.

      Returns:
      an array of ValueLinks.ValueHolder objects
      Throws:
      Exception - if any.
    • getLinkNames

      public String[] getLinkNames()

      Getter for the field linkNames.

      Returns:
      an array of String objects
    • toString

      public String toString()
      Overrides:
      toString in class Object