Class EPICS_V3_PV

java.lang.Object
org.epics.archiverappliance.engine.pv.EPICS_V3_PV
All Implemented Interfaces:
gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.MonitorListener, EventListener, ControllingPV, PV

public class EPICS_V3_PV extends Object implements PV, ControllingPV, gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.MonitorListener
EPICS ChannelAccess implementation of the PV interface.
Version:
Initial version:CSS, 4-Jun-2012, Luofeng Li:added codes to support for the new archiver
Author:
Kay Kasemir
See Also:
  • Method Details

    • getHostName

      public String getHostName()
      Specified by:
      getHostName in interface PV
    • isEnableAllPV

      public boolean isEnableAllPV()
      Specified by:
      isEnableAllPV in interface ControllingPV
      Returns:
      the status of all pvs controlled by this pv
    • getArchDBRTypes

      public ArchDBRTypes getArchDBRTypes()
      Description copied from interface: PV
      get the archive DBR types for this pv
      Specified by:
      getArchDBRTypes in interface PV
      Returns:
      ArchDBRTypes  
      See Also:
    • getTotalMetaInfo

      public MetaInfo getTotalMetaInfo()
      get the meta info for this pv
      Specified by:
      getTotalMetaInfo in interface PV
      Returns:
      MetaInfo
    • addControledPV

      public void addControledPV(String pvName)
      Description copied from interface: ControllingPV
      add pv controlled by this pv
      Specified by:
      addControledPV in interface ControllingPV
      Parameters:
      pvName - The PV name
    • getName

      public String getName()
      Specified by:
      getName in interface PV
      Returns:
      Returns the name.
    • addListener

      public void addListener(PVListener listener)
      Add a new listener.
      Specified by:
      addListener in interface PV
      Parameters:
      listener - PVListener
      See Also:
    • removeListener

      public void removeListener(PVListener listener)
      Remove a listener.
      Specified by:
      removeListener in interface PV
      Parameters:
      listener - PVListener
    • start

      public void start() throws Exception
      Start the PV: connect, get meta data, subscribe to updates, invoke PVListener for incoming values, ...
      Specified by:
      start in interface ControllingPV
      Specified by:
      start in interface PV
      Throws:
      Exception -  
      See Also:
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface PV
      Returns:
      Returns true between start() and stop().
    • isConnected

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

      public PVConnectionState connectionState()
      Specified by:
      connectionState in interface PV
      Returns:
    • stop

      public void stop()
      Stop the PV: disconnect, ... When the PV is no longer needed, one should 'stop' it to release resources.
      Specified by:
      stop in interface ControllingPV
      Specified by:
      stop in interface PV
    • connectionChanged

      public void connectionChanged(gov.aps.jca.event.ConnectionEvent ev)
      ConnectionListener interface.
      Specified by:
      connectionChanged in interface gov.aps.jca.event.ConnectionListener
    • monitorChanged

      public void monitorChanged(gov.aps.jca.event.MonitorEvent ev)
      MonitorListener interface.
      Specified by:
      monitorChanged in interface gov.aps.jca.event.MonitorListener
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setMetaFieldParentPV

      public void setMetaFieldParentPV(EPICS_V3_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

      public 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.
    • markPVHasMetafields

      public 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 -  
    • getLowLevelChannelInfo

      public void getLowLevelChannelInfo(List<Map<String,String>> statuses)
      Description copied from interface: PV
      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
      Specified by:
      getLowLevelChannelInfo in interface PV
    • updateTotalMetaInfo

      public void updateTotalMetaInfo() throws IllegalStateException, gov.aps.jca.CAException
      Description copied from interface: PV
      Do a caget and update the metadata that is cached in the PV.
      Specified by:
      updateTotalMetaInfo in interface PV
      Throws:
      IllegalStateException -  
      gov.aps.jca.CAException -  
    • getLatestMetadata

      public HashMap<String,String> getLatestMetadata()
      Combine the metadata from various sources and return the latest copy.
      Specified by:
      getLatestMetadata in interface PV
      Returns:
      HashMap  
      See Also:
    • setDBEroperties

      public void setDBEroperties()
    • sampleWrittenIntoStores

      public void sampleWrittenIntoStores()
      Description copied from interface: PV
      This method is called each time the ArchiveChannel has written changed a DBRTimeEvent into the buffers.
      Specified by:
      sampleWrittenIntoStores in interface PV
    • aboutToWriteBuffer

      public void aboutToWriteBuffer(DBRTimeEvent lastEvent)
      Description copied from interface: PV
      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.
      Specified by:
      aboutToWriteBuffer in interface PV