Corrections have been made when the user close the file dialog, to download a file (or select a directory), without selecteting a file (or a folder).
parent
111bc21d5a
commit
a62895d8ad
|
|
@ -607,12 +607,14 @@ class SampleDataTab(QWidget):
|
||||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
msgBox.exec()
|
msgBox.exec()
|
||||||
else:
|
else:
|
||||||
|
self.lineEdit_fine_sediment.clear()
|
||||||
self.lineEdit_fine_sediment.setText(stg.filename_fine)
|
self.lineEdit_fine_sediment.setText(stg.filename_fine)
|
||||||
self.lineEdit_fine_sediment.setToolTip(stg.path_fine)
|
self.lineEdit_fine_sediment.setToolTip(stg.path_fine)
|
||||||
self.fill_table_fine()
|
self.fill_table_fine()
|
||||||
|
|
||||||
# --- Function to select directory and file name of sand sediments sample data ---
|
# --- Function to select directory and file name of sand sediments sample data ---
|
||||||
def open_dialog_box_sand_sediment(self):
|
def open_dialog_box_sand_sediment(self):
|
||||||
|
|
||||||
print("Sand sediment file", [stg.path_sand if stg.path_sand else stg.path_fine if stg.path_fine
|
print("Sand sediment file", [stg.path_sand if stg.path_sand else stg.path_fine if stg.path_fine
|
||||||
else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data.count() > 0 else ""][0])
|
else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data.count() > 0 else ""][0])
|
||||||
filename_sand_sediment = QFileDialog.getOpenFileName(
|
filename_sand_sediment = QFileDialog.getOpenFileName(
|
||||||
|
|
@ -992,7 +994,7 @@ class SampleDataTab(QWidget):
|
||||||
depth_bottom_to_plot_fine = []
|
depth_bottom_to_plot_fine = []
|
||||||
print("time fine ", stg.time_fine)
|
print("time fine ", stg.time_fine)
|
||||||
for k in range(len(position_list_fine)):
|
for k in range(len(position_list_fine)):
|
||||||
print("k = ", k, "type(k) = ", type(k))
|
# print("k = ", k, "type(k) = ", type(k))
|
||||||
Ctot_fine_to_plot.append(stg.Ctot_fine[position_list_fine[k]])
|
Ctot_fine_to_plot.append(stg.Ctot_fine[position_list_fine[k]])
|
||||||
Ctot_fine_percent_to_plot.append(stg.Ctot_fine_per_cent[position_list_fine[k]])
|
Ctot_fine_percent_to_plot.append(stg.Ctot_fine_per_cent[position_list_fine[k]])
|
||||||
sample_depth_to_plot_fine.append(stg.depth_fine[position_list_fine[k]])
|
sample_depth_to_plot_fine.append(stg.depth_fine[position_list_fine[k]])
|
||||||
|
|
@ -1043,7 +1045,7 @@ class SampleDataTab(QWidget):
|
||||||
stg.time_fine[position_list_fine[k]])))[
|
stg.time_fine[position_list_fine[k]])))[
|
||||||
0][0])
|
0][0])
|
||||||
|
|
||||||
print("indices_bottom_fine ", indices_bottom_fine)
|
# print("indices_bottom_fine ", indices_bottom_fine)
|
||||||
|
|
||||||
if stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,):
|
if stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
|
|
@ -1063,7 +1065,7 @@ class SampleDataTab(QWidget):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("depth_bottom_to_plot_fine ", depth_bottom_to_plot_fine)
|
# print("depth_bottom_to_plot_fine ", depth_bottom_to_plot_fine)
|
||||||
|
|
||||||
return Ctot_fine_to_plot, Ctot_fine_percent_to_plot, sample_depth_to_plot_fine, indices_bottom_fine, depth_bottom_to_plot_fine
|
return Ctot_fine_to_plot, Ctot_fine_percent_to_plot, sample_depth_to_plot_fine, indices_bottom_fine, depth_bottom_to_plot_fine
|
||||||
|
|
||||||
|
|
@ -1078,7 +1080,7 @@ class SampleDataTab(QWidget):
|
||||||
position.append(i)
|
position.append(i)
|
||||||
eval(f"color_list.append(self.comboBox_sample_table_sand{i}.currentText())")
|
eval(f"color_list.append(self.comboBox_sample_table_sand{i}.currentText())")
|
||||||
sample_checkbox[0, i] = 2
|
sample_checkbox[0, i] = 2
|
||||||
print("SAND : position ", position, " color_list ", color_list)
|
# print("SAND : position ", position, " color_list ", color_list)
|
||||||
# self.update_plot_sample_position_on_transect()
|
# self.update_plot_sample_position_on_transect()
|
||||||
return position, color_list
|
return position, color_list
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ from os import path
|
||||||
from View.checkable_combobox import CheckableComboBox
|
from View.checkable_combobox import CheckableComboBox
|
||||||
|
|
||||||
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
|
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
|
||||||
from settings import J_cross_section
|
from settings import J_cross_section, alpha_s
|
||||||
|
|
||||||
|
|
||||||
# from settings import depth_cross_section, BS_raw_data_pre_process_average, BS_raw_data_pre_process_SNR, BS_raw_data, \
|
# from settings import depth_cross_section, BS_raw_data_pre_process_average, BS_raw_data_pre_process_SNR, BS_raw_data, \
|
||||||
|
|
@ -2195,11 +2195,17 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
def save_calibration(self):
|
def save_calibration(self):
|
||||||
|
|
||||||
|
if stg.alpha_s:
|
||||||
|
|
||||||
dir_save_cal = QFileDialog.getExistingDirectory(
|
dir_save_cal = QFileDialog.getExistingDirectory(
|
||||||
caption="Save calibration",
|
caption="Save calibration",
|
||||||
directory=[stg.path_calibration_file if stg.path_calibration_file else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
directory=[stg.path_calibration_file if stg.path_calibration_file else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
options=QFileDialog.DontUseNativeDialog)
|
||||||
|
|
||||||
|
print("dir_save_cal ", dir_save_cal)
|
||||||
|
|
||||||
|
if dir_save_cal:
|
||||||
|
|
||||||
stg.path_calibration_file = path.dirname(dir_save_cal)
|
stg.path_calibration_file = path.dirname(dir_save_cal)
|
||||||
|
|
||||||
cal_array = [[' ', stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[0][1]],
|
cal_array = [[' ', stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[0][1]],
|
||||||
|
|
@ -2217,6 +2223,15 @@ class SedimentCalibrationTab(QWidget):
|
||||||
"fmt ='% s'" +
|
"fmt ='% s'" +
|
||||||
")")
|
")")
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Save Error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Please compute calibration before saving")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
# --- Compute FCB ---
|
# --- Compute FCB ---
|
||||||
|
|
||||||
# ------------ Computing real cell size ------------ #
|
# ------------ Computing real cell size ------------ #
|
||||||
|
|
|
||||||
|
|
@ -922,12 +922,15 @@ class SignalProcessingTab(QWidget):
|
||||||
[stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
[stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
||||||
"Aquascat file (*.aqa)",
|
"Aquascat file (*.aqa)",
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
options=QFileDialog.DontUseNativeDialog)
|
||||||
|
print("filename noise ", filename)
|
||||||
|
if filename[0]:
|
||||||
dir_name = path.dirname(filename[0][0])
|
dir_name = path.dirname(filename[0][0])
|
||||||
name = path.basename(filename[0][0])
|
name = path.basename(filename[0][0])
|
||||||
|
|
||||||
try:
|
|
||||||
stg.path_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()] = dir_name
|
stg.path_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()] = dir_name
|
||||||
stg.filename_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()] = name
|
stg.filename_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()] = name
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
print("stg.path_BS_noise_data : ", stg.path_BS_noise_data)
|
print("stg.path_BS_noise_data : ", stg.path_BS_noise_data)
|
||||||
print("stg.filename_BS_noise_data : ", stg.filename_BS_noise_data)
|
print("stg.filename_BS_noise_data : ", stg.filename_BS_noise_data)
|
||||||
self.load_noise_data_and_compute_SNR()
|
self.load_noise_data_and_compute_SNR()
|
||||||
|
|
@ -992,6 +995,15 @@ class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
self.activate_list_of_pre_processed_data()
|
self.activate_list_of_pre_processed_data()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Download Error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Please upload acoustic data")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
|
|
||||||
def load_noise_data_and_compute_SNR(self):
|
def load_noise_data_and_compute_SNR(self):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue