From 660a09b09a9bb09fdbf055acdaac98fcf22d9a0b Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 16 Apr 2025 09:16:35 +0200 Subject: [PATCH] Sediment calibration: Update calibration in view at study open. --- Model/read_table_for_open.py | 14 +++++++------- View/sediment_calibration_tab.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/Model/read_table_for_open.py b/Model/read_table_for_open.py index 24e53e3..1776ec2 100644 --- a/Model/read_table_for_open.py +++ b/Model/read_table_for_open.py @@ -697,11 +697,11 @@ class ReadTableForOpen: stg.filename_calibration_file = next(it) stg.range_lin_interp = np_f64_parse(next(it)) stg.M_profile_fine = np_f64_parse(next(it)) - stg.ks = np_f64_parse(next(it)) - stg.sv = np_f64_parse(next(it)) + stg.ks = np_f64_parse(next(it)).tolist() + stg.sv = np_f64_parse(next(it)).tolist() stg.X_exponent = np_f64_parse(next(it)).tolist() - stg.alpha_s = np_f64_parse(next(it)) - stg.zeta = np_f64_parse(next(it)) - stg.FCB = np_f64_parse(next(it)) - stg.depth_real = np_f64_parse(next(it)) - stg.lin_reg = np_f64_parse(next(it)) + stg.alpha_s = np_f64_parse(next(it)).tolist() + stg.zeta = np_f64_parse(next(it)).tolist() + stg.FCB = np_f64_parse(next(it)).tolist() + stg.depth_real = np_f64_parse(next(it)).tolist() + stg.lin_reg = np_f64_parse(next(it)).tolist() diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index e271687..09139a3 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -867,6 +867,7 @@ class SedimentCalibrationTab(QWidget): self.function_pushbutton_update_acoustic_file() self._update_calibration_parameters() + self._update_calibration() self.function_pushbutton_plot_sample() self.blockSignals(False) @@ -893,12 +894,41 @@ class SedimentCalibrationTab(QWidget): self.combobox_sand_sample_choice\ .setCurrentIndex(stg.calib_sand_target) + self.update_label_freq1_for_calibration() + self.update_label_freq2_for_calibration() + self.update_label_kt_value_for_calibration() + self.combobox_sand_sample_choice.blockSignals(False) self.combobox_fine_sample_choice.blockSignals(False) self.combobox_freq2.blockSignals(False) self.combobox_freq1.blockSignals(False) self.combobox_acoustic_data_choice.blockSignals(False) + def _update_calibration(self): + self.groupbox_sediment_calibration_compute.blockSignals(True) + + if stg.filename_calibration_file == "": + self.groupbox_sediment_calibration_compute\ + .setChecked(True) + self.groupbox_sediment_calibration_import\ + .setChecked(False) + + self.lineEdit_ks_freq1.setText(f"{stg.ks[0]:.5f}") + self.lineEdit_ks_freq2.setText(f"{stg.ks[1]:.5f}") + + self.lineEdit_sv_freq1.setText(f"{stg.sv[0]:.5f}") + self.lineEdit_sv_freq2.setText(f"{stg.sv[1]:.5f}") + + self.lineEdit_X.setText(f"{stg.X_exponent[0]:.5f}") + + self.lineEdit_alphas_freq1.setText(f"{stg.alpha_s[0]:.5f}") + self.lineEdit_alphas_freq2.setText(f"{stg.alpha_s[1]:.5f}") + + self.lineEdit_zeta_freq1.setText(f"{stg.zeta[0]:.5f}") + self.lineEdit_zeta_freq2.setText(f"{stg.zeta[1]:.5f}") + + self.groupbox_sediment_calibration_compute.blockSignals(False) + def function_pushbutton_update_acoustic_file(self): if len(stg.data_preprocessed) == 0: return