Interface PV

  • 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 Detail

      • getName

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

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

        void removeListener​(PVListener listener)
        Remove a listener.
        Parameters:
        listener - PVListener
      • 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.
      • getArchDBRTypes

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

        void markPVHasMetafields​(boolean hasMetaField)
        Making this PV as having metafields or not If the PV has metafields, then internal state is created to maintain the latest values of these metafields.
        Parameters:
        hasMetaField -  
      • setMetaFieldParentPV

        void setMetaFieldParentPV​(PV parentPV,
                                  boolean isRuntimeOnly)
        Set the "parent" PV for this meta field pv. The data from this PV is stored as a metafield in the parentPV.
        Parameters:
        parentPV - - Store data from this PV as a metafield in the parentPV.
        isRuntimeOnly - - Only store values in the runtime hashMaps.
      • updataMetaFieldValue

        void updataMetaFieldValue​(String pvName,
                                  String fieldValue)
        Update the value in the parent pv hashmaps for this field
        Parameters:
        pvName - this meta field pv 's name - this is the full PV names - for example, a:b:c.HIHI
        fieldValue - - this meta field pv's value as a string.
      • 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.