def __get_spectrum_dialog(self): spectrum_dialog = SpectrumDialogController(self.form.project_manager, testing_mode=True, parent=self.form) if self.SHOW: spectrum_dialog.show() return spectrum_dialog
def on_show_spectrum_dialog_action_triggered(self): pm = self.project_manager r = SpectrumDialogController(pm, parent=self) if r.has_empty_device_list: Errors.no_device() r.close() return r.recording_parameters.connect(pm.set_recording_parameters) r.show()
def __get_spectrum_dialog(self): logger.debug("Creating Spectrum Dialog") tests.utils_testing.short_wait() spectrum_dialog = SpectrumDialogController(self.form.project_manager, testing_mode=True, parent=self.form) return spectrum_dialog
def setUp(self): constants.SETTINGS.setValue("NetworkSDRInterface", True) self.form = MainController() self.form.add_signalfile(get_path_for_data_file("esaver.complex")) self.signal = self.form.signal_tab_controller.signal_frames[0].signal self.gframe = self.form.generator_tab_controller self.form.ui.tabWidget.setCurrentIndex(2) project_manager = self.form.project_manager self.receive_dialog = ReceiveDialogController( project_manager.frequency, project_manager.sample_rate, project_manager.bandwidth, project_manager.gain, project_manager.device, testing_mode=True) self.send_dialog = SendDialogController( project_manager.frequency, project_manager.sample_rate, project_manager.bandwidth, project_manager.gain, project_manager.device, modulated_data=self.signal.data, testing_mode=True) self.send_dialog.graphics_view.show_full_scene(reinitialize=True) self.spectrum_dialog = SpectrumDialogController( project_manager.frequency, project_manager.sample_rate, project_manager.bandwidth, project_manager.gain, project_manager.device, testing_mode=True) self.sniff_dialog = ProtocolSniffDialogController( project_manager.frequency, project_manager.sample_rate, project_manager.bandwidth, project_manager.gain, project_manager.device, self.signal.noise_threshold, self.signal.qad_center, self.signal.bit_len, self.signal.tolerance, self.signal.modulation_type, testing_mode=True) self.dialogs = [ self.receive_dialog, self.send_dialog, self.spectrum_dialog, self.sniff_dialog ] QTest.qWait(250)
def on_spectrum_analyzer_link_activated(self, link: str): if link == "open_spectrum_analyzer": r = SpectrumDialogController(ProjectManager(None), parent=self) if r.has_empty_device_list: Errors.no_device() r.close() return r.recording_parameters.connect(self.set_recording_params_from_spectrum_analyzer_link) r.show()
def on_spectrum_analyzer_link_activated(self, link: str): if link == "open_spectrum_analyzer": r = SpectrumDialogController(freq=self.freq, bw=self.bandwidth, samp_rate=self.sample_rate, gain=self.gain, device="", parent=self) if r.has_empty_device_list: Errors.no_device() r.close() return r.recording_parameters.connect( self.set_recording_params_from_spectrum_analyzer_link) r.show()
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.connect(("127.0.0.1", port)) return sock def close_socket(sock): sock.shutdown(socket.SHUT_RDWR) sock.close() if __name__ == '__main__': app = QApplication(["test"]) main = MainController() port = get_free_port() dialog = SpectrumDialogController(ProjectManager(main)) dialog.showMaximized() dialog.ui.cbDevice.setCurrentText("Network SDR") dialog.device.set_server_port(port) dialog.ui.btnStart.click() p = Process(target=send_data, args=(port, )) p.daemon = True p.start() num_samples = 32768 frequency = 0.1 divisor = 200 pos = 0 app.exec_() p.terminate()
def setUp(self): constants.SETTINGS.setValue("NetworkSDRInterface", True) QTest.qWait(50) logger.debug("init form") self.form = MainController() logger.debug("initalized form") app.processEvents() QTest.qWait(75) logger.debug("Adding signalfile") self.form.add_signalfile(get_path_for_data_file("esaver.complex")) logger.debug("Added signalfile") app.processEvents() self.signal = self.form.signal_tab_controller.signal_frames[0].signal self.gframe = self.form.generator_tab_controller self.form.ui.tabWidget.setCurrentIndex(2) app.processEvents() QTest.qWait(100) project_manager = self.form.project_manager logger.debug("Creating Receive Dialog") self.receive_dialog = ReceiveDialogController(project_manager, testing_mode=True, parent=self.form) app.processEvents() QTest.qWait(50) logger.debug("Creating Send Dialog") self.send_dialog = SendDialogController( project_manager, modulated_data=self.signal.data, testing_mode=True, parent=self.form) self.send_dialog.graphics_view.show_full_scene(reinitialize=True) app.processEvents() QTest.qWait(50) logger.debug("Creating Spectrum Dialog") self.spectrum_dialog = SpectrumDialogController(project_manager, testing_mode=True, parent=self.form) app.processEvents() QTest.qWait(50) logger.debug("Creating Sniff Dialog") self.sniff_dialog = ProtocolSniffDialogController( project_manager, self.signal.noise_threshold, self.signal.qad_center, self.signal.bit_len, self.signal.tolerance, self.signal.modulation_type, testing_mode=True, parent=self.form) app.processEvents() QTest.qWait(50) logger.debug("Created Dialogs") self.dialogs = [ self.receive_dialog, self.send_dialog, self.spectrum_dialog, self.sniff_dialog ]