def _set_value(self, value, timestamp=None): if isinstance(value, cas.gdd): info = self._gdd_to_dict(value) self._timestamp = info['timestamp'] self._value = info['value'] self._status = info['status'] self._severity = info['severity'] else: gdd = cas.gdd() gdd.setPrimType(self._ca_type) if timestamp is None: timestamp = cas.epicsTimeStamp() self._timestamp = timestamp self._value = value self._status, self._severity = self.check_alarm() if not self._interest: return self._gdd_set_value(gdd) # Notify clients of the update self.postEvent(self._mask, gdd) self._mask = cas.DBE_VALUE | cas.DBE_LOG
def _set_value(self, value, timestamp=None): if isinstance(value, cas.gdd): gdd = value info = self._gdd_to_dict(gdd) self._timestamp = info['timestamp'] self._value = info['value'] self._status = info['status'] self._severity = info['severity'] else: gdd = cas.gdd() gdd.setPrimType(self._ca_type) if timestamp is None: timestamp = cas.epicsTimeStamp() self._timestamp = timestamp self._value = value self._status, self._severity = self.check_alarm() self._gdd_set_value(gdd) if self._interest: # Notify clients of the update self.postEvent(self._mask, gdd)
def __init__(self, data): """Constructor Args: data (string): The initial data held in the PV """ super(DynamicStringPV, self).__init__() self.stored_value = cas.gdd() self.stored_value.setPrimType(cas.aitEnumUint8) self.stored_value.put(data)
def test_copy(self): d = cas.gdd() d.put([1, 2, 3, 4]) self.s.put(d) self.assertEqual(self.s.get(), [1, 2, 3, 4])
def setUp(self): self.s = cas.gdd()
from pcaspy.cas import gdd import time while True: gddValue = gdd() gddValue.put(range(1000000)) v = gddValue.get() gddCtrl = gdd.createDD(34) # gddAppType_dbr_ctrl_double gddCtrl[1].put('eV') gddCtrl[2].put(0) gddCtrl[3].put(1) gddCtrl[4].put(0) gddCtrl[5].put(1) gddCtrl[6].put(0) gddCtrl[7].put(1) gddCtrl[8].put(0) gddCtrl[9].put(1) gddCtrl[10].put(3) gddCtrl[11].put(gddValue) time.sleep(0.1)