From ff019e511721427bdf47c44e59fedbe990fab851 Mon Sep 17 00:00:00 2001 From: brahim Date: Tue, 5 Sep 2023 14:04:29 +0200 Subject: [PATCH] Push button is added to print settings --- View/note_tab.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/View/note_tab.py b/View/note_tab.py index 244cf80..fc5573b 100644 --- a/View/note_tab.py +++ b/View/note_tab.py @@ -5,6 +5,7 @@ from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QTe from PyQt5.QtGui import QPixmap, QIcon, QFont from PyQt5.QtCore import Qt +import settings as stg class NoteTab(QWidget): @@ -25,7 +26,7 @@ class NoteTab(QWidget): self.filename_text = "" self.pushbutton_new_txt = QPushButton() - self.icon_new_txt = QPixmap(path_icon + "new_txt.png") + self.icon_new_txt = QPixmap(path_icon + "new_text.png") self.pushbutton_new_txt.setIcon(QIcon(self.icon_new_txt)) # self.pushbutton_new_txt.clicked.connect(self.new_text) self.horizontalLayout_toolbar.addWidget(self.pushbutton_new_txt) @@ -116,6 +117,11 @@ class NoteTab(QWidget): self.horizontalSpacerItem_toolbar_note_tab = QSpacerItem(500, 10, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_toolbar.addItem(self.horizontalSpacerItem_toolbar_note_tab) + self.pushbutton_print_settings = QPushButton() + self.pushbutton_print_settings.setText("EDIT SETTINGS") + self.pushbutton_print_settings.clicked.connect(self.print_settings) + self.verticalLayout_main_note_tab.addWidget(self.pushbutton_print_settings) + self.verticalLayout_main_note_tab.addWidget(self.textEdit) ## ------------------------------- @@ -182,6 +188,25 @@ class NoteTab(QWidget): def alignJustify(self): self.textEdit.setAlignment(Qt.AlignJustify) + def print_settings(self): + print(int(stg.frequencies_pair[0, 0])) + + self.textEdit.setText("Acoustic data: \n\n" + f" ABS raw data file: {stg.path_BS_raw_data}/{stg.filename_BS_raw_data} \n" + f" ABS noise data file: {stg.path_BS_noise_data}/{stg.filename_BS_noise_data} \n" + "\n\n" + "------------------------------------------------------------------------- \n\n\n" + + "Particle size data: \n" + f" Fine sediments data file: {stg.fine_sediment_path}/{stg.fine_sediment_filename} \n" + f" Sand sediments data file: {stg.sand_sediment_path}/{stg.sand_sediment_filename} \n" + "\n\n" + "------------------------------------------------------------------------- \n\n\n" + + "Acoustic Inversion parameters: \n" + f" frequencies to compute VBI: {stg.freq_text[int(stg.frequencies_pair[0, 0])]}, {stg.freq_text[int(stg.frequencies_pair[1, 0])]} \n" + f" frequency to compute SSC: {stg.freq_text[int(stg.frequency_to_compute_SSC[0])]}") + # if __name__ == "__main__": # app = QApplication(sys.argv)