All Known Implementing Classes:
EPICS_V3_PV, EPICS_V4_PV

public interface PV
A control system PV.

When 'start'ed, the PV will attempt to connect or do whatever is needed to obtain the meta information like units, precision, ... Then it will subscribe to updates of the current value.

While the PVListener might receive events on a non-UI thread, all the calls to the PV should come from the UI thread to prevent possible deadlocks. (The JNI CA client has deadlocked when both UI and non-UI threads called into it at the 'same' time).

Version:
Initial version:CSS, 4-Jun-2012, Luofeng Li:added codes to support for the new archiver
Author:
Kay Kasemir
  • Method Details

    • getName

      String getName()
      Returns:
      Returns the name.
    • addListener

      void addListener(PVListener listener)
      Add a new listener.
      Parameters:
      listener - PVListener
      See Also:
    • removeListener

      void removeListener(PVListener listener)
      Remove a listener.
      Parameters:
      listener - PVListener
    • start

      void start() throws Exception
      Start the PV: connect, get meta data, subscribe to updates, invoke PVListener for incoming values, ...
      Throws:
      Exception -  
      See Also:
    • stop

      void stop()
      Stop the PV: disconnect, ... When the PV is no longer needed, one should 'stop' it to release resources.
    • isRunning

      boolean isRunning()
      Returns:
      Returns true between start() and stop().
    • isConnected

      boolean isConnected()
      Returns:
      Returns true when connected. While isRunning, we are subscribed for value updates, but we might still be disconnected, at least temporarily.
    • connectionState

      PVConnectionState connectionState()
      Returns:
      Returns true when connected. While isRunning, we are subscribed for value updates, but we might still be disconnected, at least temporarily.
    • getArchDBRTypes

      ArchDBRTypes getArchDBRTypes()
      get the archive DBR types for this pv
      Returns:
      ArchDBRTypes  
    • getLatestMetadata

      HashMap<String,String> getLatestMetadata()
      Combine the metadata from various sources and return the latest copy.
      Returns:
      HashMap  
    • updateTotalMetaInfo

      void updateTotalMetaInfo() throws IllegalStateException, gov.aps.jca.CAException
      Do a caget and update the metadata that is cached in the PV.
      Throws:
      IllegalStateException -  
      gov.aps.jca.CAException -  
    • getTotalMetaInfo

      MetaInfo getTotalMetaInfo()
      Get the MetaInfo for this PV; used during initial MetaGet phase
      Returns:
      MetaInfo  
    • getHostName

      String getHostName()
    • getLowLevelChannelInfo

      void getLowLevelChannelInfo(List<Map<String,String>> statuses)
      Get any low level info as a displayable list; this is typically meant for debugging purposes.. Add these to as key value pairs to the statuses
    • sampleWrittenIntoStores

      void sampleWrittenIntoStores()
      This method is called each time the ArchiveChannel has written changed a DBRTimeEvent into the buffers.
    • aboutToWriteBuffer

      void aboutToWriteBuffer(DBRTimeEvent lastEvent)
      This method is called each time the Write thread is about to write a batch of samples. The writer thread passes in the last sample of the previous batch of samples after buffer rotation.