Acoustic data tab is reorganized. GPS groupbox is moved to Display option groupbox. Double sliders, in bathymetry algorithm groupbox, are replaced by spinboxes.

dev-brahim
brahim 2024-07-15 09:49:04 +02:00
parent 7a80275891
commit 2e2cbf629d
1 changed files with 466 additions and 243 deletions

View File

@ -101,29 +101,32 @@ class AcousticDataTab(QWidget):
self.verticalLayoutMain = QVBoxLayout(tab_widget) self.verticalLayoutMain = QVBoxLayout(tab_widget)
self.horizontalLayoutTop = QHBoxLayout() self.horizontalLayoutTop = QHBoxLayout()
self.verticalLayoutMain.addLayout(self.horizontalLayoutTop, 4) # 1O units is 100% , 1 units is 10% self.verticalLayoutMain.addLayout(self.horizontalLayoutTop, 5) # 1O units is 100% , 1 units is 10%
self.horizontalLayoutBottom = QHBoxLayout() self.horizontalLayoutBottom = QHBoxLayout()
self.verticalLayoutMain.addLayout(self.horizontalLayoutBottom, 6) self.verticalLayoutMain.addLayout(self.horizontalLayoutBottom, 5)
### --- Layout of groupbox in the Top horizontal layout box ### --- Layout of groupbox in the Top horizontal layout box
# Download | Measurement information | Display options # Download | Table of values | GPS file
# | Table of values | # Measurement information | | Display options
self.groupbox_download = QGroupBox() self.groupbox_download = QGroupBox()
self.horizontalLayoutTop.addWidget(self.groupbox_download, 3) self.horizontalLayoutTop.addWidget(self.groupbox_download, 3)
self.verticalLayout_goupbox_info_groupbox_table = QVBoxLayout()
self.horizontalLayoutTop.addLayout(self.verticalLayout_goupbox_info_groupbox_table, 3)
self.groupbox_info = QGroupBox()
# self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.groupbox_info, 5)
self.scrollbar_measurement_information = QScrollArea()
self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.scrollbar_measurement_information, 4)
self.groupbox_table = QGroupBox() self.groupbox_table = QGroupBox()
self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.groupbox_table, 6) self.horizontalLayoutTop.addWidget(self.groupbox_table, 3)
# self.verticalLayout_goupbox_info_groupbox_table = QVBoxLayout()
# self.horizontalLayoutTop.addLayout(self.verticalLayout_goupbox_info_groupbox_table, 3)
#
# self.groupbox_info = QGroupBox()
# # self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.groupbox_info, 5)
# self.scrollbar_measurement_information = QScrollArea()
# self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.scrollbar_measurement_information, 4)
#
# self.groupbox_table = QGroupBox()
# self.verticalLayout_goupbox_info_groupbox_table.addWidget(self.groupbox_table, 6)
self.groupbox_display_option = QGroupBox() self.groupbox_display_option = QGroupBox()
self.horizontalLayoutTop.addWidget(self.groupbox_display_option, 4) self.horizontalLayoutTop.addWidget(self.groupbox_display_option, 4)
@ -145,11 +148,23 @@ class AcousticDataTab(QWidget):
# TOP HORIZONTAL BOX LAYOUT # TOP HORIZONTAL BOX LAYOUT
# ===================================================== # =====================================================
self.groupbox_download.setTitle("Acoustic recording")
self.verticalLayout_groupbox_download = QVBoxLayout(self.groupbox_download)
self.groupbox_acoustic_file = QGroupBox()
self.groupbox_acoustic_file.setTitle("Download file")
self.verticalLayout_groupbox_download.addWidget(self.groupbox_acoustic_file, 5)
self.groupbox_info = QGroupBox()
self.scrollbar_measurement_information = QScrollArea()
# self.scrollbar_measurement_information.setWindowTitle("Measurements information")
self.verticalLayout_groupbox_download.addWidget(self.scrollbar_measurement_information, 5)
# +++++++++++++++++++++++++++ # +++++++++++++++++++++++++++
# | Group box Download file | # | Group box Download file |
# +++++++++++++++++++++++++++ # +++++++++++++++++++++++++++
self.verticalLayout_groupbox_download = QVBoxLayout(self.groupbox_download)
# --- Group box Download multiple file --- # --- Group box Download multiple file ---
@ -165,7 +180,7 @@ class AcousticDataTab(QWidget):
# --- Group box acoustic file --- # --- Group box acoustic file ---
self.groupbox_acoustic_file = QGroupBox()
self.gridLayout_groupbox_acoustic_file = QGridLayout(self.groupbox_acoustic_file) self.gridLayout_groupbox_acoustic_file = QGridLayout(self.groupbox_acoustic_file)
self.combobox_ABS_system_choice = QComboBox() self.combobox_ABS_system_choice = QComboBox()
@ -210,7 +225,61 @@ class AcousticDataTab(QWidget):
# Download Push Button event : connect button clicked signal to open file slot # Download Push Button event : connect button clicked signal to open file slot
# self.pushbutton_acoustic_file.clicked.connect(self.open_dialog_box) # self.pushbutton_acoustic_file.clicked.connect(self.open_dialog_box)
self.verticalLayout_groupbox_download.addWidget(self.groupbox_acoustic_file) # ++++++++++++++++++++++++++++++++++++++
# | Group Box Measurements information |
# ++++++++++++++++++++++++++++++++++++++
self.gridLayout_goupbox_info = QGridLayout()
self.groupbox_info.setLayout(self.gridLayout_goupbox_info)
self.scrollbar_measurement_information.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollbar_measurement_information.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollbar_measurement_information.setWidgetResizable(True)
self.scrollbar_measurement_information.setWidget(self.groupbox_info)
self.label_temperature = QLabel("Temperature : ")
self.spinbox_temperature = QDoubleSpinBox()
self.spinbox_temperature.setSuffix("°C")
self.label_ABS_name = QLabel()
self.label_date_acoustic_file = QLabel()
self.label_hour_acoustic_file = QLabel()
self.label_freq = QLabel()
self.combobox_frequency_information = QComboBox()
self.label_profiles = QLabel()
self.label_profiles_value = QLabel()
self.label_profiles_per_sec = QLabel()
self.label_profiles_per_sec_value = QLabel()
self.label_cells = QLabel() # n_cell in UBSediFlow parameters
self.label_cells_value = QLabel()
self.label_cell_size = QLabel() # r_em in UBSediFlow parameters
self.label_cell_size_value = QLabel()
self.label_pulse_length = QLabel() # n_p / PRF with n_p = n_ech, nb of pulses to calculate one instantaneous profile
self.label_pulse_length_value = QLabel()
self.label_pings_per_sec = QLabel() # PRF in UBSediFlow parameters
self.label_pings_per_sec_value = QLabel()
self.label_pings_per_profile = QLabel() # n_profile/n_avg in UBSediFlow parameters
self.label_pings_per_profile_value = QLabel()
self.label_kt = QLabel()
self.spinbox_kt = QDoubleSpinBox()
self.spinbox_kt.setMaximum(1e6)
self.checkbox_kt = QCheckBox()
self.label_rx = QLabel() # a0 in UBSediFlow parameters
self.spinbox_rx = QDoubleSpinBox()
self.spinbox_rx.setMaximum(1e6)
self.checkbox_rx = QCheckBox()
self.label_tx = QLabel() # a1 in UBSediFlow parameters
self.spinbox_tx = QDoubleSpinBox()
self.spinbox_tx.setMaximum(1e6)
self.checkbox_tx = QCheckBox()
# --- Group box noise file --- (move to signal processing tab) # --- Group box noise file --- (move to signal processing tab)
@ -236,193 +305,194 @@ class AcousticDataTab(QWidget):
# #
# self.verticalLayout_groupbox_download.addWidget(self.groupbox_noise_file) # self.verticalLayout_groupbox_download.addWidget(self.groupbox_noise_file)
# --- Group box GPS file --- # # --- Group box GPS file ---
self.groupbox_gps = QGroupBox()
self.verticalLayout_gps_input_data = QVBoxLayout(self.groupbox_gps)
self.horizontalLayout_radiobutton_gps = QHBoxLayout()
self.verticalLayout_gps_input_data.addLayout(self.horizontalLayout_radiobutton_gps)
self.radiobutton_value = QRadioButton("Value")
self.radiobutton_value.setChecked(True)
self.horizontalLayout_radiobutton_gps.addWidget(self.radiobutton_value)
self.radiobutton_file = QRadioButton("File")
# self.radiobutton_file.setChecked(False)
self.horizontalLayout_radiobutton_gps.addWidget(self.radiobutton_file)
self.groupbox_gps_value = QGroupBox()
self.gridLayout_gps_value = QGridLayout(self.groupbox_gps_value)
self.label_distance_value = QLabel()
self.label_distance_value.setText("Distance : ")
self.gridLayout_gps_value.addWidget(self.label_distance_value, 0, 0, 1, 1)
self.lineEdit_gps_value = QLineEdit()
self.gridLayout_gps_value.addWidget(self.lineEdit_gps_value, 0, 1, 1, 1)
self.label_m_per_record = QLabel("m / record")
self.gridLayout_gps_value.addWidget(self.label_m_per_record, 0, 2, 1, 1)
self.verticalLayout_gps_input_data.addWidget(self.groupbox_gps_value)
self.groupbox_gps_file = QGroupBox()
self.groupbox_gps_file.setEnabled(False)
self.gridLayout_groupbox_gps_file = QGridLayout(self.groupbox_gps_file)
self.combobox_gps_system_choice = QComboBox()
self.combobox_gps_system_choice.addItems([" ", "GPS1", "GPS2", "no GPS"])
self.gridLayout_groupbox_gps_file.addWidget(self.combobox_gps_system_choice, 0, 0, 1, 2)
self.pushbutton_gps_file = QPushButton()
self.pushbutton_gps_file.setIcon(self.icon_folder)
self.gridLayout_groupbox_gps_file.addWidget(self.pushbutton_gps_file, 0, 2, 1, 1)
self.lineEdit_gps_file = QLineEdit()
self.gridLayout_groupbox_gps_file.addWidget(self.lineEdit_gps_file, 0, 3, 1, 2)
self.label_date_groupbox_gps_file = QLabel()
self.gridLayout_groupbox_gps_file.addWidget(self.label_date_groupbox_gps_file, 1, 0, 1, 2)
self.label_hour_groupbox_gps_file = QLabel()
self.gridLayout_groupbox_gps_file.addWidget(self.label_hour_groupbox_gps_file, 1, 2, 1, 2)
# Download Push Button event : connect button clicked signal to open file slot
# self.pushButton_gpsfile.clicked.connect(self.open_dialog_box)
self.verticalLayout_gps_input_data.addWidget(self.groupbox_gps_file)
self.verticalLayout_groupbox_download.addWidget(self.groupbox_gps)
# # --- Time offset line between ABS system time and GPS time ---
self.gridLayout_time_offset = QGridLayout()
self.label_time_offset = QLabel()
# self.gridLayout_time_offset.addWidget(self.label_time_offset, 0, 0, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_time_offset, 2, 0, 1, 1)
self.label_acoustic_gps_time = QLabel()
self.label_acoustic_gps_time.setText(
"T<span style= vertical-align:sub>acoustic</span> =" + " T<span style= vertical-align:sub>gps</span>")
# self.gridLayout_time_offset.addWidget(self.label_acoustic_gps_time, 0, 1, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_acoustic_gps_time, 2, 1, 1, 1)
self.combobox_plus_minus = QComboBox()
self.combobox_plus_minus.addItem("+")
self.combobox_plus_minus.addItem("-")
# self.gridLayout_time_offset.addWidget(self.combobox_plus_minus, 0, 2, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.combobox_plus_minus, 2, 2, 1, 1)
self.spinbox_time_offset_value = QSpinBox()
# self.gridLayout_time_offset.addWidget(self.spinbox_time_offset_value, 0, 3, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.spinbox_time_offset_value, 2, 3, 1, 1)
self.label_seconds = QLabel()
self.label_seconds.setText("sec")
# self.gridLayout_time_offset.addWidget(self.label_seconds, 0, 4, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_seconds, 2, 4, 1, 1)
self.verticalLayout_groupbox_download.addLayout(self.gridLayout_time_offset)
# ++++++++++++++++++++++++++++++++++++++
# | Group Box Measurements information |
# ++++++++++++++++++++++++++++++++++++++
# self.verticalLayout_groupbox_info = QVBoxLayout(self.groupbox_info)
# #
# self.formLayout_temperature = QFormLayout() # self.groupbox_gps = QGroupBox()
# self.label_temperature = QLabel("Temperature : ") # self.horizontal_gps_input_data = QVBoxLayout(self.groupbox_gps)
# self.lineEdit_temperature = QLineEdit() #
# self.formLayout_temperature.addRow(self.label_temperature, self.lineEdit_temperature) # self.verticalLayout_radiobutton_gps = QHBoxLayout()
# self.verticalLayout_groupbox_info.addLayout(self.formLayout_temperature) # self.horizontal_gps_input_data.addLayout(self.verticalLayout_radiobutton_gps)
#
# self.radiobutton_value = QRadioButton("Value")
# self.radiobutton_value.setChecked(True)
# self.verticalLayout_radiobutton_gps.addWidget(self.radiobutton_value)
#
# self.radiobutton_file = QRadioButton("File")
# # self.radiobutton_file.setChecked(False)
# self.verticalLayout_radiobutton_gps.addWidget(self.radiobutton_file)
#
# self.groupbox_gps_value = QGroupBox()
# self.gridLayout_gps_value = QGridLayout(self.groupbox_gps_value)
# self.label_distance_value = QLabel()
# self.label_distance_value.setText("Distance : ")
# self.gridLayout_gps_value.addWidget(self.label_distance_value, 0, 0, 1, 1)
# self.lineEdit_gps_value = QLineEdit()
# self.gridLayout_gps_value.addWidget(self.lineEdit_gps_value, 0, 1, 1, 1)
# self.label_m_per_record = QLabel("m / record")
# self.gridLayout_gps_value.addWidget(self.label_m_per_record, 0, 2, 1, 1)
#
# self.horizontal_gps_input_data.addWidget(self.groupbox_gps_value)
#
# self.groupbox_gps_file = QGroupBox()
# self.groupbox_gps_file.setEnabled(False)
#
# self.gridLayout_groupbox_gps_file = QGridLayout(self.groupbox_gps_file)
#
# self.combobox_gps_system_choice = QComboBox()
# self.combobox_gps_system_choice.addItems([" ", "GPS1", "GPS2", "no GPS"])
# self.gridLayout_groupbox_gps_file.addWidget(self.combobox_gps_system_choice, 0, 0, 1, 2)
# self.pushbutton_gps_file = QPushButton()
# self.pushbutton_gps_file.setIcon(self.icon_folder)
# self.gridLayout_groupbox_gps_file.addWidget(self.pushbutton_gps_file, 0, 2, 1, 1)
# self.lineEdit_gps_file = QLineEdit()
# self.gridLayout_groupbox_gps_file.addWidget(self.lineEdit_gps_file, 0, 3, 1, 2)
#
# self.label_date_groupbox_gps_file = QLabel()
# self.gridLayout_groupbox_gps_file.addWidget(self.label_date_groupbox_gps_file, 1, 0, 1, 2)
# self.label_hour_groupbox_gps_file = QLabel()
# self.gridLayout_groupbox_gps_file.addWidget(self.label_hour_groupbox_gps_file, 1, 2, 1, 2)
#
# # Download Push Button event : connect button clicked signal to open file slot
# # self.pushButton_gpsfile.clicked.connect(self.open_dialog_box)
#
# self.horizontal_gps_input_data.addWidget(self.groupbox_gps_file)
#
# self.verticalLayout_groupbox_download.addWidget(self.groupbox_gps)
#
# # # --- Time offset line between ABS system time and GPS time ---
#
# self.gridLayout_time_offset = QGridLayout()
# self.label_time_offset = QLabel()
# # self.gridLayout_time_offset.addWidget(self.label_time_offset, 0, 0, 1, 1)
# self.gridLayout_groupbox_gps_file.addWidget(self.label_time_offset, 2, 0, 1, 1)
# self.label_acoustic_gps_time = QLabel()
# self.label_acoustic_gps_time.setText(
# "T<span style= vertical-align:sub>acoustic</span> =" + " T<span style= vertical-align:sub>gps</span>")
# # self.gridLayout_time_offset.addWidget(self.label_acoustic_gps_time, 0, 1, 1, 1)
# self.gridLayout_groupbox_gps_file.addWidget(self.label_acoustic_gps_time, 2, 1, 1, 1)
# self.combobox_plus_minus = QComboBox()
# self.combobox_plus_minus.addItem("+")
# self.combobox_plus_minus.addItem("-")
# # self.gridLayout_time_offset.addWidget(self.combobox_plus_minus, 0, 2, 1, 1)
# self.gridLayout_groupbox_gps_file.addWidget(self.combobox_plus_minus, 2, 2, 1, 1)
# self.spinbox_time_offset_value = QSpinBox()
# # self.gridLayout_time_offset.addWidget(self.spinbox_time_offset_value, 0, 3, 1, 1)
# self.gridLayout_groupbox_gps_file.addWidget(self.spinbox_time_offset_value, 2, 3, 1, 1)
# self.label_seconds = QLabel()
# self.label_seconds.setText("sec")
# # self.gridLayout_time_offset.addWidget(self.label_seconds, 0, 4, 1, 1)
# self.gridLayout_groupbox_gps_file.addWidget(self.label_seconds, 2, 4, 1, 1)
# self.verticalLayout_groupbox_download.addLayout(self.gridLayout_time_offset)
# # ++++++++++++++++++++++++++++++++++++++
# # | Group Box Measurements information |
# # ++++++++++++++++++++++++++++++++++++++
#
# # self.verticalLayout_groupbox_info = QVBoxLayout(self.groupbox_info)
# #
# # self.formLayout_temperature = QFormLayout()
# # self.label_temperature = QLabel("Temperature : ")
# # self.lineEdit_temperature = QLineEdit()
# # self.formLayout_temperature.addRow(self.label_temperature, self.lineEdit_temperature)
# # self.verticalLayout_groupbox_info.addLayout(self.formLayout_temperature)
# #
# # self.gridLayout_goupbox_info = QGridLayout()
# # self.verticalLayout_groupbox_info.addLayout(self.gridLayout_goupbox_info)
#
# # --- Information for Aquascat ---
# # self.verticalLayout_goupbox_info = QGridLayout(self.groupbox_info)
# #
# self.gridLayout_goupbox_info = QGridLayout() # self.gridLayout_goupbox_info = QGridLayout()
# self.verticalLayout_groupbox_info.addLayout(self.gridLayout_goupbox_info) # self.groupbox_info.setLayout(self.gridLayout_goupbox_info)
# --- Information for Aquascat ---
# self.verticalLayout_goupbox_info = QGridLayout(self.groupbox_info)
self.gridLayout_goupbox_info = QGridLayout()
self.groupbox_info.setLayout(self.gridLayout_goupbox_info)
self.scrollbar_measurement_information.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollbar_measurement_information.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollbar_measurement_information.setWidgetResizable(True)
self.scrollbar_measurement_information.setWidget(self.groupbox_info)
# self.self.gridLayout_goupbox_info = QGridLayout()
# self.scrollbar_measurement_information.setLayout(self.gridLayout_goupbox_info)
# self.verticalLayout_goupbox_info.addWidget(self.scrollbar_measurement_information)
# scroll = QtWidgets.QScrollArea()
# scroll.setWidget(mygroupbox)
# scroll.setWidgetResizable(True)
# scroll.setFixedHeight(200)
# layout = QtWidgets.QVBoxLayout(self)
# layout.addWidget(scroll)
self.label_temperature = QLabel("Temperature : ")
# self.gridLayout_goupbox_info.addWidget(self.label_temperature, 0, 0, 1, 1)
# self.label_temperature.setAlignment(Qt.AlignLeft | Qt.AlignTop)
self.spinbox_temperature = QDoubleSpinBox()
self.spinbox_temperature.setSuffix("°C")
# self.gridLayout_goupbox_info.addWidget(self.spinbox_temperature, 0, 1, 1, 1)
# self.label_degreCelsius = QLabel("°C")
# self.gridLayout_goupbox_info.addWidget(self.label_degreCelsius, 0, 2, 1, 1)
# self.label_date_acoustic_file = QLabel()
# self.gridLayout_goupbox_info.addWidget(self.label_date_acoustic_file, 1, 0, 1, 2)
# self.label_hour_acoustic_file = QLabel()
# self.gridLayout_goupbox_info.addWidget(self.label_hour_acoustic_file, 1, 1, 1, 1)
self.label_ABS_name = QLabel()
self.label_date_acoustic_file = QLabel()
self.label_hour_acoustic_file = QLabel()
self.label_freq = QLabel()
self.combobox_frequency_information = QComboBox()
self.label_profiles = QLabel()
self.label_profiles_value = QLabel()
self.label_profiles_per_sec = QLabel()
self.label_profiles_per_sec_value = QLabel()
self.label_cells = QLabel() # n_cell in UBSediFlow parameters
self.label_cells_value = QLabel()
self.label_cell_size = QLabel() # r_em in UBSediFlow parameters
self.label_cell_size_value = QLabel()
self.label_pulse_length = QLabel() # n_p / PRF with n_p = n_ech, nb of pulses to calculate one instantaneous profile
self.label_pulse_length_value = QLabel()
self.label_pings_per_sec = QLabel() # PRF in UBSediFlow parameters
self.label_pings_per_sec_value = QLabel()
self.label_pings_per_profile = QLabel() # n_profile/n_avg in UBSediFlow parameters
self.label_pings_per_profile_value = QLabel()
self.label_kt = QLabel()
self.spinbox_kt = QDoubleSpinBox()
self.spinbox_kt.setMaximum(1e6)
self.checkbox_kt = QCheckBox()
self.label_rx = QLabel() # a0 in UBSediFlow parameters
self.spinbox_rx = QDoubleSpinBox()
self.spinbox_rx.setMaximum(1e6)
self.checkbox_rx = QCheckBox()
self.label_tx = QLabel() # a1 in UBSediFlow parameters
self.spinbox_tx = QDoubleSpinBox()
self.spinbox_tx.setMaximum(1e6)
self.checkbox_tx = QCheckBox()
# # --- Parameters for UBSediFlow ---
# self.label_config = QLabel()
# self.combobox_config = QComboBox()
# self.label_transducer = QLabel()
# #
# # --- Information for UBSediFlow --- # self.scrollbar_measurement_information.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
# self.label_tr_out = QLabel() # self.scrollbar_measurement_information.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
# self.label_tr_out.setText("Channel : ") # self.scrollbar_measurement_information.setWidgetResizable(True)
# self.label_r_cell1 = QLabel() #
# self.label_r_cell1.setText("1st cell size : ") # self.scrollbar_measurement_information.setWidget(self.groupbox_info)
# self.label_r_dcell = QLabel() # # self.self.gridLayout_goupbox_info = QGridLayout()
# self.label_r_dcell.setText("Inter-cell distance : ") # # self.scrollbar_measurement_information.setLayout(self.gridLayout_goupbox_info)
# # self.verticalLayout_goupbox_info.addWidget(self.scrollbar_measurement_information)
# self.groupbox_measurement_information_Aquascat() #
# # scroll = QtWidgets.QScrollArea()
# # scroll.setWidget(mygroupbox)
# # scroll.setWidgetResizable(True)
# # scroll.setFixedHeight(200)
# # layout = QtWidgets.QVBoxLayout(self)
# # layout.addWidget(scroll)
#
# self.label_temperature = QLabel("Temperature : ")
# # self.gridLayout_goupbox_info.addWidget(self.label_temperature, 0, 0, 1, 1)
# # self.label_temperature.setAlignment(Qt.AlignLeft | Qt.AlignTop)
# self.spinbox_temperature = QDoubleSpinBox()
# self.spinbox_temperature.setSuffix("°C")
# # self.gridLayout_goupbox_info.addWidget(self.spinbox_temperature, 0, 1, 1, 1)
# # self.label_degreCelsius = QLabel("°C")
# # self.gridLayout_goupbox_info.addWidget(self.label_degreCelsius, 0, 2, 1, 1)
#
# # self.label_date_acoustic_file = QLabel()
# # self.gridLayout_goupbox_info.addWidget(self.label_date_acoustic_file, 1, 0, 1, 2)
# # self.label_hour_acoustic_file = QLabel()
# # self.gridLayout_goupbox_info.addWidget(self.label_hour_acoustic_file, 1, 1, 1, 1)
#
# self.label_ABS_name = QLabel()
#
# self.label_date_acoustic_file = QLabel()
# self.label_hour_acoustic_file = QLabel()
#
# self.label_freq = QLabel()
# self.combobox_frequency_information = QComboBox()
#
# self.label_profiles = QLabel()
# self.label_profiles_value = QLabel()
# self.label_profiles_per_sec = QLabel()
# self.label_profiles_per_sec_value = QLabel()
# self.label_cells = QLabel() # n_cell in UBSediFlow parameters
# self.label_cells_value = QLabel()
# self.label_cell_size = QLabel() # r_em in UBSediFlow parameters
# self.label_cell_size_value = QLabel()
# self.label_pulse_length = QLabel() # n_p / PRF with n_p = n_ech, nb of pulses to calculate one instantaneous profile
# self.label_pulse_length_value = QLabel()
# self.label_pings_per_sec = QLabel() # PRF in UBSediFlow parameters
# self.label_pings_per_sec_value = QLabel()
# self.label_pings_per_profile = QLabel() # n_profile/n_avg in UBSediFlow parameters
# self.label_pings_per_profile_value = QLabel()
#
# self.label_kt = QLabel()
# self.spinbox_kt = QDoubleSpinBox()
# self.spinbox_kt.setMaximum(1e6)
# self.checkbox_kt = QCheckBox()
#
# self.label_rx = QLabel() # a0 in UBSediFlow parameters
# self.spinbox_rx = QDoubleSpinBox()
# self.spinbox_rx.setMaximum(1e6)
# self.checkbox_rx = QCheckBox()
#
# self.label_tx = QLabel() # a1 in UBSediFlow parameters
# self.spinbox_tx = QDoubleSpinBox()
# self.spinbox_tx.setMaximum(1e6)
# self.checkbox_tx = QCheckBox()
#
# # # --- Parameters for UBSediFlow ---
# # self.label_config = QLabel()
# # self.combobox_config = QComboBox()
# # self.label_transducer = QLabel()
# #
# # # --- Information for UBSediFlow ---
# # self.label_tr_out = QLabel()
# # self.label_tr_out.setText("Channel : ")
# # self.label_r_cell1 = QLabel()
# # self.label_r_cell1.setText("1st cell size : ")
# # self.label_r_dcell = QLabel()
# # self.label_r_dcell.setText("Inter-cell distance : ")
#
# # self.groupbox_measurement_information_Aquascat()
# +++++++++++++++++++++++++++++ # +++++++++++++++++++++++++++++
# | Group Box Table of values | # | Group Box Table of values |
# +++++++++++++++++++++++++++++ # +++++++++++++++++++++++++++++
self.groupbox_table.setTitle("Table of values")
self.verticalLayout_groupbox_table = QVBoxLayout(self.groupbox_table) self.verticalLayout_groupbox_table = QVBoxLayout(self.groupbox_table)
# self.horizontalLayout_pushbutton_fill_export_table = QHBoxLayout() # self.horizontalLayout_pushbutton_fill_export_table = QHBoxLayout()
@ -507,18 +577,107 @@ class AcousticDataTab(QWidget):
# self.verticalLayout_groupboxtable.addWidget(self.tableWidget) # self.verticalLayout_groupboxtable.addWidget(self.tableWidget)
# # self.verticalLayout_groupboxtable.addWidget(self.tableView) # # self.verticalLayout_groupboxtable.addWidget(self.tableView)
# ++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++
# | Group Box Display option | # | Group Box Display option |
# ++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++
self.verticalLayout_display_option = QVBoxLayout(self.groupbox_display_option) self.verticalLayout_groupbox_display_option = QVBoxLayout(self.groupbox_display_option)
# o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o # o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
# --- Group box GPS file ---
self.groupbox_gps = QGroupBox()
self.horizontal_gps_input_data = QHBoxLayout(self.groupbox_gps)
self.verticalLayout_radiobutton_gps = QVBoxLayout()
self.horizontal_gps_input_data.addLayout(self.verticalLayout_radiobutton_gps)
self.radiobutton_value = QRadioButton("Value")
self.radiobutton_value.setChecked(True)
self.verticalLayout_radiobutton_gps.addWidget(self.radiobutton_value)
self.radiobutton_file = QRadioButton("File")
# self.radiobutton_file.setChecked(False)
self.verticalLayout_radiobutton_gps.addWidget(self.radiobutton_file)
self.groupbox_gps_value = QGroupBox()
self.groupbox_gps_value.setVisible(True)
self.gridLayout_gps_value = QGridLayout(self.groupbox_gps_value)
self.label_distance_value = QLabel()
self.label_distance_value.setText("Distance : ")
self.gridLayout_gps_value.addWidget(self.label_distance_value, 0, 0, 1, 1)
self.lineEdit_gps_value = QLineEdit()
self.gridLayout_gps_value.addWidget(self.lineEdit_gps_value, 0, 1, 1, 1)
self.label_m_per_record = QLabel("m / record")
self.gridLayout_gps_value.addWidget(self.label_m_per_record, 0, 2, 1, 1)
self.horizontal_gps_input_data.addWidget(self.groupbox_gps_value)
self.groupbox_gps_file = QGroupBox()
self.groupbox_gps_file.setVisible(False)
# self.groupbox_gps_file.setEnabled(False)
self.gridLayout_groupbox_gps_file = QGridLayout(self.groupbox_gps_file)
self.combobox_gps_system_choice = QComboBox()
self.combobox_gps_system_choice.addItems([" ", "GPS1", "GPS2", "no GPS"])
self.gridLayout_groupbox_gps_file.addWidget(self.combobox_gps_system_choice, 0, 0, 1, 1)
self.pushbutton_gps_file = QPushButton()
self.pushbutton_gps_file.setIcon(self.icon_folder)
self.gridLayout_groupbox_gps_file.addWidget(self.pushbutton_gps_file, 0, 1, 1, 1)
self.lineEdit_gps_file = QLineEdit()
self.gridLayout_groupbox_gps_file.addWidget(self.lineEdit_gps_file, 0, 2, 1, 1)
self.label_date_groupbox_gps_file = QLabel()
self.gridLayout_groupbox_gps_file.addWidget(self.label_date_groupbox_gps_file, 0, 3, 1, 1)
self.label_hour_groupbox_gps_file = QLabel()
self.gridLayout_groupbox_gps_file.addWidget(self.label_hour_groupbox_gps_file, 0, 4, 1, 1)
# Download Push Button event : connect button clicked signal to open file slot
# self.pushButton_gpsfile.clicked.connect(self.open_dialog_box)
self.horizontal_gps_input_data.addWidget(self.groupbox_gps_file)
self.verticalLayout_groupbox_display_option.addWidget(self.groupbox_gps)
# # --- Time offset line between ABS system time and GPS time ---
self.gridLayout_time_offset = QGridLayout()
self.label_time_offset = QLabel()
# self.gridLayout_time_offset.addWidget(self.label_time_offset, 0, 0, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_time_offset, 1, 0, 1, 1)
self.label_acoustic_gps_time = QLabel()
self.label_acoustic_gps_time.setText(
"T<span style= vertical-align:sub>acoustic</span> =" + " T<span style= vertical-align:sub>gps</span>")
# self.gridLayout_time_offset.addWidget(self.label_acoustic_gps_time, 0, 1, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_acoustic_gps_time, 1, 2, 1, 1)
self.combobox_plus_minus = QComboBox()
self.combobox_plus_minus.addItem("+")
self.combobox_plus_minus.addItem("-")
# self.gridLayout_time_offset.addWidget(self.combobox_plus_minus, 0, 2, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.combobox_plus_minus, 1, 3, 1, 1)
self.spinbox_time_offset_value = QSpinBox()
# self.gridLayout_time_offset.addWidget(self.spinbox_time_offset_value, 0, 3, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.spinbox_time_offset_value, 1, 4, 1, 1)
self.label_seconds = QLabel()
self.label_seconds.setText("sec")
# self.gridLayout_time_offset.addWidget(self.label_seconds, 0, 4, 1, 1)
self.gridLayout_groupbox_gps_file.addWidget(self.label_seconds, 1, 5, 1, 1)
self.verticalLayout_groupbox_display_option.addLayout(self.gridLayout_time_offset)
# ----------------------------------------------------------------------------
# o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
# --- Groupbox display option limits ---
self.groupbox_display_option_limits = QGroupBox() self.groupbox_display_option_limits = QGroupBox()
self.gridLayout_groupbox_display_option_limits = QGridLayout(self.groupbox_display_option_limits) self.gridLayout_groupbox_display_option_limits = QGridLayout(self.groupbox_display_option_limits)
self.verticalLayout_display_option.addWidget(self.groupbox_display_option_limits) self.verticalLayout_groupbox_display_option.addWidget(self.groupbox_display_option_limits)
self.label_depth = QLabel("Depth: ") self.label_depth = QLabel("Depth: ")
self.gridLayout_groupbox_display_option_limits.addWidget(self.label_depth, 0, 0, 1, 1) self.gridLayout_groupbox_display_option_limits.addWidget(self.label_depth, 0, 0, 1, 1)
@ -607,29 +766,70 @@ class AcousticDataTab(QWidget):
self.groupbox_display_option_bathymetry = QGroupBox() self.groupbox_display_option_bathymetry = QGroupBox()
self.gridLayout_groupbox_display_option_bathymetry = QGridLayout(self.groupbox_display_option_bathymetry) self.gridLayout_groupbox_display_option_bathymetry = QGridLayout(self.groupbox_display_option_bathymetry)
self.verticalLayout_display_option.addWidget(self.groupbox_display_option_bathymetry) self.verticalLayout_groupbox_display_option.addWidget(self.groupbox_display_option_bathymetry)
self.combobox_frequency_bathymetry = QComboBox() self.combobox_frequency_bathymetry = QComboBox()
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.combobox_frequency_bathymetry, 0, 0, 1, 1) self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.combobox_frequency_bathymetry, 0, 0, 1, 1)
self.label_1st_intg_area = QLabel("1st intg area") # self.label_1st_intg_area = QLabel("1st intg area")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_1st_intg_area, 0, 1, 1, 1) # self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_1st_intg_area, 0, 1, 1, 1)
#
# self.doubleRangeSlider_intg_area = QLabeledDoubleRangeSlider()
# self.doubleRangeSlider_intg_area.setOrientation(Qt.Vertical)
# # self.doubleRangeSlider_distance_from_bank.setMinimumWidth(350)
# self.doubleRangeSlider_intg_area.setRange(min=0, max=50)
# self.doubleRangeSlider_intg_area.setValue(value=(5, 40))
# self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.doubleRangeSlider_intg_area, 0, 2, 1, 1)
#
# self.label_offset = QLabel("Offset")
# self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_offset, 0, 3, 1, 1)
#
# self.spinbox_offset_next_cell = QDoubleSpinBox()
# self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.spinbox_offset_next_cell, 0, 4, 1, 1)
self.doubleRangeSlider_intg_area = QLabeledDoubleRangeSlider()
self.doubleRangeSlider_intg_area.setOrientation(Qt.Vertical)
# self.doubleRangeSlider_distance_from_bank.setMinimumWidth(350)
self.doubleRangeSlider_intg_area.setRange(min=0, max=50)
self.doubleRangeSlider_intg_area.setValue(value=(5, 40))
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.doubleRangeSlider_intg_area, 0, 2, 1, 1)
self.label_offset = QLabel("Offset") self.label_from_bathy = QLabel()
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_offset, 0, 3, 1, 1) self.label_from_bathy.setText("From -")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_from_bathy, 0, 1, 1, 1)
self.spinbox_offset_next_cell = QDoubleSpinBox() self.spinbox_depth_min_bathy = QDoubleSpinBox()
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.spinbox_offset_next_cell, 0, 4, 1, 1) self.spinbox_depth_min_bathy.setRange(0, 9999)
self.spinbox_depth_min_bathy.setDecimals(2)
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.spinbox_depth_min_bathy, 0, 2, 1, 1)
self.label_depth_min_unit = QLabel()
self.label_depth_min_unit.setText("m")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_depth_min_unit, 0, 3, 1, 1)
self.label_to_bathy = QLabel()
self.label_to_bathy.setText("to -")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_to_bathy, 0, 4, 1, 1)
self.spinbox_depth_max_bathy = QDoubleSpinBox()
self.spinbox_depth_max_bathy.setRange(0, 99999)
self.spinbox_depth_max_bathy.setDecimals(2)
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.spinbox_depth_max_bathy, 0, 5, 1, 1)
self.label_depth_max_unit = QLabel()
self.label_depth_max_unit.setText("m")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_depth_max_unit, 0, 6, 1, 1)
self.label_next_cell = QLabel()
self.label_next_cell.setText("+/-")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_next_cell, 0, 7, 1, 1)
self.doublespinbox_next_cell_bathy = QDoubleSpinBox()
self.doublespinbox_next_cell_bathy.setRange(0, 99999)
self.doublespinbox_next_cell_bathy.setDecimals(2)
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.doublespinbox_next_cell_bathy, 0, 8, 1, 1)
self.label_next_cell_unit = QLabel()
self.label_next_cell_unit.setText("m")
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.label_next_cell_unit, 0, 9, 1, 1)
self.pushbutton_apply_bathymetry = QPushButton() self.pushbutton_apply_bathymetry = QPushButton()
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.pushbutton_apply_bathymetry, 0, 5, 1, 1) self.pushbutton_apply_bathymetry.setIcon(self.icon_apply_limits)
self.gridLayout_groupbox_display_option_bathymetry.addWidget(self.pushbutton_apply_bathymetry, 0, 10, 1, 1)
# o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o # o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
@ -977,8 +1177,7 @@ class AcousticDataTab(QWidget):
self.fileListWidget.itemSelectionChanged.connect(self.plot_profile) self.fileListWidget.itemSelectionChanged.connect(self.plot_profile)
self.fileListWidget.itemSelectionChanged.connect(self.update_plot_backscattered_acoustic_signal_recording) self.fileListWidget.itemSelectionChanged.connect(self.update_plot_backscattered_acoustic_signal_recording)
self.fileListWidget.itemSelectionChanged.connect(self.update_plot_profile) self.fileListWidget.itemSelectionChanged.connect(self.update_plot_profile)
self.fileListWidget.itemSelectionChanged.connect(self.set_range_for_doubleRangeSlider_intg_area) self.fileListWidget.itemSelectionChanged.connect(self.set_range_for_spinboxes_bathymetry)
# self.fileListWidget.installEventFilter()
# self.fileListWidget.clicked.connect(self.rename_file_in_ListWidget) # self.fileListWidget.clicked.connect(self.rename_file_in_ListWidget)
@ -1000,7 +1199,7 @@ class AcousticDataTab(QWidget):
self.pushbutton_apply_depth_limits.clicked.connect(self.compute_BS_cross_section) self.pushbutton_apply_depth_limits.clicked.connect(self.compute_BS_cross_section)
self.pushbutton_apply_depth_limits.clicked.connect(self.update_plot_backscattered_acoustic_signal_recording) self.pushbutton_apply_depth_limits.clicked.connect(self.update_plot_backscattered_acoustic_signal_recording)
self.pushbutton_apply_depth_limits.clicked.connect(self.update_plot_profile) self.pushbutton_apply_depth_limits.clicked.connect(self.update_plot_profile)
self.pushbutton_apply_depth_limits.clicked.connect(self.set_range_for_doubleRangeSlider_intg_area) self.pushbutton_apply_depth_limits.clicked.connect(self.set_range_for_spinboxes_bathymetry)
self.pushbutton_apply_recording_time_limits.clicked.connect(self.set_tmin_tmax_for_doubleRangeSider_time) self.pushbutton_apply_recording_time_limits.clicked.connect(self.set_tmin_tmax_for_doubleRangeSider_time)
# self.pushbutton_apply_recording_time_limits.clicked.connect(self.compute_time) # self.pushbutton_apply_recording_time_limits.clicked.connect(self.compute_time)
@ -1042,9 +1241,11 @@ class AcousticDataTab(QWidget):
def retranslate_acoustic_data_tab(self): def retranslate_acoustic_data_tab(self):
self.groupbox_download.setTitle(_translate("CONSTANT_STRING", cs.DOWNLOAD)) # self.groupbox_download.setTitle(_translate("CONSTANT_STRING", cs.DOWNLOAD))
self.groupbox_acoustic_file.setTitle(_translate("CONSTANT_STRING", cs.ACOUSTIC_FILE)) self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION))
# self.groupbox_acoustic_file.setTitle(_translate("CONSTANT_STRING", cs.ACOUSTIC_FILE))
self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":") self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
self.label_hour_acoustic_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":") self.label_hour_acoustic_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":")
@ -1053,14 +1254,6 @@ class AcousticDataTab(QWidget):
# self.label_date_groupbox_noise_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":") # self.label_date_groupbox_noise_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
# self.label_hour_groupbox_noise_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":") # self.label_hour_groupbox_noise_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":")
self.groupbox_gps.setTitle(_translate("CONSTANT_STRING", cs.GPS_FILE))
self.label_date_groupbox_gps_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
self.label_hour_groupbox_gps_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":")
self.label_time_offset.setText(_translate("CONSTANT_STRING", cs.TIME_OFFSET))
self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION))
self.label_profiles.setText(_translate("CONSTANT_STRING", cs.NB_PROFILES) + ":") self.label_profiles.setText(_translate("CONSTANT_STRING", cs.NB_PROFILES) + ":")
self.label_profiles.setToolTip(_translate("CONSTANT_STRING", cs.NB_PROFILES_TOOLTIP)) self.label_profiles.setToolTip(_translate("CONSTANT_STRING", cs.NB_PROFILES_TOOLTIP))
@ -1099,6 +1292,12 @@ class AcousticDataTab(QWidget):
# self.pushbutton_fill_table.setText(_translate("CONSTANT_STRING", cs.SYNCHRONIZE_AND_FILL_TABLE)) # self.pushbutton_fill_table.setText(_translate("CONSTANT_STRING", cs.SYNCHRONIZE_AND_FILL_TABLE))
# self.pushbutton_export_table.setText(_translate("CONSTANT_STRING", cs.EXPORT_TABLE)) # self.pushbutton_export_table.setText(_translate("CONSTANT_STRING", cs.EXPORT_TABLE))
self.groupbox_gps.setTitle(_translate("CONSTANT_STRING", cs.GPS_FILE))
self.label_date_groupbox_gps_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
self.label_hour_groupbox_gps_file.setText(_translate("CONSTANT_STRING", cs.HOUR) + ":")
self.label_time_offset.setText(_translate("CONSTANT_STRING", cs.TIME_OFFSET))
self.groupbox_display_option.setTitle(_translate("CONSTANT_STRING", cs.DISPLAY_OPTIONS)) self.groupbox_display_option.setTitle(_translate("CONSTANT_STRING", cs.DISPLAY_OPTIONS))
# self.pushbutton_plot_transect_with_BS_raw_data.setText(_translate("CONSTANT_STRING", cs.PLOT_TRANSECT)) # self.pushbutton_plot_transect_with_BS_raw_data.setText(_translate("CONSTANT_STRING", cs.PLOT_TRANSECT))
@ -1159,11 +1358,11 @@ class AcousticDataTab(QWidget):
if radiobutton.isChecked(): if radiobutton.isChecked():
if self.radiobutton_value.isChecked(): if self.radiobutton_value.isChecked():
self.groupbox_gps_value.setEnabled(True) self.groupbox_gps_value.setVisible(True)
self.groupbox_gps_file.setDisabled(True) self.groupbox_gps_file.setVisible(False)
elif self.radiobutton_file.isChecked(): elif self.radiobutton_file.isChecked():
self.groupbox_gps_value.setDisabled(True) self.groupbox_gps_value.setVisible(False)
self.groupbox_gps_file.setEnabled(True) self.groupbox_gps_file.setVisible(True)
def ABS_system_choice(self): def ABS_system_choice(self):
if self.combobox_ABS_system_choice.currentText() == " ": if self.combobox_ABS_system_choice.currentText() == " ":
@ -2893,6 +3092,19 @@ class AcousticDataTab(QWidget):
value=(-stg.depth_cross_section[self.fileListWidget.currentRow()][0, -1], value=(-stg.depth_cross_section[self.fileListWidget.currentRow()][0, -1],
-stg.depth_cross_section[self.fileListWidget.currentRow()][0, 0])) -stg.depth_cross_section[self.fileListWidget.currentRow()][0, 0]))
def set_range_for_spinboxes_bathymetry(self):
if self.fileListWidget.currentRow() != -1:
if stg.depth_cross_section[self.fileListWidget.currentRow()].shape != (0,):
self.spinbox_depth_min_bathy.setValue(stg.depth_cross_section[self.fileListWidget.currentRow()][0, 0])
self.spinbox_depth_max_bathy.setValue(stg.depth_cross_section[self.fileListWidget.currentRow()][0, -1])
else:
self.spinbox_depth_min_bathy.setValue(stg.depth[self.fileListWidget.currentRow()][0, 0])
self.spinbox_depth_max_bathy.setValue(stg.depth[self.fileListWidget.currentRow()][0, -1])
def plot_backscattered_acoustic_signal_recording(self): def plot_backscattered_acoustic_signal_recording(self):
# --- Condition if table is not filled --- # --- Condition if table is not filled ---
# if not self.lineEdit_acoustic_file.text(): # if not self.lineEdit_acoustic_file.text():
@ -3878,10 +4090,14 @@ class AcousticDataTab(QWidget):
stg.freq_bottom_detection[self.fileListWidget.currentRow()] = self.combobox_frequency_bathymetry.currentIndex() stg.freq_bottom_detection[self.fileListWidget.currentRow()] = self.combobox_frequency_bathymetry.currentIndex()
# Selecting the range in which we look for the bottom reflection # Selecting the range in which we look for the bottom reflection
# rmin = np.float32(self.doubleRangeSlider_intg_area.value()[0].text().replace(",", ".")) # rmin = np.float32(self.doubleRangeSlider_intg_area.value()[0].text().replace(",", "."))
# rmax = np.float32(self.doubleRangeSlider_intg_area.value()[1].text().replace(",", ".")) # rmax = np.float32(self.doubleRangeSlider_intg_area.value()[1].text().replace(",", "."))
rmin = -self.doubleRangeSlider_intg_area.value()[1] # rmin = -self.doubleRangeSlider_intg_area.value()[1]
rmax = -self.doubleRangeSlider_intg_area.value()[0] # rmax = -self.doubleRangeSlider_intg_area.value()[0]
rmin = self.spinbox_depth_min_bathy.value()
rmax = self.spinbox_depth_max_bathy.value()
print("rmin ", rmin)
print("rmax ", rmax)
# empty result arrays # empty result arrays
# r_bottom = np.zeros(stg.nb_profiles) # r_bottom = np.zeros(stg.nb_profiles)
@ -3897,10 +4113,10 @@ class AcousticDataTab(QWidget):
for k in range(stg.time_cross_section[self.fileListWidget.currentRow()].shape[1]): for k in range(stg.time_cross_section[self.fileListWidget.currentRow()].shape[1]):
BS_smooth[:, k] = savgol_filter(BS_smooth[:, k], 10, 2) BS_smooth[:, k] = savgol_filter(BS_smooth[:, k], 10, 2)
# fig1, ax1 = plt.subplots(nrows=1, ncols=1, layout="constrained") fig1, ax1 = plt.subplots(nrows=1, ncols=1, layout="constrained")
# pcm1 = ax1.pcolormesh(stg.time[0, :], -stg.r[0, :], np.log(BS_smooth[:, :]), cmap='Blues') pcm1 = ax1.pcolormesh(stg.time_cross_section[0][0, :], -stg.depth_cross_section[0][0, :], (BS_smooth[:, :]), cmap='Blues')
# fig1.colorbar(pcm1, ax=ax1, shrink=1, location='right') fig1.colorbar(pcm1, ax=ax1, shrink=1, location='right')
# plt.show() plt.show()
# ----------- Detecting the bottom ------------- # ----------- Detecting the bottom -------------
# for d in range(stg.nb_profiles): # for d in range(stg.nb_profiles):
@ -3908,10 +4124,11 @@ class AcousticDataTab(QWidget):
# Index of the range where we look for the peak # Index of the range where we look for the peak
# print(f"self.combobox_freq_choice.currentIndex() : {self.combobox_freq_choice.currentIndex()}") # print(f"self.combobox_freq_choice.currentIndex() : {self.combobox_freq_choice.currentIndex()}")
# print(f"r = {stg.r}") # print(f"r = {stg.r}")
print(f"ind_min : {np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] >= rmin)}")
print(f"ind_max : {np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] <= rmax)}")
ind_min = np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] >= rmin)[0][0] ind_min = np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] >= rmin)[0][0]
ind_max = np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] <= rmax)[0][-1] ind_max = np.where(stg.depth_cross_section[self.fileListWidget.currentRow()][int(self.combobox_frequency_bathymetry.currentIndex()), :] <= rmax)[0][-1]
# print(f"ind_min : {ind_min}")
# print(f"ind_max : {ind_max}")
# Getting the peak # Getting the peak
try: try:
@ -3942,8 +4159,10 @@ class AcousticDataTab(QWidget):
# Updating the range where we will look for the peak (in the next cell) # Updating the range where we will look for the peak (in the next cell)
# rmin = r_bottom[d] - locale.atof(self.doublespinbox_next_cell.text()) # rmin = r_bottom[d] - locale.atof(self.doublespinbox_next_cell.text())
# rmax = r_bottom[d] + locale.atof(self.doublespinbox_next_cell.text()) # rmax = r_bottom[d] + locale.atof(self.doublespinbox_next_cell.text())
rmin = r_bottom[d] - np.float32(self.spinbox_offset_next_cell.text().replace(",", ".")) # rmin = r_bottom[d] - np.float32(self.spinbox_offset_next_cell.text().replace(",", "."))
rmax = r_bottom[d] + np.float32(self.spinbox_offset_next_cell.text().replace(",", ".")) # rmax = r_bottom[d] + np.float32(self.spinbox_offset_next_cell.text().replace(",", "."))
rmin = r_bottom[d] - self.doublespinbox_next_cell_bathy.value()
rmax = r_bottom[d] + self.doublespinbox_next_cell_bathy.value()
# --- Plot vertical profile for bottom detection --- # --- Plot vertical profile for bottom detection ---
# n = 60 # n = 60
@ -4107,8 +4326,10 @@ class AcousticDataTab(QWidget):
self.fileListWidget.currentRow()] = self.combobox_frequency_bathymetry.currentIndex() self.fileListWidget.currentRow()] = self.combobox_frequency_bathymetry.currentIndex()
# Selecting the range in which we look for the bottom reflection # Selecting the range in which we look for the bottom reflection
rmin = -self.doubleRangeSlider_intg_area.value()[1] # rmin = -self.doubleRangeSlider_intg_area.value()[1]
rmax = -self.doubleRangeSlider_intg_area.value()[0] # rmax = -self.doubleRangeSlider_intg_area.value()[0]
rmin = self.spinbox_depth_min_bathy.value()
rmax = self.spinbox_depth_max_bathy.value()
# empty result arrays # empty result arrays
r_bottom = np.zeros(stg.time[self.fileListWidget.currentRow()].shape[1]) r_bottom = np.zeros(stg.time[self.fileListWidget.currentRow()].shape[1])
@ -4154,8 +4375,10 @@ class AcousticDataTab(QWidget):
r_bottom_ind.append(ind_bottom + ind_min) r_bottom_ind.append(ind_bottom + ind_min)
# Updating the range where we will look for the peak (in the next cell) # Updating the range where we will look for the peak (in the next cell)
rmin = r_bottom[d] - np.float32(self.spinbox_offset_next_cell.text().replace(",", ".")) # rmin = r_bottom[d] - np.float32(self.spinbox_offset_next_cell.text().replace(",", "."))
rmax = r_bottom[d] + np.float32(self.spinbox_offset_next_cell.text().replace(",", ".")) # rmax = r_bottom[d] + np.float32(self.spinbox_offset_next_cell.text().replace(",", "."))
rmin = r_bottom[d] - self.doublespinbox_next_cell_bathy.value()
rmax = r_bottom[d] + self.doublespinbox_next_cell_bathy.value()
BS_section_bottom = np.zeros((stg.depth[self.fileListWidget.currentRow()].shape[1], BS_section_bottom = np.zeros((stg.depth[self.fileListWidget.currentRow()].shape[1],
stg.time[self.fileListWidget.currentRow()].shape[1])) stg.time[self.fileListWidget.currentRow()].shape[1]))