示例#1
0
    def __get_continuous_send_dialog(self):
        gframe = self.form.generator_tab_controller
        continuous_send_dialog = ContinuousSendDialog(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
示例#2
0
    def __get_continuous_send_dialog(self):
        gframe = self.form.generator_tab_controller
        continuous_send_dialog = ContinuousSendDialog(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
示例#3
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 = SendDialog(
                            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 = ContinuousSendDialog(
                            self.project_manager,
                            self.table_model.protocol.messages,
                            self.modulators,
                            total_samples,
                            parent=self)
                else:
                    dialog = ContinuousSendDialog(
                        self.project_manager,
                        self.table_model.protocol.messages,
                        self.modulators,
                        total_samples,
                        parent=self)
            except OSError as e:
                logger.exception(e)
                return
            if dialog.has_empty_device_list:
                Errors.no_device()
                dialog.close()
                return

            dialog.device_parameters_changed.connect(
                self.project_manager.set_device_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()