diff --git a/Model/create_table_for_save_as.py b/Model/create_table_for_save_as.py index 96d0af5..bfcb2c0 100644 --- a/Model/create_table_for_save_as.py +++ b/Model/create_table_for_save_as.py @@ -104,7 +104,7 @@ class CreateTableForSaveAs: tmax_index INTEGER, tmax_value FLOAT, rmin_index INTEGER, rmin_value FLOAT, rmax_index INTEGER, rmax_value FLOAT, - freq_bottom_detection_index FLOAT, + freq_bottom_detection_index INTEGER, freq_bottom_detection_value STRING, depth_bottom_detection_min FLOAT, depth_bottom_detection_max FLOAT, @@ -455,9 +455,9 @@ class CreateTableForSaveAs: int(stg.rmax[i][0]), stg.rmax[i][1], stg.freq_bottom_detection[i][0], stg.freq_bottom_detection[i][1], - stg.depth_bottom_detection_min, - stg.depth_bottom_detection_max, - stg.depth_bottom_detection_interval, + stg.depth_bottom_detection_min[i], + stg.depth_bottom_detection_max[i], + stg.depth_bottom_detection_interval[i], stg.SNR_filter_value[i], stg.Nb_cells_to_average_BS_signal[i] ) diff --git a/Model/read_table_for_open.py b/Model/read_table_for_open.py index fa3292c..e18fb97 100644 --- a/Model/read_table_for_open.py +++ b/Model/read_table_for_open.py @@ -528,9 +528,9 @@ class ReadTableForOpen: stg.rmin.append((next(it), next(it))) stg.rmax.append((next(it), next(it))) stg.freq_bottom_detection.append((next(it), next(it))) - stg.depth_bottom_detection_min = next(it) - stg.depth_bottom_detection_max = next(it) - stg.depth_bottom_detection_interval = next(it) + stg.depth_bottom_detection_min.append(next(it)) + stg.depth_bottom_detection_max.append(next(it)) + stg.depth_bottom_detection_interval.append(next(it)) stg.SNR_filter_value.append(next(it)) stg.Nb_cells_to_average_BS_signal.append(next(it)) diff --git a/View/acoustic_data_tab.py b/View/acoustic_data_tab.py index 2b2be51..4064e3d 100644 --- a/View/acoustic_data_tab.py +++ b/View/acoustic_data_tab.py @@ -760,7 +760,6 @@ class AcousticDataTab(QWidget): self.water_attenuation() self.compute_tmin_tmax() self.compute_rmin_rmax() - self.set_range_for_spinboxes_bathymetry() self.combobox_ABS_system_choice.blockSignals(False) self.fileListWidget.blockSignals(False) @@ -1688,6 +1687,9 @@ class AcousticDataTab(QWidget): stg.val_bottom.append([]) stg.ind_bottom.append([]) stg.freq_bottom_detection.append((0, 0)) + stg.depth_bottom_detection_min.append(0.0) + stg.depth_bottom_detection_max.append(0.0) + stg.depth_bottom_detection_interval.append(0.0) stg.BS_mean.append(np.array([])) stg.BS_noise_raw_data.append(np.array([])) @@ -2826,28 +2828,41 @@ class AcousticDataTab(QWidget): self.lineEdit_slider.setText( str(stg.time[self.fileListWidget.currentRow()][self.combobox_frequency_profile.currentIndex(), self.slider.value()-1])) - + @trace def update_bottom_detection_settings(self): + data_id = max(0, self.fileListWidget.currentRow()) + + self.combobox_frequency_bathymetry.setCurrentIndex( + int(stg.freq_bottom_detection[data_id][0]) + ) + self.lineEdit_depth_min_bathy.setText( - str(stg.depth_bottom_detection_min) + str(stg.depth_bottom_detection_min[data_id]) ) self.lineEdit_depth_max_bathy.setText( - str(stg.depth_bottom_detection_max) + str(stg.depth_bottom_detection_max[data_id]) ) self.lineEdit_next_cell_bathy.setText( - str(stg.depth_bottom_detection_interval) + str(stg.depth_bottom_detection_interval[data_id]) ) def save_bottom_detection_settings(self): - stg.depth_bottom_detection_min = float( + data_id = max(0, self.fileListWidget.currentRow()) + + stg.freq_bottom_detection[data_id] = ( + int(self.combobox_frequency_bathymetry.currentIndex()), + str(self.combobox_frequency_bathymetry.currentText()), + ) + + stg.depth_bottom_detection_min[data_id] = float( self.lineEdit_depth_min_bathy.text() ) - stg.depth_bottom_detection_max = float( + stg.depth_bottom_detection_max[data_id] = float( self.lineEdit_depth_max_bathy.text() ) - stg.depth_bottom_detection_interval = float( + stg.depth_bottom_detection_interval[data_id] = float( self.lineEdit_next_cell_bathy.text() )