예제 #1
0
    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)
예제 #2
0
 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)
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
    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)
예제 #6
0
 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)
예제 #7
0
    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)
예제 #8
0
    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)
예제 #9
0
    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)
예제 #10
0
    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)
예제 #11
0
    # 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