def test_access_callback(self): epicsArgs = {} def accessCB(args): epicsArgs.update(args) status, chid = ca.create_channel(self.chanName) self.assertNormal(status) status = ca.replace_access_rights_event(chid, accessCB) self.assertNormal(status) ca.pend_io(10) self.assertEqual(epicsArgs['read_access'], 1) self.assertEqual(epicsArgs['write_access'], 1) status = ca.replace_access_rights_event(chid) status = ca.clear_channel(chid) self.assertNormal(status)
def test_get(self): status, dbrValue = ca.get(self.chid, chtype=self.dbrType, use_numpy=self.use_numpy) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) value = dbrValue.get() self.checkValue(value)
def setUp(self): status, chid = ca.create_channel(self.chanName) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) self.assertTrue(ca.state(chid) == ca.cs_conn) self.chid = chid
def setUp(self): status, chid = ca.create_channel(self.chanName) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) self.assertTrue(ca.state(chid) == ca.cs_conn) self.chid = chid
def test_access_callback(self): epicsArgs = {} def accessCB(args): epicsArgs.update(args) status, chid = ca.create_channel(self.chanName) self.assertNormal(status) status = ca.replace_access_rights_event(chid, accessCB) self.assertNormal(status) ca.pend_io(10) self.assertEqual(epicsArgs['read_access'], 1) self.assertEqual(epicsArgs['write_access'], 1) status = ca.replace_access_rights_event(chid) status = ca.clear_channel(chid) self.assertNormal(status)
def test_get(self): status, dbrValue = ca.get(self.chid, chtype=self.dbrType, use_numpy=self.use_numpy) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) value = dbrValue.get() self.checkValue(value)
def setUp(self): for channel in self.channels: _, chanName, dbrType, value, _ = channel status, chid = ca.create_channel(chanName) self.assertNormal(status) channel[0] = chid status = ca.pend_io(30) self.assertNormal(status) status, self.gid = ca.sg_create() self.assertNormal(status)
def test_put(self): status = ca.put(self.chid, self.value, chtype=self.dbrType, count=self.count) self.assertNormal(status) status = ca.flush_io() self.assertNormal(status) status, dbrValue = ca.get(self.chid, chtype=self.dbrType, count=self.count) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) value = dbrValue.get() self.assertValueEqual(value, self.readback)
def setUp(self): for channel in self.channels: _, chanName, dbrType, value, _ = channel status, chid = ca.create_channel(chanName) self.assertNormal(status) channel[0] = chid status = ca.pend_io(30) self.assertNormal(status) status, self.gid = ca.sg_create() self.assertNormal(status)
def test_put(self): status = ca.put(self.chid, self.value, chtype=self.dbrType, count=self.count) self.assertNormal(status) status = ca.flush_io() self.assertNormal(status) status, dbrValue = ca.get(self.chid, chtype=self.dbrType, count=self.count) self.assertNormal(status) status = ca.pend_io(10) self.assertNormal(status) value = dbrValue.get() self.assertValueEqual(value, self.readback)
# print output as table printer = TablePrinter(30, 15, 15) printer.print_line('channel', 'IOC', 'database') printer.print_separator() for record in db.values(): if rtyps and record.rtyp not in rtyps: continue # issue connect requests and wait for connection chans = {} for field in record.fields: chan = CaChannel(record.name + '.' + field) chan.search() chans[field] = chan ca.pend_io(10) # issue read requests and wait for completion for chan in chans.values(): chan.array_get(ca.dbf_type_to_DBR_CTRL(chan.field_type())) ca.pend_io(10) # compare and print all_consistent = True for field, chan in chans.items(): # get configured value config_value = record.fields[field] # skip those with empty config values if config_value == '': continue