コード例 #1
0
    def __get_continuous_send_dialog(self):
        messages = [Message([True]*100, 1000, self.form.compare_frame_controller.active_message_type) for _ in range(10)]
        modulators = [Modulator("Test")]

        continuous_send_dialog = ContinuousSendDialogController(self.form.project_manager, messages, modulators,
                                                                self.form.generator_tab_controller.total_modulated_samples,
                                                                parent=self.form, testing_mode=True)
        if self.SHOW:
            continuous_send_dialog.show()

        return continuous_send_dialog
コード例 #2
0
    def __get_continuous_send_dialog(self):
        messages = [Message([True]*100, 1000, self.form.compare_frame_controller.active_message_type) for _ in range(10)]
        modulators = [Modulator("Test")]

        continuous_send_dialog = ContinuousSendDialogController(self.form.project_manager, messages, modulators,
                                                                self.form.generator_tab_controller.total_modulated_samples,
                                                                parent=self.form, testing_mode=True)
        if self.SHOW:
            continuous_send_dialog.show()

        return continuous_send_dialog
コード例 #3
0
    def __get_continuous_send_dialog(self):
        gframe = self.form.generator_tab_controller
        continuous_send_dialog = ContinuousSendDialogController(
            self.form.project_manager,
            gframe.table_model.protocol.messages,
            gframe.modulators,
            self.form.generator_tab_controller.total_modulated_samples,
            parent=self.form,
            testing_mode=True)
        if self.SHOW:
            continuous_send_dialog.show()

        return continuous_send_dialog
コード例 #4
0
    def on_btn_send_clicked(self):
        try:
            total_samples = self.total_modulated_samples
            buffer = self.prepare_modulation_buffer(total_samples)
            if buffer is not None:
                modulated_data = self.modulate_data(buffer)
            else:
                # Enter continuous mode
                modulated_data = None

            try:
                if modulated_data is not None:
                    try:
                        dialog = SendDialogController(
                            self.project_manager,
                            modulated_data=modulated_data,
                            modulation_msg_indices=self.modulation_msg_indices,
                            parent=self)
                    except MemoryError:
                        # Not enough memory for device buffer so we need to create a continuous send dialog
                        del modulated_data
                        Errors.not_enough_ram_for_sending_precache(None)
                        dialog = ContinuousSendDialogController(
                            self.project_manager,
                            self.table_model.protocol.messages,
                            self.modulators,
                            total_samples,
                            parent=self)
                else:
                    dialog = ContinuousSendDialogController(
                        self.project_manager,
                        self.table_model.protocol.messages,
                        self.modulators,
                        total_samples,
                        parent=self)
            except OSError as e:
                logger.error(repr(e))
                return
            if dialog.has_empty_device_list:
                Errors.no_device()
                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()