From 1351d7e5fca4e7bf55ee6054935581540923641b Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Tue, 25 Mar 2025 13:22:06 +0100 Subject: [PATCH] Sample data: Fix plot drawing at study open. --- View/sample_data_tab.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/View/sample_data_tab.py b/View/sample_data_tab.py index cf9128f..8697557 100644 --- a/View/sample_data_tab.py +++ b/View/sample_data_tab.py @@ -284,6 +284,10 @@ class SampleDataTab(QWidget): self.lineEdit_sand_sediment.setToolTip(stg.path_sand) self.fill_table_sand() + #self.plot_sample_position_on_transect() + self.plot_total_concentration() + self.plot_PSD_fine_and_sand_sediments() + self.blockSignals(False) def last_opened_file_path(self, priority="sand"): @@ -331,6 +335,10 @@ class SampleDataTab(QWidget): self.lineEdit_fine_sediment.setToolTip(stg.path_fine) self.fill_table_fine() + self.plot_sample_position_on_transect() + self.plot_total_concentration() + self.plot_PSD_fine_and_sand_sediments() + def open_dialog_box_sand_sediment(self): filename_sand_sediment = QFileDialog.getOpenFileName( self, "Sand sediment file", @@ -356,6 +364,10 @@ class SampleDataTab(QWidget): self.lineEdit_sand_sediment.setToolTip(stg.path_sand) self.fill_table_sand() + self.plot_sample_position_on_transect() + self.plot_total_concentration() + self.plot_PSD_fine_and_sand_sediments() + def load_fine_sediment_data(self): fine_granulo_data = GranuloLoader( os.path.join(stg.path_fine, stg.filename_fine) @@ -486,10 +498,6 @@ class SampleDataTab(QWidget): self.combobox_x_axis.currentIndexChanged.connect(self.plot_total_concentration) self.combobox_y_axis.currentIndexChanged.connect(self.plot_total_concentration) - self.plot_sample_position_on_transect() - self.plot_total_concentration() - self.plot_PSD_fine_and_sand_sediments() - self.tableWidget_fine.blockSignals(False) else: msgBox = QMessageBox() @@ -588,10 +596,6 @@ class SampleDataTab(QWidget): self.combobox_y_axis.currentIndexChanged\ .connect(self.plot_total_concentration) - self.plot_sample_position_on_transect() - self.plot_total_concentration() - self.plot_PSD_fine_and_sand_sediments() - self.tableWidget_sand.blockSignals(False) # --- Function to extract position of sample from table checkboxes to update plots --- @@ -752,13 +756,19 @@ class SampleDataTab(QWidget): self.combobox_acoustic_data.clear() for n, m in enumerate(stg.noise_method): if stg.noise_method[n] == 0: - self.combobox_acoustic_data.addItem(stg.filename_BS_raw_data[n]) - elif stg.noise_method[n]!=0: - self.combobox_acoustic_data.addItem(stg.data_preprocessed[n]) + self.combobox_acoustic_data\ + .addItem(stg.filename_BS_raw_data[n]) + elif stg.noise_method[n] != 0: + self.combobox_acoustic_data\ + .addItem(stg.data_preprocessed[n]) self.plot_sample_position_on_transect() - self.combobox_acoustic_data.currentIndexChanged.connect(self.update_plot_sample_position_on_transect) - self.combobox_frequencies.currentIndexChanged.connect(self.update_plot_sample_position_on_transect) + self.combobox_acoustic_data\ + .currentIndexChanged\ + .connect(self.update_plot_sample_position_on_transect) + self.combobox_frequencies\ + .currentIndexChanged\ + .connect(self.update_plot_sample_position_on_transect) def plot_sample_position_on_transect(self): self.verticalLayout_groupbox_plot_transect\