コード例 #1
0
ファイル: test_nsls2v2.py プロジェクト: ChannelFinder/hla
    def test_dcct_current_l0(self):
        self.assertGreater(ap.getCurrent(), 100.0)

        dccts = ap.getElements('dcct')
        self.assertEqual(len(dccts), 1)
        dcct = dccts[0]
        # current
        #pv = u'SR:C00-BI:G00{DCCT:00}CUR-RB'
        pv = PV_SR_DCCT
        vsrtag = 'aphla.sys.V2SR'
        self.assertEqual(dcct.name,    'dcct')
        #self.assertEqual(dcct.devname, 'DCCT')
        self.assertEqual(dcct.family,  'DCCT')
        self.assertEqual(len(dcct.pv()), 1)
        #self.assertEqual(dcct.pv(tag='aphla.eget'), [pv])
        self.assertEqual(dcct.pv(tag=vsrtag), [pv])
        #self.assertEqual(dcct.pv(tags=['aphla.eget', vsrtag]), [pv])

        self.assertIn('value', dcct.fields())
        self.assertGreater(dcct.value, 1.0)
        self.assertLess(dcct.value, 600.0)

        self.assertGreater(dcct.value, 1.0)
        self.assertGreater(ap.eget('DCCT', 'value', unitsys=None), 1.0)
        self.assertEqual(len(ap.eget('DCCT', ['value'], unitsys=None)), 1)
        self.assertGreater(ap.eget('DCCT', ['value'], unitsys=None)[0], 1.0)
コード例 #2
0
ファイル: test_nsls2v2.py プロジェクト: ChannelFinder/hla
    def test_eget(self):
        v, h = ap.eget('BPM', 'x', header=True)
        self.assertEqual(len(v), len(ap.getElements('BPM')))
        self.assertEqual(len(v), len(h))
        # a tuple of (name, 'x')
        self.assertEqual(len(h[0]), 2)

        v, h = ap.eget('BPM', ['x'], header=True)
        self.assertEqual(len(v), len(ap.getElements('BPM')))
        self.assertEqual(len(v), len(h))
        # a list [(name, 'x')]
        self.assertEqual(len(h[0]), 1)

        v, h = ap.eget('BPM', ['x', 'y', 'x'], header=True)
        self.assertEqual(len(v), len(ap.getElements('BPM')))
        self.assertEqual(len(v), len(h))
        # a list [(name, 'x')]
        self.assertEqual(len(h[0]), 3)
コード例 #3
0
ファイル: test_nsls2v2.py プロジェクト: ChannelFinder/hla
    def test_bpm_l0(self):
        bpms = ap.getElements('BPM')
        self.assertGreaterEqual(len(bpms), 180)

        bpm = bpms[0]
        #self.assertEqual(bpm.pv(field='xref'), [pvxbba, pvxgold])
        self.assertGreater(bpm.index, 1)
        self.assertFalse(bpm.virtual)
        self.assertEqual(bpm.virtual, 0)
        #self.assertEqual(len(bpm.value), 2)

        self.assertIn('x', bpm.fields())
        self.assertIn('y', bpm.fields())
        self.assertEqual(len(bpm.get(['x', 'y'])), 2)
        self.assertEqual(len(ap.eget('BPM', 'x')), len(bpms))
        self.assertEqual(len(ap.eget('BPM', ['x', 'y'])), len(bpms))

        self.assertGreater(ap.getDistance(bpms[0].name, bpms[1].name), 0.0)
コード例 #4
0
ファイル: test_nsls2v3bsrline.py プロジェクト: willrogers/hla
    def test_bpm_l0(self):
        bpms = ap.getElements("BPM")
        self.assertGreaterEqual(len(bpms), 180 * 3)

        for i in range(1, len(bpms)):
            self.assertGreater(bpms[i].sb, bpms[i - 1].sb)
            self.assertGreater(bpms[i].se, bpms[i - 1].se)

        bpm = bpms[0]
        # self.assertEqual(bpm.pv(field='xref'), [pvxbba, pvxgold])
        self.assertGreater(bpm.index, 1)
        self.assertFalse(bpm.virtual)
        self.assertEqual(bpm.virtual, 0)
        # self.assertEqual(len(bpm.value), 2)

        self.assertIn("x", bpm.fields())
        self.assertIn("y", bpm.fields())
        self.assertEqual(len(bpm.get(["x", "y"], unitsys=None)), 2)
        self.assertEqual(len(ap.eget("BPM", "x", unitsys=None)), len(bpms))
        self.assertEqual(len(ap.eget("BPM", ["x", "y"], unitsys=None)), len(bpms))

        self.assertGreater(ap.getDistance(bpms[0].name, bpms[1].name), 0.0)
コード例 #5
0
    def test_bpm_l0(self):
        bpms = ap.getElements('BPM')
        self.assertGreaterEqual(len(bpms), 180*3)

        for i in range(1, len(bpms)):
            self.assertGreater(bpms[i].sb, bpms[i-1].sb)
            self.assertGreater(bpms[i].se, bpms[i-1].se)

        bpm = bpms[0]
        #self.assertEqual(bpm.pv(field='xref'), [pvxbba, pvxgold])
        self.assertGreater(bpm.index, 1)
        self.assertFalse(bpm.virtual)
        self.assertEqual(bpm.virtual, 0)
        #self.assertEqual(len(bpm.value), 2)

        self.assertIn('x', bpm.fields())
        self.assertIn('y', bpm.fields())
        self.assertEqual(len(bpm.get(['x', 'y'], unitsys=None)), 2)
        self.assertEqual(len(ap.eget('BPM', 'x', unitsys=None)), len(bpms))
        self.assertEqual(len(ap.eget('BPM', ['x', 'y'], unitsys=None)), len(bpms))

        self.assertGreater(ap.getDistance(bpms[0].name, bpms[1].name), 0.0)