Clear button works when only one acoustic file is downloaded and crash when more than one acoustic file is downloaded #34
parent
22cd451b24
commit
5734f6e614
|
|
@ -626,17 +626,19 @@ class AcousticDataTab(QWidget):
|
|||
self.delBtn.clicked.connect(self.remove_file_from_ListWidget)
|
||||
self.clearBtn.clicked.connect(self.clear_files_from_ListWidget)
|
||||
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.print_selected_file)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.fill_measurements_information_groupbox)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.fill_table)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.compute_tmin_tmax)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.compute_rmin_rmax)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.update_frequency_combobox)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.plot_backscattered_acoustic_signal_recording)
|
||||
# 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_profile)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.set_range_for_spinboxes_bathymetry)
|
||||
self.fileListWidget.itemSelectionChanged.connect(self.fileListWidget_event)
|
||||
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.print_selected_file)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.fill_measurements_information_groupbox)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.fill_table)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.compute_tmin_tmax)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.compute_rmin_rmax)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.update_frequency_combobox)
|
||||
# # self.fileListWidget.itemSelectionChanged.connect(self.plot_backscattered_acoustic_signal_recording)
|
||||
# # 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_profile)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.set_range_for_spinboxes_bathymetry)
|
||||
|
||||
self.combobox_ABS_name.currentIndexChanged.connect(self.fill_measurements_information_groupbox)
|
||||
|
||||
|
|
@ -744,6 +746,20 @@ class AcousticDataTab(QWidget):
|
|||
|
||||
self.groupbox_transect_2Dplot_raw_BS_data.setTitle(_translate("CONSTANT_STRING", cs.RAW_ACOUSTIC_DATA_2D_FIELD))
|
||||
|
||||
def fileListWidget_event(self):
|
||||
|
||||
self.print_selected_file()
|
||||
self.fill_measurements_information_groupbox()
|
||||
self.fill_table()
|
||||
self.compute_tmin_tmax()
|
||||
self.compute_rmin_rmax()
|
||||
self.update_frequency_combobox()
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.plot_backscattered_acoustic_signal_recording)
|
||||
# self.fileListWidget.itemSelectionChanged.connect(self.plot_profile)
|
||||
self.update_plot_backscattered_acoustic_signal_recording()
|
||||
self.update_plot_profile()
|
||||
self.set_range_for_spinboxes_bathymetry()
|
||||
|
||||
def print_selected_file(self):
|
||||
print(f"Selected file in list widget : {self.fileListWidget.selectedItems()}")
|
||||
print("self.fileListWidget.selectedItems()[1:] : ", self.fileListWidget.selectedItems()[1:])
|
||||
|
|
@ -1365,13 +1381,18 @@ class AcousticDataTab(QWidget):
|
|||
del current_item
|
||||
|
||||
# --- Clear variables ---
|
||||
list_to_pop1 = ["stg.acoustic_data", "stg.date", "stg.hour", "stg.freq", "stg.freq_text", "stg.temperature",
|
||||
"stg.nb_profiles", "stg.nb_profiles_per_sec", "stg.nb_cells", "stg.cell_size",
|
||||
"stg.pulse_length", "stg.nb_pings_per_sec", "stg.nb_pings_averaged_per_profile",
|
||||
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx",
|
||||
"stg.filename_BS_raw_data", "stg.path_BS_raw_data",
|
||||
"stg.BS_raw_data", "stg.time", "stg.depth",
|
||||
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape"]
|
||||
list_to_pop1 = [
|
||||
"stg.acoustic_data", "stg.date", "stg.hour",
|
||||
"stg.freq", "stg.freq_text",
|
||||
"stg.nb_profiles", "stg.nb_profiles_per_sec",
|
||||
"stg.nb_cells", "stg.cell_size",
|
||||
"stg.pulse_length", "stg.nb_pings_per_sec",
|
||||
"stg.nb_pings_averaged_per_profile",
|
||||
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx",
|
||||
"stg.filename_BS_raw_data", "stg.path_BS_raw_data",
|
||||
"stg.BS_raw_data", "stg.time", "stg.depth",
|
||||
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape"
|
||||
]
|
||||
|
||||
for p in list_to_pop1:
|
||||
if isinstance(eval(p), list):
|
||||
|
|
@ -1380,11 +1401,19 @@ class AcousticDataTab(QWidget):
|
|||
if stg.BS_cross_section:
|
||||
|
||||
list_to_pop2 = ["stg.rmin", "stg.rmax", "stg.tmin", "stg.tmax",
|
||||
"stg.time_cross_section", "stg.BS_cross_section"]
|
||||
"stg.time_cross_section", "stg.depth_cross_section", "stg.BS_cross_section"]
|
||||
|
||||
for k in list_to_pop2:
|
||||
exec(k + ".pop(current_row)")
|
||||
|
||||
if stg.BS_stream_bed:
|
||||
|
||||
list_to_pop3 = ["stg.BS_stream_bed", "stg.depth_bottom",
|
||||
"stg.val_bottom", "stg.ind_bottom", "stg.freq_bottom_detection"]
|
||||
|
||||
for s in list_to_pop3:
|
||||
exec(s + ".pop(current_row)")
|
||||
|
||||
if self.fileListWidget.count() == 0:
|
||||
|
||||
# --- Clear measurements information ---
|
||||
|
|
@ -1463,17 +1492,18 @@ class AcousticDataTab(QWidget):
|
|||
|
||||
list_to_clear = [
|
||||
"stg.acoustic_data", "stg.date", "stg.hour",
|
||||
"stg.freq", "stg.freq_text", "stg.temperature",
|
||||
"stg.freq", "stg.freq_text",
|
||||
"stg.nb_profiles", "stg.nb_profiles_per_sec",
|
||||
"stg.nb_cells", "stg.cell_size",
|
||||
"stg.pulse_length", "stg.nb_pings_per_sec",
|
||||
"stg.nb_pings_averaged_per_profile",
|
||||
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx",
|
||||
"stg.filename_BS_raw_data", "stg.path_BS_raw_data",
|
||||
"stg.BS_raw_data", "stg.time", "stg.depth",
|
||||
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape",
|
||||
"stg.rmin", "stg.rmax", "stg.tmin", "stg.tmax",
|
||||
"stg.time_cross_section", "stg.depth_cross_section",
|
||||
"stg.BS_cross_section"
|
||||
"stg.BS_cross_section", "stg.BS_stream_bed"
|
||||
]
|
||||
|
||||
for k in list_to_clear:
|
||||
|
|
@ -1481,6 +1511,7 @@ class AcousticDataTab(QWidget):
|
|||
exec(k + ".clear()")
|
||||
|
||||
self.fileListWidget.clear()
|
||||
# self.fileListWidget.takeItem(0)
|
||||
|
||||
if self.fileListWidget.count() == 0:
|
||||
# --- Clear measurmeents information ---
|
||||
|
|
@ -1688,7 +1719,8 @@ class AcousticDataTab(QWidget):
|
|||
|
||||
def fill_measurements_information_groupbox_datetime(self):
|
||||
file_id = self.fileListWidget.currentRow()
|
||||
|
||||
print("file_id ", file_id)
|
||||
print("stg.date ", stg.date)
|
||||
self.label_date_acoustic_file.clear()
|
||||
|
||||
self.label_date_acoustic_file.setText(
|
||||
|
|
@ -2019,7 +2051,8 @@ class AcousticDataTab(QWidget):
|
|||
)
|
||||
|
||||
def fill_table(self):
|
||||
if self.fileListWidget.currentRow() != -1:
|
||||
# if self.fileListWidget.currentRow() != -1:
|
||||
if self.fileListWidget.selectedItems() != []:
|
||||
file_id = self.fileListWidget.currentRow()
|
||||
|
||||
header_list = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue