DChan class - femanov/pycx4 GitHub Wiki
Inheritance chain: CdaObject -> BaseChan -> DChan
This class is single double value performance optimized channel. Instances of this class registers required cda events to track time/value of selected control system channel. You can get information about channel trough it's properties. All the properties are read-only. It's an error if you try to assign properties If you need a notifications use instance signals.
properties:
inherited:
int max_nelems - max number of elements = 1
cda_dataref_t ref - cda channel's id
cxdtype_t dtype - cx data type
str name - channel name (not full)
object context - context
int64 time - server-provided time of last value, us from UNIX epoch
int64 prev_time - server-provided time of previous value, us from UNIX epoch
size_t itemsize - value size, bytes
self-defined:
double val - last-known value
double prev_val - previous value
double tolerance - channel tolerance
Methods:
__cinit__(self, str name, object context=None)
__str__(self)
setValue(self, double value)
- request to set channel value
setTolerance(self, double new_tolerance)
- set channel change Tolerance, if abs(val - prev_val) > tolerance then value changed.
Signals:
valueMeasured(self)
- emitted when new value arrived
valueChanged(self)
- emitted when value changed
Signals can be Signal
or pyqtSignal
depending on what you use pycda or cda.
sdchan don't inherit Qobject in qcda, encapsulation is used to bring pyqtSignals to
channel-like classes. Instance that emitted a signal will be passed as only argument to
connected functions.
Double in methods means that what ever you give will be casted to double. If it's not possible it's an error.