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 Summary
Modifier and TypeMethodDescriptionvoidaboutToWriteBuffer(DBRTimeEvent lastEvent) This method is called each time the Write thread is about to write a batch of samples.voidaddListener(PVListener listener) Add a new listener.get the archive DBR types for this pvCombine the metadata from various sources and return the latest copy.voidgetLowLevelChannelInfo(List<Map<String, String>> statuses) Get any low level info as a displayable list; this is typically meant for debugging purposes..getName()Get the MetaInfo for this PV; used during initial MetaGet phasebooleanbooleanvoidremoveListener(PVListener listener) Remove a listener.voidThis method is called each time the ArchiveChannel has written changed a DBRTimeEvent into the buffers.voidstart()Start the PV: connect, get meta data, subscribe to updates, invokePVListenerfor incoming values, ...voidstop()Stop the PV: disconnect, ...voidDo a caget and update the metadata that is cached in the PV.
-
Method Details
-
getName
String getName()- Returns:
- Returns the name.
-
addListener
Add a new listener.- Parameters:
listener- PVListener- See Also:
-
removeListener
Remove a listener.- Parameters:
listener- PVListener
-
start
Start the PV: connect, get meta data, subscribe to updates, invokePVListenerfor 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
truebetweenstart()andstop().
-
isConnected
boolean isConnected()- Returns:
- Returns
truewhen connected. WhileisRunning, we are subscribed for value updates, but we might still be disconnected, at least temporarily.
-
connectionState
PVConnectionState connectionState()- Returns:
- Returns
truewhen connected. WhileisRunning, 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
Combine the metadata from various sources and return the latest copy.- Returns:
- HashMap
-
updateTotalMetaInfo
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
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
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.
-