public class EPICSv3PV extends Object implements PV, gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.MonitorListener
PV| Constructor and Description |
|---|
EPICSv3PV(String name)
Generate an EPICS PV.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PVListener listener)
Add a new listener.
|
void |
blockUntilFirstUpdate(int timeout)
The calling thread will be blocked until the first update is received from the PV.
|
void |
connectionChanged(gov.aps.jca.event.ConnectionEvent ev) |
protected void |
finalize() |
String |
getName()
Return the name of this PV.
|
String |
getStateInfo()
Internal state information on the PV.
|
IValue |
getValue()
Get the value.
|
IValue |
getValue(double timeoutSeconds)
Synchronous 'get'.
|
boolean |
isConnected()
Returns true if this PV is connected or false otherwise.
|
boolean |
isRunning()
Returns true if this PV has been started and not yet stopped.
|
boolean |
isWriteAllowed()
Returns true if we have write access to the PV or false if we cannot write to the PV.
|
void |
monitorChanged(gov.aps.jca.event.MonitorEvent ev) |
void |
removeListener(PVListener listener)
Remove a listener.
|
void |
setValue(Object newValue)
Set PV to given value.
|
void |
start()
Start the PV: connect, get meta data, subscribe to updates, invoke
PVListener for incoming values, ... |
void |
stop()
Stop the PV: disconnect, ...
|
String |
toString() |
public EPICSv3PV(String name)
name - The PV name.protected void finalize()
throws Throwable
public IValue getValue(double timeoutSeconds) throws PVException
PVAttempts to get a value within the given timeout. Either returns a value within the timeout, or throws an exception at the timeout.
When called for a new channel, i.e. on a channel where neither get nor start have been
called, it will also perform the connection attempt, and leave the channel connected after getting a value. To
force a disconnect, call stop.
getValue in interface PVtimeoutSeconds - timeout in secondsPVException - on errorpublic IValue getValue()
PV
This is the most recent value. Check isConnected() to see if this is valid, or use inside a
PVListener.pvValueUpdate(PV).
public void addListener(PVListener listener)
PVaddListener in interface PVlistener - the listener to addpublic void removeListener(PVListener listener)
PVremoveListener in interface PVlistener - the listener to removepublic void start()
throws PVException
PVPVListener for incoming values, ...start in interface PVPVException - if an error occurs during connectionpublic boolean isRunning()
PVpublic boolean isConnected()
PVisConnected in interface PVtrue when connected. While isRunning, we are subscribed for value updates, but
we might still be disconnected, at least temporarily.public boolean isWriteAllowed()
PVisWriteAllowed in interface PVtrue if we have write access to the PVpublic String getStateInfo()
PV
Especially when isConnected() is false, this information might help to diagnose the
problem: Did the PV never connect? Was it once connected, but some error occurred?
getStateInfo in interface PVpublic void stop()
PVpublic void setValue(Object newValue) throws PVException
PVDouble, Double[], Integer,
String, maybe more.setValue in interface PVnewValue - Value to write to PVPVException - on errorpublic void connectionChanged(gov.aps.jca.event.ConnectionEvent ev)
connectionChanged in interface gov.aps.jca.event.ConnectionListenerpublic void monitorChanged(gov.aps.jca.event.MonitorEvent ev)
monitorChanged in interface gov.aps.jca.event.MonitorListenerpublic void blockUntilFirstUpdate(int timeout)
throws PVException
PVblockUntilFirstUpdate in interface PVtimeout - the maximum timeout to wait for the update in millisecondsPVException - if no value was received in the specified timeoutCopyright © 2023 European Spallation Source. All rights reserved.