Class IPV

java.lang.Object
org.yamcs.studio.data.IPV

public class IPV extends Object
  • Method Details

    • addListener

      public void addListener(IPVListener listener)
      Add a listener to the PV, which will be notified on events of the PV in the given notify thread.
    • removeListener

      public void removeListener(IPVListener listener)
    • getName

      public String getName()
    • getValue

      public VType getValue()
      Get the most recent value of the PV in last update cycle that has values. VTypeHelper and ValueUtil can be used to get the number or string value, alarm, display, time stamp etc. from the VType value and help to format the value.
      Returns:
      value of the PV. Will be null if the PV is not started or connected. It can also be null even the PV is connected. For example, the value is not a VType, not prepared yet or it has null as the initial value.
    • isConnected

      public boolean isConnected()
      Returns the 'connection' state of an individual PV. If the PV is an aggregate of multiple PVs, the connection state should be determined by the aggregator. For example, the aggregator countConnected(pv1, pv2, pv3,) should always return connected.
    • notifyConnectionChange

      public void notifyConnectionChange()
    • notifyValueChange

      public void notifyValueChange()
    • notifyWritePermissionChange

      public void notifyWritePermissionChange()
    • isStarted

      public boolean isStarted()
      If the start() has been called but stop() has not been called. This method tells nothing if the pv is connected. To see if the PV is connected use isConnected().
      Returns:
      true if the pv is started but not stopped.
    • isWriteAllowed

      public boolean isWriteAllowed()
      Returns:
      true if the PV is connected and allowed to write.
    • setValue

      public void setValue(Object value)
      Set PV to a given value asynchronously. It will return immediately. Should accept number, number array, String, maybe more.
    • setInvalid

      public void setInvalid()
    • setValue

      public boolean setValue(Object value, int timeout) throws Exception
      Set PV to a given value synchronously. It will block the current thread until write operation was submitted or timeout. Note that this call will only issue the write request, it will not await a put-callback to indicate complete processing of a write on the server.
      Parameters:
      value - Value to write to the PV It is not necessary to call start() before calling this method, because it will handle the connection with timeout in this method. Should accept number, number array, String, maybe more.
      timeout - timeout in millisecond for both pv connection and write operation, so in very rare case, it could take maximum 2*timeout ms for the timeout.
      Returns:
      true if write successful or false otherwise.
      Throws:
      Exception
    • start

      public void start()
      Start to connect and listen on the PV. To start an already started PV will get an IllegalStateException.
    • stop

      public void stop()
      Close the connection while keeping all listeners, so when it is restarted, it will work as before. When the PV is no longer needed, one should stop it to release resources. To stop an already stopped PV or not started PV will do nothing but log a warning message.
    • toString

      public String toString()
      Overrides:
      toString in class Object