Slider cursor is connected to push buttons, line edit, and profil number value label

dev-brahim
brahim 2023-08-04 17:47:18 +02:00
parent fc8c406ff7
commit 2905226f2a
1 changed files with 250 additions and 190 deletions

View File

@ -1,7 +1,7 @@
import sys
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QGroupBox, QLabel, QCheckBox, \
QSpinBox, QDoubleSpinBox, QComboBox, QLineEdit, QSlider
QSpinBox, QDoubleSpinBox, QComboBox, QLineEdit, QSlider, QGridLayout
from PyQt5.QtGui import QFont, QIcon, QPixmap
from PyQt5.QtCore import Qt, QCoreApplication
@ -14,8 +14,15 @@ from matplotlib.colors import LogNorm
import Translation.constant_string as cs
from Model.acoustic_data_loader import AcousticDataLoader
_translate = QCoreApplication.translate
acoustic_data = AcousticDataLoader("/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/"
"Data/Acoustic_data/20180107123500.aqa")
noise_data = AcousticDataLoader("/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/"
"Data/AcousticNoise_data/20180107121600.aqa")
class SignalProcessingTab(QWidget):
@ -25,6 +32,8 @@ class SignalProcessingTab(QWidget):
super().__init__()
path_icon = "./icons/"
icon_triangle_left = QIcon(path_icon + "triangle_left.png")
icon_triangle_right = QIcon(path_icon + "triangle_right.png")
### --- General layout of widgets ---
@ -38,37 +47,46 @@ class SignalProcessingTab(QWidget):
# | options | | FCB option |
# |___________| |____________________________|
self.horizontalLayout_SignalProceesingTab = QHBoxLayout(widget_tab)
self.horizontalLayout_Main = QHBoxLayout(widget_tab)
self.verticalLayout_Left_SignalProcessingTab = QVBoxLayout()
self.horizontalLayout_SignalProceesingTab.addLayout(self.verticalLayout_Left_SignalProcessingTab, 2)
self.verticalLayout_Left = QVBoxLayout()
self.horizontalLayout_Main.addLayout(self.verticalLayout_Left, 2)
self.verticalLayout_Right_SignalProcessingTab = QVBoxLayout()
self.horizontalLayout_SignalProceesingTab.addLayout(self.verticalLayout_Right_SignalProcessingTab, 8)
self.verticalLayout_Right = QVBoxLayout()
self.horizontalLayout_Main.addLayout(self.verticalLayout_Right, 8)
# --------------------------------------------------------------------------------------------------------------
### --- Layout of groupbox in the Left vertical layout box
# Profile position
# --------------------
# Post processing
# --------------------
# FCB options
self.groupbox_display_profile_position = QGroupBox()
self.verticalLayout_Left.addWidget(self.groupbox_display_profile_position)
self.groupbox_post_processing = QGroupBox()
self.verticalLayout_Left.addWidget(self.groupbox_post_processing)
self.groupbox_FCBoption = QGroupBox()
self.verticalLayout_Left.addWidget(self.groupbox_FCBoption)
# +++++++++++++++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox Display Profile Position --- +++
# +++++++++++++++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_display_profile_position = QVBoxLayout(self.groupbox_display_profile_position)
self.label_profile_number = QLabel()
self.label_profile_number.setFont(QFont("Ubuntu", 16, QFont.Bold))
self.label_profile_number.setAlignment(Qt.AlignCenter)
self.label_profile_number.setText("Profile 1 / " + str(acoustic_data._time.shape[0]))
self.verticalLayout_groupbox_display_profile_position.addWidget(self.label_profile_number)
self.canvas_profile_position_on_transect = None
# # --------------------------------------------------------------------------------------------------------------
# ### --- Layout of groupbox in the Left vertical layout box
#
# # Profile position
# # --------------------
# # Post processing
# # --------------------
# # FCB options
#
# self.pushbutton_Load_data_from_acoustic_data_tab = QPushButton()
#
# self.verticalLayout_Left_SignalProcessingTab.addWidget(self.pushbutton_Load_data_from_acoustic_data_tab)
#
# self.groupbox_display_profile_position = QGroupBox()
# self.verticalLayout_groupbox_display_profile_position = QVBoxLayout(self.groupbox_display_profile_position)
#
# self.label_profile_number = QLabel()
# self.label_profile_number.setFont(QFont("Ubuntu", 16, QFont.Bold))
# self.label_profile_number.setAlignment(Qt.AlignCenter)
# self.string_profile_number = 1
# self.string_profile_number_max = 2300
# self.verticalLayout_groupbox_display_profile_position.addWidget(self.label_profile_number)
#
# self.figure_plot_profile_position_on_transect, self.axis_plot_profile_position_on_transect = \
# plt.subplots(nrows=1, ncols=1, layout="constrained")
# self.canvas_plot_profile_position_on_transect = FigureCanvas(self.figure_plot_profile_position_on_transect)
@ -108,8 +126,13 @@ class SignalProcessingTab(QWidget):
# # self.horizontalLayout_slider_plot_profile_position.addWidget(self.slider_plot_profile_position)
#
# # self.horizontalLayoutTop_signalProcessing.addWidget(self.groupbox_display_profile_position, 3)
# self.verticalLayout_left_SignalProcessingTab.addWidget(self.groupbox_display_profile_position)
#
# ++++++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox Post Processing --- +++
# ++++++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_post_processing = QVBoxLayout(self.groupbox_post_processing)
# # self.checkbox_substract_noise = QCheckBox()
# # self.checkbox_substract_noise.setText("Substract the noise")
# # self.verticalLayout_averaged_profile = QVBoxLayout(self.checkbox_substract_noise)
@ -138,15 +161,15 @@ class SignalProcessingTab(QWidget):
# # self.horizontalLayoutMid_signalProcessing = QHBoxLayout()
# # self.verticalLayout_signalProcessingTab.addLayout(self.horizontalLayoutMid_signalProcessing, 3)
#
# self.groupbox_post_processing = QGroupBox()
# # self.groupbox_post_processing.setTitle("Post processing")
#
# self.verticalLayout_groupbox_post_processing = QVBoxLayout(self.groupbox_post_processing)
#
# self.groupbox_acoustic_profile = QGroupBox()
# # self.groupbox_acoustic_profile.setTitle("Acoustic profile")
#
# # self.gridLayout_groupbox_acoustic_profile = QGridLayout(self.groupbox_acoustic_profile)
# --- Groupbox acoustic profile ---
self.groupbox_acoustic_profile = QGroupBox()
self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_acoustic_profile)
# self.gridLayout_groupbox_acoustic_profile = QGridLayout(self.groupbox_acoustic_profile)
# self.horizontalLayout_acoustic_profile = QHBoxLayout(self.groupbox_acoustic_profile)
# # self.label_subtract_noise = QLabel()
# # self.label_subtract_noise.setText("Subtract the noise")
@ -200,46 +223,41 @@ class SignalProcessingTab(QWidget):
# # self.horizontalLayout_SNR_criterion.addWidget(self.checkbox_SNR_criterion_disable)
# # self.verticalLayout_post_processing.addLayout(self.horizontalLayout_SNR_criterion)
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.checkbox_SNR_criterion_disable, 1, 3, 1, 1)
#
# self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_acoustic_profile)
#
# # self.horizontalLayout_averaged_profile_despiking_signal = QHBoxLayout()
# # self.verticalLayout_groupbox_post_processing.addLayout(self.horizontalLayout_averaged_profile_despiking_signal)
#
# self.groupbox_window_size = QGroupBox()
# # self.groupbox_window_size.setTitle("Window size")
#
# # self.gridLayout_groupbox_window_size = QGridLayout(self.groupbox_window_size)
# self.verticalLayout_windowsize = QVBoxLayout(self.groupbox_window_size)
#
# --- Groupbox Window size ---
self.groupbox_window_size = QGroupBox()
self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_window_size)
self.horizontalLayout_groupbox_window_size = QHBoxLayout(self.groupbox_window_size)
self.label_signal_averaging_over = QLabel()
self.label_signal_averaging_over.setText("Signal averaging over ")
self.horizontalLayout_groupbox_window_size.addWidget(self.label_signal_averaging_over)
self.spinbox_average = QSpinBox()
self.spinbox_average.setRange(0, 9999)
self.spinbox_average.setValue(0)
self.horizontalLayout_groupbox_window_size.addWidget(self.spinbox_average)
self.label_cells = QLabel()
self.horizontalLayout_groupbox_window_size.addWidget(self.label_cells)
# # self.groupbox_averageprofile_despikingsignal = QGroupBox()
# # self.groupbox_averageprofile_despikingsignal.setTitle("Averaged profiles && Despiking the signal")
# # self.verticalLayout_groupbox_averageprofile_despikingsignal = QVBoxLayout(self.groupbox_averageprofile_despikingsignal)
#
# # self.groupbox_plot_averaged_profile = QGroupBox()
# # self.groupbox_plot_averaged_profile.setTitle("Window size")
# # self.verticalLayout_plot_averaged_profile = QVBoxLayout(self.groupbox_plot_averaged_profile)
#
# self.horizontalLayout_horizontal_average = QHBoxLayout()
# self.verticalLayout_windowsize.addLayout(self.horizontalLayout_horizontal_average)
# # self.label_nb_horizontal_cells = QLabel()
# # self.label_nb_horizontal_cells.setText("Horizontal: +/-")
# self.checkbox_nb_horizontal_cells = QCheckBox()
# self.checkbox_nb_horizontal_cells.setChecked(False)
# # self.checkbox_nb_horizontal_cells.setText("Horizontal: +/-")
# self.checkbox_nb_horizontal_cells.setToolTip("Enable for further computation")
# self.horizontalLayout_horizontal_average.addWidget(self.checkbox_nb_horizontal_cells)
# # self.gridLayout_groupbox_window_size.addWidget(self.label_nb_horizontal_cells, 0, 0, 1, 1)
# # self.lineEdit_nb_horizontal_cells = QLineEdit()
# # self.lineEdit_nb_horizontal_cells.setText("1")
# self.spinbox_nb_horizontal_cells = QSpinBox()
# self.spinbox_nb_horizontal_cells.setRange(0, 9999)
# self.spinbox_nb_horizontal_cells.setValue(0)
# self.horizontalLayout_horizontal_average.addWidget(self.spinbox_nb_horizontal_cells)
# # self.gridLayout_groupbox_window_size.addWidget(self.lineEdit_nb_horizontal_cells, 0, 1, 1, 1)
# self.label_nb_horizontal_cells_cm = QLabel()
#
# # self.label_nb_horizontal_cells_cm.setText("cells = +/- ? cm")
# self.horizontalLayout_horizontal_average.addWidget(self.label_nb_horizontal_cells_cm)
#
# # self.verticalLayout_plot_averaged_profile.addLayout(self.horizontalLayout_horizontal_average)
# # self.gridLayout_groupbox_window_size.addWidget(self.label_nb_horizontal_cells_cm, 0, 2, 1, 1)
# # self.checkbox_nb_horizontal_cell_enable = QCheckBox()
@ -287,10 +305,12 @@ class SignalProcessingTab(QWidget):
# # self.verticalLayout_groupbox_averageprofile_despikingsignal.addWidget(self.groupbox_plot_averaged_profile)
#
# # self.horizontalLayout_averaged_profile_despiking_signal.addWidget(self.groupbox_window_size)
#
# self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_window_size)
#
# self.groupbox_rayleigh_criterion = QGroupBox()
# --- Groupbox Rayleigh criterion ---
self.groupbox_rayleigh_criterion = QGroupBox()
self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_rayleigh_criterion)
# # self.groupbox_rayleigh_criterion.setTitle("Rayleigh criterion")
# # self.groupbox_despiking_signal = QGroupBox()
# # self.groupbox_despiking_signal.setTitle("Despiking the signal")
@ -330,26 +350,25 @@ class SignalProcessingTab(QWidget):
# # self.horizontalLayout_averaged_profile_despiking_signal.addWidget(self.groupbox_rayleigh_criterion)
#
# # self.verticalLayout_groupbox_averageprofile_despikingsignal.addWidget(self.groupbox_despiking_signal)
#
# self.verticalLayout_groupbox_post_processing.addWidget(self.groupbox_rayleigh_criterion)
#
# # self.horizontalLayoutMid_signalProcessing.addWidget(self.groupbox_post_processing, 3)
# self.verticalLayout_left_SignalProcessingTab.addWidget(self.groupbox_post_processing)
#
# # self.horizontalLayoutBottom_signalProcessing = QHBoxLayout()
# # self.verticalLayout_signalProcessingTab.addLayout(self.horizontalLayoutBottom_signalProcessing, 3)
#
# # --- GroupBox FCB options ---
#
# self.groupbox_FCBoption = QGroupBox()
# # self.groupbox_FCBoption.setTitle("FCB options")
# # self.horizontalLayoutBottom_signalProcessing.addWidget(self.groupbox_FCBoption, 3)
# self.verticalLayout_left_SignalProcessingTab.addWidget(self.groupbox_FCBoption)
#
# self.verticalLayout_groupbox_FCBoption = QVBoxLayout(self.groupbox_FCBoption)
#
# self.groupbox_water_attenuation = QGroupBox()
# # self.groupbox_water_attenuation.setTitle("Computing water attenuation")
# ++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox FCB options --- +++
# ++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_FCBoption = QVBoxLayout(self.groupbox_FCBoption)
# --- Groupbox water attenuation ---
self.groupbox_water_attenuation = QGroupBox()
self.verticalLayout_groupbox_FCBoption.addWidget(self.groupbox_water_attenuation)
# self.verticalLayout_groupbox_water_attenuation = QVBoxLayout(self.groupbox_water_attenuation)
# self.horizontalLayout_waterAttenuationModel_temperature = QHBoxLayout()
# self.verticalLayout_groupbox_water_attenuation.addLayout(
@ -389,11 +408,12 @@ class SignalProcessingTab(QWidget):
# self.label_water_attenuation.setText("\u03B1w = 0.02 dB/m")
# self.label_water_attenuation.setFont(QFont("Ubuntu", 14, QFont.Normal))
# self.horizontalLayout_comboboxFrequencies_WaterAttenuationValue.addWidget(self.label_water_attenuation)
#
# self.verticalLayout_groupbox_FCBoption.addWidget(self.groupbox_water_attenuation)
#
# self.groupbox_fit_regression_line = QGroupBox()
# # self.groupbox_fit_regression_line.setTitle("Fit regression line")
# --- Groupbox fit regression line ---
self.groupbox_fit_regression_line = QGroupBox()
self.verticalLayout_groupbox_FCBoption.addWidget(self.groupbox_fit_regression_line)
# self.verticalLayout_groupbox_fit_regression = QVBoxLayout(self.groupbox_fit_regression_line)
#
# self.label_alphaS_expression = QLabel()
@ -439,19 +459,40 @@ class SignalProcessingTab(QWidget):
# self.label_alphaS.setText("\u03B1s = " + "0.0" + "dB/m")
# self.label_alphaS.setFont(QFont("Ubuntu", 14, QFont.Normal))
# self.horizontalLayout_fitButton_alphaWvalue.addWidget(self.label_alphaS)
#
# self.verticalLayout_groupbox_FCBoption.addWidget(self.groupbox_fit_regression_line)
#
# # self.verticalLayout_groupbox_fit_regression
#
# ### ---------- Plot Profile ----------
#
# --------------------------------------------------------------------------------------------------------------
### --- Layout of groupbox in the Right vertical layout box
# Plot Profiles
# -------------------------
# Plot averaged profile
# -------------------------
# Plot FCB profiles
self.groupbox_plot_profile = QGroupBox()
self.verticalLayout_Right.addWidget(self.groupbox_plot_profile)
self.groupbox_plot_averaged_profile = QGroupBox()
self.verticalLayout_Right.addWidget(self.groupbox_plot_averaged_profile)
self.groupbox_FCB_profile = QGroupBox()
self.verticalLayout_Right.addWidget(self.groupbox_FCB_profile)
# +++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox Plot profile --- +++
# +++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_plot_profile = QVBoxLayout(self.groupbox_plot_profile)
self.canvas_profile = None
# # self.data_test_slider = np.array([[0, 1, 2, 3, 4, 5],
# # [0, 1, 4, 9, 16, 25],
# # [0, 1, 8, 27, 64, 125]])
#
# self.groupbox_plot_profile = QGroupBox()
# # self.groupbox_plot_profile.setTitle("Profile")
#
#
# self.verticalLayout_plotprofiles = QVBoxLayout(self.groupbox_plot_profile)
# self.figure_profile, self.axis_profile = plt.subplots(nrows=1, ncols=4, layout='constrained')
@ -481,13 +522,13 @@ class SignalProcessingTab(QWidget):
# # self.horizontalLayoutTop_signalProcessing.addLayout(self.verticalLayout_plotprofiles, 7)
# # self.horizontalLayoutTop_signalProcessing.addWidget(self.groupbox_plot_profile, 7)
# # self.verticalLayout_right_SignalProcessingTab.addWidget(self.toolbar_profile)
# self.verticalLayout_right_SignalProcessingTab.addWidget(self.groupbox_plot_profile)
#
# ### ---------- Plot averaged profile ----------
#
# self.groupbox_plot_averaged_profile = QGroupBox()
# # self.groupbox_plot_averaged_profile.setTitle("Averaged profile")
#
# ++++++++++++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox Plot averaged profile --- +++
# ++++++++++++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_plot_averaged_profile = QVBoxLayout(self.groupbox_plot_averaged_profile)
# self.verticalLayout_averagedprofile = QVBoxLayout(self.groupbox_plot_averaged_profile)
# self.figure_averagedprofile, self.axis_averagedprofile = plt.subplots(nrows=1, ncols=4, layout='constrained')
# self.canvas_averagedprofile = FigureCanvas(self.figure_averagedprofile)
@ -534,13 +575,13 @@ class SignalProcessingTab(QWidget):
#
# # self.horizontalLayoutMid_signalProcessing.addLayout(self.verticalLayout_averagedprofile, 7)
# # self.horizontalLayoutMid_signalProcessing.addWidget(self.groupbox_plot_averaged_profile, 7)
# self.verticalLayout_right_SignalProcessingTab.addWidget(self.groupbox_plot_averaged_profile)
#
# ### ---------- Plot FCB profile ----------
#
# self.groupbox_FCB_profile = QGroupBox()
# # self.groupbox_FCB_profile.setTitle("FCB profile")
#
# ++++++++++++++++++++++++++++++++++++++++++++++
# +++ --- GroupBox Plot FCB profile --- +++
# ++++++++++++++++++++++++++++++++++++++++++++++
self.verticalLayout_groupbox_FCB_profile = QVBoxLayout(self.groupbox_FCB_profile)
# self.verticalLayout_FCBoptions = QVBoxLayout(self.groupbox_FCB_profile)
# self.figure_FCBoptions, self.axis_FCBoptions = plt.subplots(nrows=1, ncols=4, layout="constrained")
# self.canvas_FCBoptions = FigureCanvas(self.figure_FCBoptions)
@ -587,97 +628,126 @@ class SignalProcessingTab(QWidget):
#
# # self.horizontalLayoutBottom_signalProcessing.addLayout(self.verticalLayout_FCBoptions, 7)
# # self.horizontalLayoutBottom_signalProcessing.addWidget(self.groupbox_FCB_profile, 7)
# self.verticalLayout_right_SignalProcessingTab.addWidget(self.groupbox_FCB_profile)
#
# self.horizontalLayout_slider_plotprofil = QHBoxLayout()
#
# icon_triangle_right = QIcon()
# icon_triangle_right.addPixmap(QPixmap(path_icon + "triangle_right.png"))
# icon_triangle_left = QIcon()
# icon_triangle_left.addPixmap(QPixmap(path_icon + "triangle_left.png"))
#
# self.pushButton_slider_plotprofile_right = QPushButton()
# self.pushButton_slider_plotprofile_right.setIcon(icon_triangle_right)
#
# self.pushButton_slider_plotprofile_right.clicked.connect(self.slide_profile_number_to_right)
#
# self.pushButton_slider_plotprofile_left = QPushButton()
# self.pushButton_slider_plotprofile_left.setIcon(icon_triangle_left)
# # print(self.pushButton_slider_plotprofile_left.size().width())
#
# self.pushButton_slider_plotprofile_left.clicked.connect(self.slide_profile_number_to_left)
#
# --- Slider ----
self.horizontalLayout_slider = QHBoxLayout()
self.verticalLayout_Right.addLayout(self.horizontalLayout_slider)
self.pushbutton_slider_left = QPushButton()
self.pushbutton_slider_left.setIcon(icon_triangle_left)
self.horizontalLayout_slider.addWidget(self.pushbutton_slider_left)
self.pushbutton_slider_right = QPushButton()
self.pushbutton_slider_right.setIcon(icon_triangle_right)
self.horizontalLayout_slider.addWidget(self.pushbutton_slider_right)
self.pushbutton_slider_right.clicked.connect(self.slide_profile_number_to_right)
self.pushbutton_slider_left.clicked.connect(self.slide_profile_number_to_left)
# self.horizontalLayout_slider_plotprofil.addWidget(self.pushButton_slider_plotprofile_left)
# self.horizontalLayout_slider_plotprofil.addWidget(self.pushButton_slider_plotprofile_right)
#
# self.lineEdit_slider_acoustic_profile = QLineEdit()
# self.lineEdit_slider_acoustic_profile.setText("1")
self.lineEdit_slider = QLineEdit()
self.lineEdit_slider.setText("1")
# # self.lineEdit_slider_acoustic_profile.setFixedWidth(self.pushButton_slider_plotprofile_left.size().width())
# self.lineEdit_slider_acoustic_profile.setFixedWidth(50)
# self.horizontalLayout_slider_plotprofil.addWidget(self.lineEdit_slider_acoustic_profile)
#
# self.lineEdit_slider_acoustic_profile.returnPressed.connect(self.profile_number_on_lineEdit)
#
# self.slider_plotprofile = QSlider()
# self.slider_plotprofile.setOrientation(Qt.Horizontal)
self.lineEdit_slider.setFixedWidth(50)
self.horizontalLayout_slider.addWidget(self.lineEdit_slider)
self.lineEdit_slider.returnPressed.connect(self.profile_number_on_lineEdit)
self.slider = QSlider()
self.horizontalLayout_slider.addWidget(self.slider, 9)
self.slider.setOrientation(Qt.Horizontal)
# # self.slider_plotprofile.setTickPosition(QSlider.TicksBelow)
# self.slider_plotprofile.setCursor(Qt.OpenHandCursor)
# self.slider_plotprofile.setMinimum(1)
# self.slider_plotprofile.setMaximum(self.model.BS_averaged_cross_section_corr.V.shape[2])
# self.slider_plotprofile.setTickInterval(1)
# self.slider_plotprofile.setValue(1)
# self.slider_plotprofile.valueChanged.connect(self.changePlot)
#
# self.horizontalLayout_slider_plotprofil.addWidget(self.slider_plotprofile, 9)
#
# self.verticalLayout_right_SignalProcessingTab.addLayout(self.horizontalLayout_slider_plotprofil)
#
# self.retranslate_signal_processing_tab()
#
#
#
self.slider.setCursor(Qt.OpenHandCursor)
self.slider.setMinimum(1)
self.slider.setMaximum(acoustic_data._time.shape[0])#self.model.BS_averaged_cross_section_corr.V.shape[2])
self.slider.setTickInterval(1)
self.slider.setValue(1)
self.slider.valueChanged.connect(self.update_lineEdit_by_moving_slider)
self.slider.valueChanged.connect(self.plot_profile_position_on_transect)
self.slider.valueChanged.connect(self.plot_profile)
self.retranslate_signal_processing_tab()
# # -------------------- Functions for Signal processing Tab --------------------
#
# def retranslate_signal_processing_tab(self):
#
def retranslate_signal_processing_tab(self):
# self.pushbutton_Load_data_from_acoustic_data_tab.setText(
# _translate("CONSTANT_STRING", cs.LOAD_DATA_FROM_ACOUSTIC_DATA_TAB))
#
# self.groupbox_display_profile_position.setTitle(_translate("CONSTANT_STRING", cs.DISPLAY_PROFILE_POSITION))
# self.label_profile_number.setText(_translate("CONSTANT_STRING", cs.PROFILE_NUMBER) + " " +
# str(self.string_profile_number) + " / " + str(self.string_profile_number_max))
#
# self.groupbox_post_processing.setTitle(_translate("CONSTANT_STRING", cs.POST_PROCESSING))
#
# self.groupbox_acoustic_profile.setTitle(_translate("CONSTANT_STRING", cs.ACOUSTIC_PROFILE))
self.groupbox_display_profile_position.setTitle(_translate("CONSTANT_STRING", cs.DISPLAY_PROFILE_POSITION))
# self.label_profile_number.setText(_translate("CONSTANT_STRING", cs.PROFILE_NUMBER) + " " +
# str(self.string_profile_number) + " / " + str(self.string_profile_number_max))
self.groupbox_post_processing.setTitle(_translate("CONSTANT_STRING", cs.POST_PROCESSING))
self.groupbox_acoustic_profile.setTitle(_translate("CONSTANT_STRING", cs.ACOUSTIC_PROFILE))
# self.checkbox_substract_noise.setText(_translate("CONSTANT_STRING", cs.SUBTRACT_THE_NOISE))
# self.checkbox_SNR_criterion.setText(_translate("CONSTANT_STRING", cs.SNR_CRITERION))
#
# self.groupbox_window_size.setTitle(_translate("CONSTANT_STRING", cs.WINDOW_SIZE))
# self.checkbox_nb_horizontal_cells.setText(_translate("CONSTANT_STRING", cs.HORIZONTAL) + ": +/-")
# self.label_nb_horizontal_cells_cm.setText(_translate("CONSTANT_STRING", cs.CELLS) + " = +/- ? cm")
# self.checkbox_nb_vertical_cells.setText(_translate("CONSTANT_STRING", cs.VERTICAL) + ": +/-")
# self.label_nb_vertical_cells_cm.setText(_translate("CONSTANT_STRING", cs.CELLS) + " = +/- ? cm")
#
# self.groupbox_rayleigh_criterion.setTitle(_translate("CONSTANT_STRING", cs.RAYLEIGH_CRITERION))
self.groupbox_window_size.setTitle(_translate("CONSTANT_STRING", cs.WINDOW_SIZE))
# self.label_averageH.setText(_translate("CONSTANT_STRING", cs.HORIZONTAL) + ": +/-")
self.label_cells.setText(_translate("CONSTANT_STRING", cs.CELLS) + " = +/- ? sec")
self.groupbox_rayleigh_criterion.setTitle(_translate("CONSTANT_STRING", cs.RAYLEIGH_CRITERION))
# self.checkbox_despiked_acoustic_signal.setText(_translate("CONSTANT_STRING", cs.DESPIKING))
#
# self.groupbox_FCBoption.setTitle(_translate("CONSTANT_STRING", cs.FCB_OPTIONS))
self.groupbox_FCBoption.setTitle(_translate("CONSTANT_STRING", cs.FCB_OPTIONS))
#
# self.groupbox_water_attenuation.setTitle(_translate("CONSTANT_STRING", cs.COMPUTING_WATER_ATTENUATION))
self.groupbox_water_attenuation.setTitle(_translate("CONSTANT_STRING", cs.COMPUTING_WATER_ATTENUATION))
# self.label_temperature_water_attenation.setText(_translate("CONSTANT_STRING", cs.TEMPERATURE) + ":")
#
# self.groupbox_fit_regression_line.setTitle(_translate("CONSTANT_STRING", cs.FIT_REGRESSION_LINE))
self.groupbox_fit_regression_line.setTitle(_translate("CONSTANT_STRING", cs.FIT_REGRESSION_LINE))
# self.label_alphaS_expression.setText(
# _translate("CONSTANT_STRING", cs.FOR_HOMOGENEOUS_SUSPENSION) + ": dFCB/dr = -2\u03B1<sub>s<\sub>")
# self.label_alphaS_computation_from.setText(_translate("CONSTANT_STRING", cs.FROM))
# self.label_alphaS_computation_to.setText(_translate("CONSTANT_STRING", cs.TO))
#
# self.groupbox_plot_profile.setTitle(_translate("CONSTANT_STRING", cs.PROFILE))
# self.groupbox_plot_averaged_profile.setTitle(_translate("CONSTANT_STRING", cs.AVERAGED_PROFILE))
# self.groupbox_FCB_profile.setTitle(_translate("CONSTANT_STRING", cs.FCB_PROFILE))
#
#
self.groupbox_plot_profile.setTitle(_translate("CONSTANT_STRING", cs.PROFILE))
self.groupbox_plot_averaged_profile.setTitle(_translate("CONSTANT_STRING", cs.AVERAGED_PROFILE))
self.groupbox_FCB_profile.setTitle(_translate("CONSTANT_STRING", cs.FCB_PROFILE))
def slide_profile_number_to_right(self):
self.slider.setValue(int(self.slider.value()) + 1)
self.lineEdit_slider.setText(str(self.slider.value()))
def slide_profile_number_to_left(self):
self.slider.setValue(int(self.slider.value()) - 1)
self.lineEdit_slider.setText(str(self.slider.value()))
def profile_number_on_lineEdit(self):
self.slider.setValue(int(self.lineEdit_slider.text()))
def update_lineEdit_by_moving_slider(self):
self.lineEdit_slider.setText(str(self.slider.value()))
def plot_profile_position_on_transect(self):
self.label_profile_number.clear()
self.label_profile_number.setText("Profile " + str(self.slider.value()) + " / " + str(self.slider.maximum()))
def plot_profile(self):
if self.canvas_profile == None:
self.figure_profile, self.axis_profile = plt.subplots(nrows=1, ncols=acoustic_data._freq.shape[0], layout='constrained')
self.canvas_profile = FigureCanvas(self.figure_profile)
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_profile)
for f in range(acoustic_data._freq.shape[0]):
self.axis_profile[f].cla()
self.axis_profile[f].plot(acoustic_data._BS_raw_data[:, f, self.slider.value()-1],
acoustic_data._r)
self.canvas_profile.draw()
def compute_averaged_profile(self):
pass
# def plot_transect_bottom_with_profile_position(self, profile_position):
# frequency = self.model.Freq[0]
# val_min = 0 # np.nanmin(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
@ -742,17 +812,7 @@ class SignalProcessingTab(QWidget):
# # self.figure_averagedprofile.canvas.flush_events()
# self.figure_FCBoptions.canvas.draw_idle()
# # self.figure_FCBoptions.canvas.flush_events()
#
# def profile_number_on_lineEdit(self):
# self.slider_plotprofile.setValue(int(self.lineEdit_slider_acoustic_profile.text()))
# print("profile number = ", self.lineEdit_slider_acoustic_profile.text())
#
# def slide_profile_number_to_right(self):
# self.slider_plotprofile.setValue(int(self.slider_plotprofile.value()) + 1)
#
# def slide_profile_number_to_left(self):
# self.slider_plotprofile.setValue(int(self.slider_plotprofile.value()) - 1)
#
# def linear(self, figure, axis, i):
# # for i in range(4):
# # axis[i].plot([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], '*-')