From 0ce60afd0409a9e26ccb67c7c9709334586fc87c Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Mon, 10 Mar 2025 15:17:19 +0100 Subject: [PATCH] Sediment calibration: Skip crash compute button without data. --- View/sediment_calibration_tab.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index f19d770..bb400c3 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -1559,7 +1559,7 @@ class SedimentCalibrationTab(QWidget): # Variable 'stg.sand_sample_target_indice' is set only at # 'plot sample' button click if len(stg.sand_sample_target_indice) == 0: - self.interpolate_data_validity_message_box() + self._data_validity_message_box() return data_choice = self.combobox_acoustic_data_choice\ @@ -1642,7 +1642,7 @@ class SedimentCalibrationTab(QWidget): self.plot_profile_of_concentration_fine() - def interpolate_data_validity_message_box(self): + def _data_validity_message_box(self): msgBox = QMessageBox() msgBox.setWindowTitle("Interpolate (step 2)") msgBox.setIconPixmap( @@ -1911,6 +1911,9 @@ class SedimentCalibrationTab(QWidget): axis=1)) def function_pushbutton_compute_calibration(self): + if len(stg.sand_sample_target_indice) == 0: + self._data_validity_message_box() + return self.label_temperature.clear() self.label_temperature.setText("T = " + str(stg.temperature) + " °C")