class TestGeneral(unittest.TestCase): def setUp(self): #run before each test self.FSW = VSA().jav_OpenTest(host) self.FSW.Init_ADemod() def tearDown(self): #Run after each test self.assertEqual(self.FSW.jav_Error()[0],'0') self.FSW.jav_Close() ############################################################################### ### <Test> ############################################################################### def test_FSW_ADemod(self): self.FSW.Set_Adem_dbw(3e6) self.FSW.Set_Adem_LPassStat('OFF') self.FSW.Set_Adem_LPassStat('ON') self.FSW.Set_Adem_LPassAbsolute('3kHz') self.FSW.Set_Adem_LPassManual(1e6) self.FSW.Set_Adem_LPassRelative('5PCT') getVal = self.FSW.Get_Adem_dbw() if self.FSW.connected: self.assertEqual(getVal, 3e6) def test_FSW_ADemod_PM(self): self.FSW.Set_Freq(28e9) # RF Freq self.FSW.Set_Adem_dbw(200e3) # Demod BW self.FSW.Set_Adem_Coupling('AC') # Coupling self.FSW.Set_Adem_PM_Unit('DEG') # Units self.FSW.Set_Adem_PM_Scale(4) # Y Scaling self.FSW.Set_Adem_PM_RefPos(50) # Phase Reference Position self.FSW.Set_Adem_PM_RefVal(1) # Phase Reference Value self.FSW.Set_In_YIG('ON') # YIG ON
class TestGeneral(unittest.TestCase): def setUp(self): #run before each test self.FSW = VSA().jav_OpenTest(host) self.FSW.Init_ADemod() def tearDown(self): #Run after each test self.assertEqual(self.FSW.jav_Error()[0],'0') self.FSW.jav_Close() ############################################################################### ### <Test> ############################################################################### def test_FSW_ADemod(self): self.FSW.Set_Adem_dbw(3e6) self.FSW.Set_Adem_LPassStat('OFF') self.FSW.Set_Adem_LPassStat('ON') self.FSW.Set_Adem_LPassAbsolute('3kHz') self.FSW.Set_Adem_LPassManual(1e6) self.FSW.Set_Adem_LPassRelative('5PCT') getVal = self.FSW.Get_Adem_dbw() if self.FSW.connected: self.assertEqual(getVal, 3e6)
SMW.Set_Ref_Source('EXT') # ExtReference SMW.Set_Ref_Freq('10MHZ') SMW.Set_Ref_SyncBW('WIDE') # Oscilator locking BW SMW.Set_RFState('ON') ############################################################################### ### FSW-Analog Demodulation ############################################################################### FSW.Set_Channel('ADEM') FSW.write('LAY:REPL:WIND "1","XTIM:PM"') # PM Demod window FSW.Set_SweepCont('OFF') # Single sweep FSW.Set_Ref_Source('INT') # Reference FSW.Set_Freq(28e9) # RF Freq FSW.Set_SweepTime(SwpTim/1000) # Sweep Time FSW.Set_Adem_dbw(DemodBW*1000) # Demod BW FSW.Set_Adem_Coupling('AC') # Coupling FSW.Set_Adem_PM_Unit('DEG') # Units FSW.Set_Adem_PM_Scale(4) # Y Scaling FSW.Set_Adem_PM_RefPos(50) # Phase Reference Position FSW.Set_Adem_PM_RefVal(1) # Phase Reference Value FSW.Set_Trace_AvgCount(1) # Average Count FSW.Set_In_YIG('ON') # YIG ON FSW.write('CALC:FEED "XTIM:PM:TDOM"') ############################################################################### ### Loop ############################################################################### FSW.Set_Mkr_AllOff() # All markers off for mkr in range(NumMkrs): # Create markers FSW.Set_Mkr_On(mkr+1)