diff --git a/View/acoustic_data_tab.py b/View/acoustic_data_tab.py index e54046f..0100bee 100644 --- a/View/acoustic_data_tab.py +++ b/View/acoustic_data_tab.py @@ -733,6 +733,27 @@ class AcousticDataTab(QWidget): # -------------------- Functions for Acoustic dataTab -------------------- + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + self.fileListWidget.blockSignals(True) + + self.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0]) + self.fileListWidget.addFilenames(stg.filename_BS_raw_data) + + self.fill_measurements_information_groupbox() + self.fill_table() + self.plot_backscattered_acoustic_signal_recording() + self.plot_profile() + self.update_frequency_combobox() + self.water_attenuation() + self.compute_tmin_tmax() + self.compute_rmin_rmax() + self.set_range_for_spinboxes_bathymetry() + + self.fileListWidget.blockSignals(False) + self.blockSignals(False) + def retranslate_acoustic_data_tab(self): self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION)) diff --git a/View/acoustic_inversion_tab.py b/View/acoustic_inversion_tab.py index ec13ce3..b898c21 100644 --- a/View/acoustic_inversion_tab.py +++ b/View/acoustic_inversion_tab.py @@ -21,6 +21,7 @@ # -*- coding: utf-8 -*- import os +import logging import numpy as np import pandas as pd from math import isinf @@ -50,6 +51,7 @@ from Model.acoustic_inversion_method_high_concentration import AcousticInversion _translate = QCoreApplication.translate +logger = logging.getLogger("acoused") class AcousticInversionTab(QWidget): @@ -369,6 +371,14 @@ class AcousticInversionTab(QWidget): # ------------------------------------ Functions for Acoustic Inversion Tab ---------------------------------------- # ================================================================================================================== + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + + # TODO: Update all widgets + + self.blockSignals(False) + def update_acoustic_data_choice(self): self.combobox_acoustic_data_choice.clear() diff --git a/View/note_tab.py b/View/note_tab.py index 62b2251..019d835 100644 --- a/View/note_tab.py +++ b/View/note_tab.py @@ -1,3 +1,5 @@ +import logging + from PyQt5.QtWidgets import ( QApplication, QWidget, QVBoxLayout, QHBoxLayout, QTextEdit, QPushButton, QSpacerItem, QSpinBox, @@ -8,6 +10,8 @@ from PyQt5.QtCore import Qt import settings as stg +logger = logging.getLogger("acoused") + class NoteTab(QWidget): ''' This class generates a enhanced notepad in Note Tab ''' @@ -130,6 +134,14 @@ class NoteTab(QWidget): ## ------------------------------- + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + + # TODO: Update all widgets + + self.blockSignals(False) + # def new_text(self): # window = self.ui_mainwindow.tab5 # window.show() diff --git a/View/sample_data_tab.py b/View/sample_data_tab.py index 85cb76f..d8400b8 100644 --- a/View/sample_data_tab.py +++ b/View/sample_data_tab.py @@ -272,6 +272,17 @@ class SampleDataTab(QWidget): self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT)) + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + + self.fill_comboboxes_and_plot_transect() + self.lineEdit_fine_sediment.setText(stg.filename_fine) + self.lineEdit_fine_sediment.setToolTip(stg.path_fine) + self.fill_table_fine() + + self.blockSignals(False) + def last_opened_file_path(self, priority="sand"): lst = [] diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index 19bf440..7f8b07e 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -857,6 +857,14 @@ class SedimentCalibrationTab(QWidget): # ----------------------------------- Functions for Signal processing Tab -------------------------------------- # ============================================================================================================== + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + + # TODO: Update all widgets + + self.blockSignals(False) + def function_pushbutton_update_acoustic_file(self): if len(stg.data_preprocessed) == 0: return diff --git a/View/signal_processing_tab.py b/View/signal_processing_tab.py index f845f0b..5182c46 100644 --- a/View/signal_processing_tab.py +++ b/View/signal_processing_tab.py @@ -516,6 +516,19 @@ class SignalProcessingTab(QWidget): # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + self.combobox_acoustic_data_choice.blockSignals(True) + + self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data) + + # self.recompute() + # self.replot() + + self.combobox_acoustic_data_choice.blockSignals(False) + self.blockSignals(False) + def update_SignalPreprocessingTab(self): """ The tab is updated in two cases : diff --git a/View/user_manual_tab.py b/View/user_manual_tab.py index 48e909b..0775f12 100644 --- a/View/user_manual_tab.py +++ b/View/user_manual_tab.py @@ -27,5 +27,10 @@ class UserManualTab(QWidget): # self.label_picture_theory.resize(np.int(pic.width()/100), np.int(pic.height()/100)) # self.verticalLayout_main.addWidget(self.label_picture_theory) + def full_update(self): + logger.debug(f"{__name__}: Update") + self.blockSignals(True) + # TODO: Update all widgets + self.blockSignals(False) diff --git a/main.py b/main.py index 8e83357..93ff65f 100644 --- a/main.py +++ b/main.py @@ -95,6 +95,15 @@ class MainApplication(QMainWindow): # self.user_manual_tab = UserManualTab(self.ui_mainwindow.tab7) + self.tabs = [ + self.acoustic_data_tab, + # self.signal_processing_tab, + # self.sample_data_tab, + # self.sediment_calibration_tab, + # self.acoustic_inversion_tab, + # self.note_tab + ] + # ************************************************** # ---------------- Text File Error ----------------- @@ -108,14 +117,17 @@ class MainApplication(QMainWindow): # traceback.TracebackException.from_exception(e).print(file=sortie) def open_study_update_tabs(self): - self.acoustic_data_tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0]) - self.acoustic_data_tab.fileListWidget.addFilenames(stg.filename_BS_raw_data) + for tab in self.tabs: + tab.full_update() - self.signal_processing_tab.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data) + # self.acoustic_data_tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0]) + # self.acoustic_data_tab.fileListWidget.addFilenames(stg.filename_BS_raw_data) - self.sample_data_tab.fill_comboboxes_and_plot_transect() - self.sample_data_tab.lineEdit_fine_sediment.setText(stg.filename_fine) - self.sample_data_tab.lineEdit_fine_sediment.setToolTip(stg.path_fine) + # self.signal_processing_tab.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data) + + # self.sample_data_tab.fill_comboboxes_and_plot_transect() + # self.sample_data_tab.lineEdit_fine_sediment.setText(stg.filename_fine) + # self.sample_data_tab.lineEdit_fine_sediment.setToolTip(stg.path_fine) # self.sample_data_tab.fill_table_fine() if __name__ == '__main__':