The list of pre-processed data to be renamed is updated trigerring SNR computation. The user can add or remove a file in the acoustic data tab and then, update signal preprocessing tab.
parent
5a98b13ad3
commit
65d30f01ae
|
|
@ -506,7 +506,7 @@ class SignalProcessingTab(QWidget):
|
|||
self.pushbutton_update.clicked.connect(self.update_SignalPreprocessingTab)
|
||||
|
||||
# self.combobox_fileListWidget.ShowPopUpWindowSignal.connect(self.event_combobobx_fileListWidget)
|
||||
self.combobox_fileListWidget.currentIndexChanged.connect(self.combobox_fileListWidget_change_index)
|
||||
# self.combobox_fileListWidget.currentIndexChanged.connect(self.combobox_fileListWidget_change_index)
|
||||
|
||||
self.radiobutton_file.toggled.connect(self.onClicked_radiobutton_noise_data)
|
||||
self.radiobutton_profile_tail.toggled.connect(self.onClicked_radiobutton_noise_data)
|
||||
|
|
@ -1211,17 +1211,21 @@ class SignalProcessingTab(QWidget):
|
|||
# self.combobox_fileListWidget.setCurrentIndex(0)
|
||||
# self.combobox_fileListWidget.currentIndexChanged.connect(self.combobox_fileListWidget_change_index)
|
||||
|
||||
for t in range(self.combobox_fileListWidget.count()):
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(t) + ".clear()")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(t) + ".setText(stg.filename_BS_raw_data[t])")
|
||||
# for t in range(self.combobox_fileListWidget.count()):
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(t) + ".clear()")
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(t) + ".setText(stg.filename_BS_raw_data[t])")
|
||||
#
|
||||
# if self.combobox_fileListWidget.count() > 0:
|
||||
#
|
||||
# for i in range(self.combobox_fileListWidget.count()):
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(i) + ".setDisabled(True)")
|
||||
# #
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
# self.combobox_fileListWidget.currentIndex()) + ".setEnabled(True)")
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
# self.combobox_fileListWidget.currentIndex()) + ".returnPressed.connect(self.rename_preprocessed_data)")
|
||||
|
||||
for i in range(self.combobox_fileListWidget.count()):
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(i) + ".setDisabled(True)")
|
||||
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".setEnabled(True)")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".returnPressed.connect(self.rename_preprocessed_data)")
|
||||
self.combobox_fileListWidget.currentIndexChanged.connect(self.combobox_fileListWidget_change_index)
|
||||
|
||||
# if self.combobox_fileListWidget.count() > 0:
|
||||
# for c in range(self.combobox_frequency_profile.count()):
|
||||
|
|
@ -1294,6 +1298,19 @@ class SignalProcessingTab(QWidget):
|
|||
# stg.BS_cross_section_pre_process_average[c] = (
|
||||
# stg.BS_cross_section_pre_process_average[c][:, stg.BS_cross_section[c].shape[1],stg.BS_cross_section[c].shape[2]])
|
||||
|
||||
def activate_list_of_pre_processed_data(self):
|
||||
for i in range(self.combobox_fileListWidget.count()):
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(i) + ".setDisabled(True)")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".setEnabled(True)")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".returnPressed.connect(self.rename_preprocessed_data)")
|
||||
|
||||
# for t in range(self.combobox_fileListWidget.count()):
|
||||
# eval("self.lineEdit_list_pre_processed_data_" + str(t) + ".clear()")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(self.combobox_fileListWidget.currentIndex()) +
|
||||
".setText(stg.filename_BS_raw_data[self.combobox_fileListWidget.currentIndex()])")
|
||||
|
||||
def rename_preprocessed_data(self):
|
||||
print("Before : stg.data_preprocessed ", stg.data_preprocessed)
|
||||
exec("stg.data_preprocessed[self.combobox_fileListWidget.currentIndex()] = "
|
||||
|
|
@ -1309,16 +1326,8 @@ class SignalProcessingTab(QWidget):
|
|||
# # textCursor().currentList().itemText(line)
|
||||
# stg.data_preprocessed
|
||||
|
||||
|
||||
def combobox_fileListWidget_change_index(self):
|
||||
|
||||
for i in range(self.combobox_fileListWidget.count()):
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(i) + ".setDisabled(True)")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".setEnabled(True)")
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".returnPressed.connect(self.rename_preprocessed_data)")
|
||||
|
||||
if (stg.noise_method[self.combobox_fileListWidget.currentIndex()] == 1)\
|
||||
or (stg.noise_method[self.combobox_fileListWidget.currentIndex()] == 0):
|
||||
self.radiobutton_file.setChecked(True)
|
||||
|
|
@ -1347,6 +1356,14 @@ class SignalProcessingTab(QWidget):
|
|||
[f for f in stg.freq_text[self.combobox_fileListWidget.currentIndex()]])
|
||||
self.plot_pre_processed_profile()
|
||||
|
||||
if self.combobox_fileListWidget.count() > 0:
|
||||
|
||||
for i in range(self.combobox_fileListWidget.count()):
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(i) + ".setDisabled(True)")
|
||||
#
|
||||
eval("self.lineEdit_list_pre_processed_data_" + str(
|
||||
self.combobox_fileListWidget.currentIndex()) + ".setEnabled(True)")
|
||||
|
||||
def onClicked_radiobutton_noise_data(self):
|
||||
# radiobutton = self.sender()
|
||||
# if radiobutton.isChecked():
|
||||
|
|
@ -1521,6 +1538,8 @@ class SignalProcessingTab(QWidget):
|
|||
|
||||
stg.noise_method[self.combobox_fileListWidget.currentIndex()] = 1
|
||||
|
||||
self.activate_list_of_pre_processed_data()
|
||||
|
||||
|
||||
def load_noise_data_and_compute_SNR(self):
|
||||
|
||||
|
|
@ -1745,6 +1764,8 @@ class SignalProcessingTab(QWidget):
|
|||
self.plot_pre_processed_BS_signal()
|
||||
self.plot_pre_processed_profile()
|
||||
|
||||
self.activate_list_of_pre_processed_data()
|
||||
|
||||
def plot_noise(self):
|
||||
self.horizontalLayout_groupbox_plot_noise_data.removeWidget(self.canvas_noise)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue