Acoustic data: Fix open study.

dev-brahim
Pierre-Antoine 2025-03-24 13:02:10 +01:00
parent 2e20b2f464
commit 413e8fb18e
8 changed files with 98 additions and 6 deletions

View File

@ -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))

View File

@ -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()

View File

@ -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()

View File

@ -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 = []

View File

@ -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

View File

@ -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 :

View File

@ -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)

24
main.py
View File

@ -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__':