Sample data: Fix plot drawing at study open.

dev-brahim
Pierre-Antoine 2025-03-25 13:22:06 +01:00
parent 5f7c81f866
commit 1351d7e5fc
1 changed files with 23 additions and 13 deletions

View File

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