Exemplo n.º 1
0
    def on_btn_send_clicked(self):
        try:
            modulated_data = self.modulate_data()
            dialog = SendRecvDialogController(self.project_manager.frequency,
                                              self.project_manager.sample_rate,
                                              self.project_manager.bandwidth,
                                              self.project_manager.gain,
                                              self.project_manager.device,
                                              Mode.send,
                                              modulated_data=modulated_data,
                                              parent=self)
            if dialog.has_empty_device_list:
                Errors.no_device()
                dialog.close()
                return
            elif PluginManager().is_plugin_enabled(
                    "NetworkSDRInterface") and dialog.ui.cbDevice.count() == 1:
                Errors.network_sdr_send_is_elsewhere()
                dialog.close()
                return

            dialog.recording_parameters.connect(
                self.project_manager.set_recording_parameters)
            dialog.show()
            dialog.graphics_view.show_full_scene(reinitialize=True)
        except Exception as e:
            Errors.generic_error(self.tr("Failed to generate data"), str(e),
                                 traceback.format_exc())
            self.unsetCursor()
Exemplo n.º 2
0
    def setUp(self):
        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 = SendRecvDialogController(
            project_manager.frequency,
            project_manager.sample_rate,
            project_manager.bandwidth,
            project_manager.gain,
            project_manager.device,
            Mode.receive,
            testing_mode=True)

        self.send_dialog = SendRecvDialogController(
            project_manager.frequency,
            project_manager.sample_rate,
            project_manager.bandwidth,
            project_manager.gain,
            project_manager.device,
            Mode.send,
            modulated_data=self.signal.data,
            testing_mode=True)
        self.send_dialog.graphics_view.show_full_scene(reinitialize=True)

        self.spectrum_dialog = SendRecvDialogController(
            project_manager.frequency,
            project_manager.sample_rate,
            project_manager.bandwidth,
            project_manager.gain,
            project_manager.device,
            Mode.spectrum,
            testing_mode=True)

        self.dialogs = [
            self.receive_dialog, self.send_dialog, self.spectrum_dialog
        ]
Exemplo n.º 3
0
    def test_recv(self):
        rcv_dialog = SendRecvDialogController(433e6, 1e6, 500e3, 20, "USRP", Mode.receive, parent = self.form)
        rcv_dialog.ui.btnStart.click()
        QTest.qWait(100)

        timer = QTimer()
        timer.timeout.connect(self.__confirm_message_box)
        timer.start(100)

        while rcv_dialog.device_thread.isRunning():
            QTest.qWait(100)

        self.assertTrue(True)
Exemplo n.º 4
0
    def on_btn_replay_clicked(self):
        pmngr = self.project_manager
        dialog = SendRecvDialogController(pmngr.frequency, pmngr.sample_rate,
                                          pmngr.bandwidth, pmngr.gain, pmngr.device,
                                          Mode.send, modulated_data=self.signal.data, parent=self)
        if dialog.has_empty_device_list:
            Errors.no_device()
            dialog.close()
            return

        dialog.recording_parameters.connect(pmngr.set_recording_parameters)
        dialog.show()
Exemplo n.º 5
0
    def on_show_spectrum_dialog_action_triggered(self):
        pm = self.project_manager
        r = SendRecvDialogController(pm.frequency, pm.sample_rate,
                                     pm.bandwidth, pm.gain, pm.device,
                                     Mode.spectrum, parent=self)
        if r.has_empty_device_list:
            Errors.no_device()
            r.close()
            return

        r.recording_parameters.connect(pm.set_recording_parameters)
        r.show()
Exemplo n.º 6
0
    def show_spectrum_dialog(self):
        pm = self.project_manager
        r = SendRecvDialogController(pm.frequency, pm.sample_rate,
                                     pm.bandwidth, pm.gain, pm.device,
                                     Mode.spectrum, parent=self)
        if r.has_empty_device_list:
            Errors.no_device()
            r.close()
            return

        r.device_parameters_changed.connect(pm.set_device_parameters)
        r.show()
Exemplo n.º 7
0
    def show_record_dialog(self):
        pm = self.project_manager
        r = SendRecvDialogController(pm.frequency, pm.sample_rate,
                                     pm.bandwidth, pm.gain,
                                     pm.device, Mode.receive,
                                     parent=self)
        if r.has_empty_device_list:
            Errors.no_device()
            r.close()
            return

        r.recording_parameters.connect(pm.set_recording_parameters)
        r.files_recorded.connect(self.load_recorded_signals)
        r.show()
Exemplo n.º 8
0
    def on_spectrum_analyzer_link_activated(self, link: str):
        if link == "open_spectrum_analyzer":
            r = SendRecvDialogController(freq=self.freq,
                                         bw=self.bandwidth,
                                         samp_rate=self.sample_rate,
                                         gain=self.gain,
                                         device="",
                                         mode=Mode.spectrum,
                                         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 create_connects(self):
     SendRecvDialogController.create_connects(self)