|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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).
Method Summary | |
---|---|
void |
addListener(PVListener listener)
Add a new listener. |
java.lang.String |
getName()
|
java.lang.String |
getStateInfo()
Internal state information on the PV. |
IValue |
getValue()
Get the value. |
IValue |
getValue(double timeout_seconds)
Synchronous 'get'. |
boolean |
isConnected()
|
boolean |
isRunning()
|
boolean |
isWriteAllowed()
|
void |
removeListener(PVListener listener)
Remove a listener. |
void |
setValue(java.lang.Object new_value)
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, ... |
Method Detail |
---|
java.lang.String getName()
IValue getValue(double timeout_seconds) throws java.lang.Exception
Attempts 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
.
timeout_seconds
- Timeout in seconds.
java.lang.Exception
- on errorvoid addListener(PVListener listener)
PVListener
void removeListener(PVListener listener)
void start() throws java.lang.Exception
PVListener
for incoming values, ...
java.lang.Exception
addListener(PVListener)
,
stop()
boolean isRunning()
true
between start()
and stop()
.boolean isConnected()
true
when connected.
While isRunning
, we are subscribed for value updates,
but we might still be disconnected, at least temporarily.boolean isWriteAllowed()
true
if we have write access to the PVjava.lang.String getStateInfo()
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?
void stop()
IValue getValue()
This is the most recent value. Check isConnected() to see if this is valid, or use inside a PV listener's value update.
null
if there is none.PVListener
,
isConnected()
void setValue(java.lang.Object new_value) throws java.lang.Exception
Double
, Double[]
,
Integer
,
String
, maybe more.
new_value
- Value to write to PV
java.lang.Exception
- on error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |