예제 #1
0
파일: test_top.py 프로젝트: nunb/shinysdr
 def test_monitor_source_switch(self):
     freq1 = 1e6
     freq2 = 2e6
     # TODO: Also test signal type switching (not yet supported by SimulatedDevice)
     top = Top(devices={
         's1': simulate.SimulatedDevice(freq=freq1),
         's2': simulate.SimulatedDevice(freq=freq2),
     })
     top.set_source_name('s1')
     self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq1)
     top.set_source_name('s2')
     self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq2)
예제 #2
0
 def test_monitor_source_switch(self):
     freq1 = 1e6
     freq2 = 2e6
     # TODO: Also test signal type switching (not yet supported by SimulatedDevice)
     top = Top(
         devices={
             's1': simulate.SimulatedDevice(freq=freq1),
             's2': simulate.SimulatedDevice(freq=freq2),
         })
     top.set_source_name('s1')
     self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq1)
     top.set_source_name('s2')
     self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq2)
예제 #3
0
	def test_source_switch_update(self):
		'''
		Regression test: Switching sources was not updating receiver input frequency.
		'''
		top = Top(sources={
			's1': simulate.SimulatedSource(freq=0),
			's2': simulate.SimulatedSource(freq=1e6),
		})
		top.set_source_name('s1')
		(_, receiver) = top.add_receiver('AM', key='a')
		receiver.set_rec_freq(1e6)
		self.assertFalse(receiver.get_is_valid())
		top.set_source_name('s2')
		self.assertTrue(receiver.get_is_valid())
예제 #4
0
파일: test_top.py 프로젝트: nunb/shinysdr
 def test_receiver_device_default(self):
     '''
     Receiver should default to the monitor device, not other receiver's device.
     '''
     top = Top(devices={
         's1': simulate.SimulatedDevice(),
         's2': simulate.SimulatedDevice(),
     })
     
     (_key, receiver1) = top.add_receiver('AM', key='a')
     top.set_source_name('s2')
     receiver1.set_device_name('s1')
     (_key, receiver2) = top.add_receiver('AM', key='b')
     self.assertEquals(receiver2.get_device_name(), 's2')
     self.assertEquals(receiver1.get_device_name(), 's1')
예제 #5
0
    def test_receiver_device_default(self):
        """
        Receiver should default to the monitor device, not other receiver's device.
        """
        top = Top(devices={
            's1': simulate.SimulatedDevice(),
            's2': simulate.SimulatedDevice(),
        })

        (_key, receiver1) = top.add_receiver('AM', key='a')
        top.set_source_name('s2')
        receiver1.set_device_name('s1')
        (_key, receiver2) = top.add_receiver('AM', key='b')
        self.assertEquals(receiver2.get_device_name(), 's2')
        self.assertEquals(receiver1.get_device_name(), 's1')
예제 #6
0
 def test_source_switch_update(self):
     '''
     Regression test: Switching sources was not updating receiver input frequency.
     '''
     freq = 1e6
     top = Top(devices={
         's1': simulate.SimulatedDevice(freq=0),
         's2': simulate.SimulatedDevice(freq=freq),
     })
     top.set_source_name('s1')
     self.assertEqual(top.monitor.get_fft_info()[0], 0)
     
     (_key, receiver) = top.add_receiver('AM', key='a')
     receiver.set_rec_freq(freq)
     self.assertFalse(receiver.get_is_valid())
     
     top.set_source_name('s2')
     # TODO: instead of top.monitor, should go through state interface
     self.assertEqual(top.monitor.get_fft_info()[0], freq)
     self.assertTrue(receiver.get_is_valid())
예제 #7
0
 def test_source_switch_update(self):
     '''
     Regression test: Switching sources was not updating receiver input frequency.
     '''
     freq = 1e6
     top = Top(devices={
         's1': simulate.SimulatedDevice(freq=0),
         's2': simulate.SimulatedDevice(freq=freq),
     })
     top.set_source_name('s1')
     self.assertEqual(top.monitor.get_fft_info()[0], 0)
     
     (_key, receiver) = top.add_receiver('AM', key='a')
     receiver.set_rec_freq(freq)
     self.assertFalse(receiver.get_is_valid())
     
     top.set_source_name('s2')
     # TODO: instead of top.monitor, should go through state interface
     self.assertEqual(top.monitor.get_fft_info()[0], freq)
     self.assertTrue(receiver.get_is_valid())