First commit of View file
parent
2b429bc6a2
commit
ddb4f7f7a9
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,142 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QWidget, QMainWindow, QApplication, QVBoxLayout, QHBoxLayout, QGroupBox
|
||||||
|
from PyQt5.QtCore import QCoreApplication
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
from matplotlib.colors import LogNorm, BoundaryNorm, CSS4_COLORS
|
||||||
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
|
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
||||||
|
|
||||||
|
|
||||||
|
import Translation.constant_string as cs
|
||||||
|
|
||||||
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
|
||||||
|
class AcousticInversionTab(QWidget):
|
||||||
|
|
||||||
|
''' This class generates the Acoustic Inversion Tab '''
|
||||||
|
|
||||||
|
def __init__(self, widget_tab):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
#
|
||||||
|
# self.verticalLayout_acoustic_inversion_tab = QVBoxLayout(widget_tab)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_Top_acousticInversionTab = QHBoxLayout()
|
||||||
|
#
|
||||||
|
# self.groupbox_AcousticInversionOption = QGroupBox()
|
||||||
|
# # self.groupbox_AcousticInversionOption.setTitle("Acoustic inversion option")
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_Top_acousticInversionTab.addWidget(self.groupbox_AcousticInversionOption)
|
||||||
|
#
|
||||||
|
# self.verticalLayout_acoustic_inversion_tab.addLayout(self.horizontalLayout_Top_acousticInversionTab, 4)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_Bottom_acousticInversionTab = QHBoxLayout()
|
||||||
|
#
|
||||||
|
# self.groupbox_sediment_concentration_2Dplot = QGroupBox()
|
||||||
|
# # self.groupbox_sediment_concentration_2Dplot.setTitle("Fine and sand sediment concentration")
|
||||||
|
#
|
||||||
|
# self.verticalLayout_groupbox_sediment_concentration_2Dplot = QVBoxLayout(self.groupbox_sediment_concentration_2Dplot)
|
||||||
|
#
|
||||||
|
# self.figure_SSC_2Dplot, self.axis_SSC_2Dplot = plt.subplots(nrows=2, ncols=1)
|
||||||
|
# self.canvas_sediments2DPlot = FigureCanvas(self.figure_SSC_2Dplot)
|
||||||
|
# self.toolbar_concentration_2Dplot = NavigationToolBar(self.canvas_sediments2DPlot, self)
|
||||||
|
# self.plot_SSC_fine()
|
||||||
|
# self.plot_SSC_sand()
|
||||||
|
# # self.verticalLayout_groupbox_sediment_concentration_2Dplot.addWidget(self.toolbar_concentration_2Dplot)
|
||||||
|
# self.verticalLayout_groupbox_sediment_concentration_2Dplot.addWidget(self.canvas_sediments2DPlot)
|
||||||
|
#
|
||||||
|
# # self.horizontalLayout_Bottom_acousticInversionTab.addWidget(self.canvas_sediments2DPlot)
|
||||||
|
# self.horizontalLayout_Bottom_acousticInversionTab.addWidget(self.groupbox_sediment_concentration_2Dplot, 7)
|
||||||
|
#
|
||||||
|
# self.groupbox_sediment_concentration_sample_vs_measurement = QGroupBox()
|
||||||
|
# # self.groupbox_sediment_concentration_sample_vs_measurement.setTitle(
|
||||||
|
# # "Suspended sediment concentration plot : acoustic inversion theory VS measurements")
|
||||||
|
#
|
||||||
|
# self.verticalLayout_groupbox_sediment_concentration_sample_vs_measurement = QVBoxLayout(
|
||||||
|
# self.groupbox_sediment_concentration_sample_vs_measurement)
|
||||||
|
#
|
||||||
|
# self.figure_inverseSSC_vs_measuredSSC, self.axis_inverseSSC_vs_measuredSSC = plt.subplots(nrows=1, ncols=1)
|
||||||
|
# self.canvas_InverseSSC_vs_MeasuredSSC = FigureCanvas(self.figure_inverseSSC_vs_measuredSSC)
|
||||||
|
# self.toolbar_InverseSSC_vs_MeasuredSSC = NavigationToolBar(self.canvas_InverseSSC_vs_MeasuredSSC, self)
|
||||||
|
# # self.verticalLayout_groupbox_sediment_concentration_sample_vs_measurement.addWidget(
|
||||||
|
# # self.toolbar_InverseSSC_vs_MeasuredSSC)
|
||||||
|
# self.verticalLayout_groupbox_sediment_concentration_sample_vs_measurement.addWidget(
|
||||||
|
# self.canvas_InverseSSC_vs_MeasuredSSC, 3)
|
||||||
|
# # self.horizontalLayout_Bottom_acousticInversionTab.addWidget(self.canvas_InverseSSC_vs_MeasuredSSC)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_Bottom_acousticInversionTab.addWidget(
|
||||||
|
# self.groupbox_sediment_concentration_sample_vs_measurement)
|
||||||
|
#
|
||||||
|
# self.verticalLayout_acoustic_inversion_tab.addLayout(self.horizontalLayout_Bottom_acousticInversionTab, 6)
|
||||||
|
#
|
||||||
|
# self.retranslate_acoustic_inversion_tab()
|
||||||
|
#
|
||||||
|
# # ---------------------------------------------------------------------------------------------
|
||||||
|
# # -------------------- Functions --------------------
|
||||||
|
# # ---------------------------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# def retranslate_acoustic_inversion_tab(self):
|
||||||
|
#
|
||||||
|
# self.groupbox_AcousticInversionOption.setTitle(_translate("CONSTANT_STRING", cs.ACOUSTIC_INVERSION_OPTIONS))
|
||||||
|
# self.groupbox_sediment_concentration_2Dplot.setTitle(_translate("CONSTANT_STRING", cs.FINE_AND_SAND_SEDIMENTS_CONCENTRATION_2D_FIELD))
|
||||||
|
# self.groupbox_sediment_concentration_sample_vs_measurement.setTitle(_translate("CONSTANT_STRING", cs.SUSPENDED_SEDIMENT_CONCENTRATION_PLOT))
|
||||||
|
#
|
||||||
|
# def plot_SSC_fine(self):
|
||||||
|
# frequency = 0
|
||||||
|
# val_min = 1e-2 #np.nanmin(self.model.SSC_fine[:, :]) #
|
||||||
|
# val_max = 15 #np.nanmax(self.model.SSC_fine[:, :]) #
|
||||||
|
# # print('val_min=', val_min)
|
||||||
|
# # print('val_max=', val_max)
|
||||||
|
# # if val_min == 0:
|
||||||
|
# # val_min = 0.5
|
||||||
|
# # print('val_min update =', val_min)
|
||||||
|
# pcm_SSC_fine = self.axis_SSC_2Dplot[0].pcolormesh(self.model.dist_BS_section, np.flipud(self.model.BS_averaged_cross_section.r),
|
||||||
|
# self.model.SSC_fine[:, :],
|
||||||
|
# cmap='rainbow', norm=LogNorm(vmin=val_min, vmax=val_max), shading='gouraud')
|
||||||
|
# self.axis_SSC_2Dplot[0].plot(self.model.dist_BS_section,
|
||||||
|
# np.max(self.model.r_bottom_cross_section) - self.model.r_bottom_cross_section
|
||||||
|
# + np.min(self.model.r_bottom_cross_section),
|
||||||
|
# color='k', linewidth=2)
|
||||||
|
# self.figure_SSC_2Dplot.supxlabel("Distance from left bank (m)", fontsize=10)
|
||||||
|
# self.figure_SSC_2Dplot.supylabel("Depth (m)", fontsize=10)
|
||||||
|
# self.figure_SSC_2Dplot.tight_layout()
|
||||||
|
#
|
||||||
|
# cbar_SSC_fine = self.figure_SSC_2Dplot.colorbar(pcm_SSC_fine, ax=self.axis_SSC_2Dplot[0], shrink=1, location='right')
|
||||||
|
# cbar_SSC_fine.set_label(label='Fine SSC (g/L', rotation=270, labelpad=15)
|
||||||
|
#
|
||||||
|
# def plot_SSC_sand(self):
|
||||||
|
# frequency = 0
|
||||||
|
# val_min = 1e-2 #np.nanmin(self.model.SSC_fine[:, :]) #
|
||||||
|
# val_max = 2 #np.nanmax(self.model.SSC_fine[:, :]) #
|
||||||
|
# # print('val_min=', val_min)
|
||||||
|
# # print('val_max=', val_max)
|
||||||
|
# # if val_min == 0:
|
||||||
|
# # val_min = 0.5
|
||||||
|
# # print('val_min update =', val_min)
|
||||||
|
# pcm_SSC_sand = self.axis_SSC_2Dplot[1].pcolormesh(self.model.dist_BS_section, np.flipud(self.model.BS_averaged_cross_section.r),
|
||||||
|
# self.model.SSC_sand[:, :],
|
||||||
|
# cmap='rainbow', norm=LogNorm(vmin=val_min, vmax=val_max), shading='gouraud')
|
||||||
|
# self.axis_SSC_2Dplot[1].plot(self.model.dist_BS_section,
|
||||||
|
# np.max(self.model.r_bottom_cross_section) - self.model.r_bottom_cross_section
|
||||||
|
# + np.min(self.model.r_bottom_cross_section),
|
||||||
|
# color='k', linewidth=2)
|
||||||
|
# self.figure_SSC_2Dplot.supxlabel("Distance from left bank (m)", fontsize=10)
|
||||||
|
# self.figure_SSC_2Dplot.supylabel("Depth (m)", fontsize=10)
|
||||||
|
# self.figure_SSC_2Dplot.tight_layout()
|
||||||
|
#
|
||||||
|
# cbar_SSC_sand = self.figure_SSC_2Dplot.colorbar(pcm_SSC_sand, ax=self.axis_SSC_2Dplot[1], shrink=1, location='right')
|
||||||
|
# cbar_SSC_sand.set_label(label='Sand SSC (g/L', rotation=270, labelpad=15)
|
||||||
|
#
|
||||||
|
# # if __name__ == "__main__":
|
||||||
|
# # app = QApplication(sys.argv)
|
||||||
|
# # print("class acoustic inversion tab :", AcousticInversionTab())
|
||||||
|
# # sys.exit(app.exec_())
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,185 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Form implementation generated from reading ui file 'mainwindow.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt5 UI code generator 5.15.6
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
MainWindow.setObjectName("MainWindow")
|
||||||
|
MainWindow.resize(898, 498)
|
||||||
|
MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.French, QtCore.QLocale.France))
|
||||||
|
MainWindow.setDocumentMode(False)
|
||||||
|
MainWindow.setDockNestingEnabled(False)
|
||||||
|
MainWindow.setUnifiedTitleAndToolBarOnMac(False)
|
||||||
|
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName("centralwidget")
|
||||||
|
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||||
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
|
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
|
||||||
|
self.tabWidget.setAutoFillBackground(False)
|
||||||
|
self.tabWidget.setLocale(QtCore.QLocale(QtCore.QLocale.French, QtCore.QLocale.France))
|
||||||
|
self.tabWidget.setDocumentMode(True)
|
||||||
|
self.tabWidget.setTabsClosable(False)
|
||||||
|
self.tabWidget.setTabBarAutoHide(False)
|
||||||
|
self.tabWidget.setObjectName("tabWidget")
|
||||||
|
self.tab1 = QtWidgets.QWidget()
|
||||||
|
self.tab1.setObjectName("tab1")
|
||||||
|
self.tabWidget.addTab(self.tab1, "")
|
||||||
|
self.tab2 = QtWidgets.QWidget()
|
||||||
|
self.tab2.setObjectName("tab2")
|
||||||
|
self.tabWidget.addTab(self.tab2, "")
|
||||||
|
self.tab3 = QtWidgets.QWidget()
|
||||||
|
self.tab3.setObjectName("tab3")
|
||||||
|
self.tabWidget.addTab(self.tab3, "")
|
||||||
|
self.tab4 = QtWidgets.QWidget()
|
||||||
|
self.tab4.setObjectName("tab4")
|
||||||
|
self.tabWidget.addTab(self.tab4, "")
|
||||||
|
self.tab5 = QtWidgets.QWidget()
|
||||||
|
self.tab5.setObjectName("tab5")
|
||||||
|
self.tabWidget.addTab(self.tab5, "")
|
||||||
|
self.tab6 = QtWidgets.QWidget()
|
||||||
|
self.tab6.setObjectName("tab6")
|
||||||
|
self.tabWidget.addTab(self.tab6, "")
|
||||||
|
self.verticalLayout.addWidget(self.tabWidget)
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||||
|
self.menubar.setGeometry(QtCore.QRect(0, 0, 898, 22))
|
||||||
|
self.menubar.setObjectName("menubar")
|
||||||
|
self.menuFile = QtWidgets.QMenu(self.menubar)
|
||||||
|
self.menuFile.setLocale(QtCore.QLocale(QtCore.QLocale.French, QtCore.QLocale.France))
|
||||||
|
self.menuFile.setObjectName("menuFile")
|
||||||
|
self.menuSettings = QtWidgets.QMenu(self.menuFile)
|
||||||
|
self.menuSettings.setObjectName("menuSettings")
|
||||||
|
self.menuLanguage = QtWidgets.QMenu(self.menuSettings)
|
||||||
|
self.menuLanguage.setObjectName("menuLanguage")
|
||||||
|
self.menuTools = QtWidgets.QMenu(self.menubar)
|
||||||
|
self.menuTools.setLocale(QtCore.QLocale(QtCore.QLocale.French, QtCore.QLocale.France))
|
||||||
|
self.menuTools.setObjectName("menuTools")
|
||||||
|
MainWindow.setMenuBar(self.menubar)
|
||||||
|
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName("statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
self.toolBar = QtWidgets.QToolBar(MainWindow)
|
||||||
|
self.toolBar.setObjectName("toolBar")
|
||||||
|
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
||||||
|
self.actionNew = QtWidgets.QAction(MainWindow)
|
||||||
|
|
||||||
|
# Rajouter par moi
|
||||||
|
path = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
|
||||||
|
"graphical_interface_for_SSC_acoustic_meas/icons/"
|
||||||
|
# Re verifier tout les icones QPixmap
|
||||||
|
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
# icon.addPixmap(QtGui.QPixmap("../icons/new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon.addPixmap(QtGui.QPixmap(path + "new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionNew.setIcon(icon)
|
||||||
|
self.actionNew.setObjectName("actionNew")
|
||||||
|
self.actionOpen = QtWidgets.QAction(MainWindow)
|
||||||
|
icon1 = QtGui.QIcon()
|
||||||
|
# icon1.addPixmap(QtGui.QPixmap("../icons/icon_folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon1.addPixmap(QtGui.QPixmap(path + "icon_folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionOpen.setIcon(icon1)
|
||||||
|
self.actionOpen.setObjectName("actionOpen")
|
||||||
|
self.actionSave = QtWidgets.QAction(MainWindow)
|
||||||
|
icon2 = QtGui.QIcon()
|
||||||
|
# icon2.addPixmap(QtGui.QPixmap("../icons/save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon2.addPixmap(QtGui.QPixmap(path + "save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionSave.setIcon(icon2)
|
||||||
|
self.actionSave.setObjectName("actionSave")
|
||||||
|
self.actionCopy = QtWidgets.QAction(MainWindow)
|
||||||
|
icon3 = QtGui.QIcon()
|
||||||
|
# icon3.addPixmap(QtGui.QPixmap("../icons/copy.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon3.addPixmap(QtGui.QPixmap(path + "copy.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionCopy.setIcon(icon3)
|
||||||
|
self.actionCopy.setObjectName("actionCopy")
|
||||||
|
self.actionCut = QtWidgets.QAction(MainWindow)
|
||||||
|
icon4 = QtGui.QIcon()
|
||||||
|
# icon4.addPixmap(QtGui.QPixmap("../icons/cut.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon4.addPixmap(QtGui.QPixmap(path + "cut.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionCut.setIcon(icon4)
|
||||||
|
self.actionCut.setObjectName("actionCut")
|
||||||
|
self.actionPaste = QtWidgets.QAction(MainWindow)
|
||||||
|
icon5 = QtGui.QIcon()
|
||||||
|
# icon5.addPixmap(QtGui.QPixmap("../icons/paste.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon5.addPixmap(QtGui.QPixmap(path + "paste.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionPaste.setIcon(icon5)
|
||||||
|
self.actionPaste.setObjectName("actionPaste")
|
||||||
|
self.actionEnglish = QtWidgets.QAction(MainWindow)
|
||||||
|
icon6 = QtGui.QIcon()
|
||||||
|
# icon6.addPixmap(QtGui.QPixmap("../icons/en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon6.addPixmap(QtGui.QPixmap(path + "en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionEnglish.setIcon(icon6)
|
||||||
|
self.actionEnglish.setObjectName("actionEnglish")
|
||||||
|
self.actionFrench = QtWidgets.QAction(MainWindow)
|
||||||
|
icon7 = QtGui.QIcon()
|
||||||
|
# icon7.addPixmap(QtGui.QPixmap("../icons/fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
icon7.addPixmap(QtGui.QPixmap(path + "fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.actionFrench.setIcon(icon7)
|
||||||
|
self.actionFrench.setObjectName("actionFrench")
|
||||||
|
self.menuLanguage.addAction(self.actionEnglish)
|
||||||
|
self.menuLanguage.addAction(self.actionFrench)
|
||||||
|
self.menuSettings.addAction(self.menuLanguage.menuAction())
|
||||||
|
self.menuFile.addAction(self.actionNew)
|
||||||
|
self.menuFile.addAction(self.actionOpen)
|
||||||
|
self.menuFile.addAction(self.actionSave)
|
||||||
|
self.menuFile.addAction(self.menuSettings.menuAction())
|
||||||
|
self.menuTools.addAction(self.actionCopy)
|
||||||
|
self.menuTools.addAction(self.actionCut)
|
||||||
|
self.menuTools.addAction(self.actionPaste)
|
||||||
|
self.menubar.addAction(self.menuFile.menuAction())
|
||||||
|
self.menubar.addAction(self.menuTools.menuAction())
|
||||||
|
self.toolBar.addAction(self.actionNew)
|
||||||
|
self.toolBar.addAction(self.actionOpen)
|
||||||
|
self.toolBar.addAction(self.actionSave)
|
||||||
|
self.toolBar.addSeparator()
|
||||||
|
self.toolBar.addAction(self.actionCopy)
|
||||||
|
self.toolBar.addAction(self.actionCut)
|
||||||
|
self.toolBar.addAction(self.actionPaste)
|
||||||
|
self.toolBar.addSeparator()
|
||||||
|
self.toolBar.addAction(self.actionEnglish)
|
||||||
|
self.toolBar.addAction(self.actionFrench)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
self.tabWidget.setCurrentIndex(0)
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab1), _translate("MainWindow", "Acoustic data"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab2), _translate("MainWindow", "Signal processing"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab3), _translate("MainWindow", "Sample data"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab4), _translate("MainWindow", "Acoustic inversion"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab5), _translate("MainWindow", "Note"))
|
||||||
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab6), _translate("MainWindow", "User manual"))
|
||||||
|
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
||||||
|
self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
|
||||||
|
self.menuLanguage.setTitle(_translate("MainWindow", "Language"))
|
||||||
|
self.menuTools.setTitle(_translate("MainWindow", "Tools"))
|
||||||
|
self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar"))
|
||||||
|
self.actionNew.setText(_translate("MainWindow", "New"))
|
||||||
|
self.actionOpen.setText(_translate("MainWindow", "Open"))
|
||||||
|
self.actionSave.setText(_translate("MainWindow", "Save"))
|
||||||
|
self.actionCopy.setText(_translate("MainWindow", "Copy"))
|
||||||
|
self.actionCut.setText(_translate("MainWindow", "Cut"))
|
||||||
|
self.actionPaste.setText(_translate("MainWindow", "Paste"))
|
||||||
|
self.actionEnglish.setText(_translate("MainWindow", "English"))
|
||||||
|
self.actionFrench.setText(_translate("MainWindow", "French"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
MainWindow = QtWidgets.QMainWindow()
|
||||||
|
ui = Ui_MainWindow()
|
||||||
|
ui.setupUi(MainWindow)
|
||||||
|
MainWindow.show()
|
||||||
|
sys.exit(app.exec_())
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QTextEdit, QPushButton, QSpacerItem, \
|
||||||
|
QSpinBox, QSizePolicy, QFontComboBox, QColorDialog
|
||||||
|
from PyQt5.QtGui import QPixmap, QIcon, QFont
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
|
|
||||||
|
class NoteTab(QWidget):
|
||||||
|
|
||||||
|
''' This class generates a enhanced notepad in Note Tab '''
|
||||||
|
|
||||||
|
def __init__(self, widget_tab):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
path_icon = "./icons/"
|
||||||
|
|
||||||
|
self.verticalLayout_main_note_tab = QVBoxLayout(widget_tab)
|
||||||
|
|
||||||
|
self.horizontalLayout_toolbar = QHBoxLayout()
|
||||||
|
self.verticalLayout_main_note_tab.addLayout(self.horizontalLayout_toolbar)
|
||||||
|
|
||||||
|
self.textEdit = QTextEdit()
|
||||||
|
|
||||||
|
self.filename_text = ""
|
||||||
|
|
||||||
|
self.pushbutton_new_txt = QPushButton()
|
||||||
|
self.icon_new_txt = QPixmap(path_icon + "new_txt.png")
|
||||||
|
self.pushbutton_new_txt.setIcon(QIcon(self.icon_new_txt))
|
||||||
|
# self.pushbutton_new_txt.clicked.connect(self.new_text)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.pushbutton_new_txt)
|
||||||
|
|
||||||
|
self.pushbutton_save_txt = QPushButton()
|
||||||
|
self.icon_save_txt = QPixmap(path_icon + "save_txt.png")
|
||||||
|
self.pushbutton_save_txt.setIcon(QIcon(self.icon_save_txt))
|
||||||
|
# self.pushbutton_save_txt.clicked.connect(self.save_text)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.pushbutton_save_txt)
|
||||||
|
|
||||||
|
self.pushbutton_open_txt = QPushButton()
|
||||||
|
self.icon_open_txt = QPixmap(path_icon + "open_txt.png")
|
||||||
|
self.pushbutton_open_txt.setIcon(QIcon(self.icon_open_txt))
|
||||||
|
# self.pushbutton_open_txt.clicked.connect(self.open_text)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.pushbutton_open_txt)
|
||||||
|
|
||||||
|
self.fontbox = QFontComboBox()
|
||||||
|
self.fontbox.currentFontChanged.connect(lambda font : self.textEdit.setCurrentFont(font))
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.fontbox)
|
||||||
|
|
||||||
|
self.fontSize = QSpinBox()
|
||||||
|
self.fontSize.setSuffix("pt")
|
||||||
|
self.fontSize.valueChanged.connect(lambda size: self.textEdit.setFontPointSize(size))
|
||||||
|
self.fontSize.setValue(14)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.fontSize)
|
||||||
|
|
||||||
|
self.fontColor = QPushButton()
|
||||||
|
self.icon_fontColor = QPixmap(path_icon + "font_color.png")
|
||||||
|
self.fontColor.setIcon(QIcon(self.icon_fontColor))
|
||||||
|
# self.QAction(QIcon("couleur_police.png"), "Changer la couleur du texte", self)couleur_fond.png
|
||||||
|
self.fontColor.clicked.connect(self.fontColorChanged)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.fontColor)
|
||||||
|
|
||||||
|
self.backColor = QPushButton()
|
||||||
|
self.icon_backColor = QPixmap(path_icon + "background_color.png")
|
||||||
|
self.backColor.setIcon(QIcon(self.icon_backColor))
|
||||||
|
self.backColor.clicked.connect(self.highlight)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.backColor)
|
||||||
|
|
||||||
|
self.boldAction = QPushButton()
|
||||||
|
self.icon_boldAction = QPixmap(path_icon + "bold.png")
|
||||||
|
self.boldAction.setIcon(QIcon(self.icon_boldAction))
|
||||||
|
self.boldAction.clicked.connect(self.bold)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.boldAction)
|
||||||
|
|
||||||
|
self.italicAction = QPushButton()
|
||||||
|
self.icon_italicAction = QPixmap(path_icon + "italic.png")
|
||||||
|
self.italicAction.setIcon(QIcon(self.icon_italicAction))
|
||||||
|
self.italicAction.clicked.connect(self.italic)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.italicAction)
|
||||||
|
|
||||||
|
self.underlineAction = QPushButton()
|
||||||
|
self.icon_underlineAction = QPixmap(path_icon + "underline.png")
|
||||||
|
self.underlineAction.setIcon(QIcon(self.icon_underlineAction))
|
||||||
|
self.underlineAction.clicked.connect(self.underline)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.underlineAction)
|
||||||
|
|
||||||
|
self.strikeAction = QPushButton()
|
||||||
|
self.icon_strikeAction = QPixmap(path_icon + "strike.png")
|
||||||
|
self.strikeAction.setIcon(QIcon(self.icon_strikeAction))
|
||||||
|
self.strikeAction.clicked.connect(self.strike)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.strikeAction)
|
||||||
|
|
||||||
|
self.alignLeftAction = QPushButton()
|
||||||
|
self.icon_alignLeftAction = QPixmap(path_icon + "left.png")
|
||||||
|
self.alignLeftAction.setIcon(QIcon(self.icon_alignLeftAction))
|
||||||
|
self.alignLeftAction.clicked.connect(self.alignLeft)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.alignLeftAction)
|
||||||
|
|
||||||
|
self.alignCenterAction = QPushButton()
|
||||||
|
self.icon_alignCenterAction = QPixmap(path_icon + "centre.png")
|
||||||
|
self.alignCenterAction.setIcon(QIcon(self.icon_alignCenterAction))
|
||||||
|
self.alignCenterAction.clicked.connect(self.alignCenter)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.alignCenterAction)
|
||||||
|
|
||||||
|
self.alignRightAction = QPushButton()
|
||||||
|
self.icon_alignRightAction = QPixmap(path_icon + "right.png")
|
||||||
|
self.alignRightAction.setIcon(QIcon(self.icon_alignRightAction))
|
||||||
|
self.alignRightAction.clicked.connect(self.alignRight)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.alignRightAction)
|
||||||
|
|
||||||
|
self.alignJustifyAction = QPushButton()
|
||||||
|
self.icon_alignJustifyAction = QPixmap(path_icon + "justify.png")
|
||||||
|
self.alignJustifyAction.setIcon(QIcon(self.icon_alignJustifyAction))
|
||||||
|
self.alignJustifyAction.clicked.connect(self.alignJustify)
|
||||||
|
self.horizontalLayout_toolbar.addWidget(self.alignJustifyAction)
|
||||||
|
|
||||||
|
self.horizontalSpacerItem_toolbar_note_tab = QSpacerItem(500, 10, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||||
|
self.horizontalLayout_toolbar.addItem(self.horizontalSpacerItem_toolbar_note_tab)
|
||||||
|
|
||||||
|
self.verticalLayout_main_note_tab.addWidget(self.textEdit)
|
||||||
|
|
||||||
|
## -------------------------------
|
||||||
|
## ---------- Functions ----------
|
||||||
|
## -------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
# def new_text(self):
|
||||||
|
# window = self.ui_mainwindow.tab5
|
||||||
|
# window.show()
|
||||||
|
|
||||||
|
# def open_text(self):
|
||||||
|
# self.filename_text = QFileDialog.getOpenFileName(self, 'Open File', ".", "(*.txt")
|
||||||
|
# if self.filename_text:
|
||||||
|
# with open(self.filename_text, 'txt') as file:
|
||||||
|
# self.text.setText(file.read())
|
||||||
|
|
||||||
|
# def save_text(self):
|
||||||
|
# if not self.filename_text:
|
||||||
|
# self.filename_text = QFileDialog.getSaveFileName(self, 'Save File')
|
||||||
|
#
|
||||||
|
# if not self.filename_text.endswith(".txt"):
|
||||||
|
# self.filename_text += ".txt"
|
||||||
|
#
|
||||||
|
# with open(self.filename_text, "txt") as file:
|
||||||
|
# file.write(self.text.toHtml())
|
||||||
|
|
||||||
|
def fontColorChanged(self):
|
||||||
|
color = QColorDialog.getColor()
|
||||||
|
self.textEdit.setTextColor(color)
|
||||||
|
|
||||||
|
def highlight(self):
|
||||||
|
color = QColorDialog.getColor()
|
||||||
|
self.textEdit.setTextBackgroundColor(color)
|
||||||
|
|
||||||
|
def bold(self):
|
||||||
|
if self.textEdit.fontWeight() == QFont.Bold:
|
||||||
|
self.textEdit.setFontWeight(QFont.Normal)
|
||||||
|
else:
|
||||||
|
self.textEdit.setFontWeight(QFont.Bold)
|
||||||
|
|
||||||
|
def italic(self):
|
||||||
|
state = self.textEdit.fontItalic()
|
||||||
|
self.textEdit.setFontItalic(not state)
|
||||||
|
|
||||||
|
def underline(self):
|
||||||
|
state = self.textEdit.fontUnderline()
|
||||||
|
self.textEdit.setFontUnderline(not state)
|
||||||
|
|
||||||
|
def strike(self):
|
||||||
|
fmt = self.textEdit.currentCharFormat()
|
||||||
|
fmt.setFontStrikeOut(not fmt.fontStrikeOut())
|
||||||
|
self.textEdit.setCurrentCharFormat(fmt)
|
||||||
|
|
||||||
|
def alignLeft(self):
|
||||||
|
self.textEdit.setAlignment(Qt.AlignLeft)
|
||||||
|
|
||||||
|
def alignRight(self):
|
||||||
|
self.textEdit.setAlignment(Qt.AlignRight)
|
||||||
|
|
||||||
|
def alignCenter(self):
|
||||||
|
self.textEdit.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
|
def alignJustify(self):
|
||||||
|
self.textEdit.setAlignment(Qt.AlignJustify)
|
||||||
|
|
||||||
|
|
||||||
|
# if __name__ == "__main__":
|
||||||
|
# app = QApplication(sys.argv)
|
||||||
|
# window = NoteTab()
|
||||||
|
# window.show()
|
||||||
|
# sys.exit(app.exec_())
|
||||||
|
|
@ -0,0 +1,842 @@
|
||||||
|
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QGroupBox, QLabel, QSpinBox, QSpacerItem, QSizePolicy, \
|
||||||
|
QTabWidget, QTableWidget, QPushButton, QLineEdit, QTableView, QCheckBox, \
|
||||||
|
QAbstractScrollArea, QTableWidgetItem, QComboBox, QFileDialog, QGridLayout, QMessageBox, \
|
||||||
|
QRadioButton
|
||||||
|
from PyQt5.QtGui import QIcon, QPixmap
|
||||||
|
from PyQt5.QtCore import Qt, QCoreApplication, pyqtSignal, pyqtSlot
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from matplotlib.colors import CSS4_COLORS, LogNorm
|
||||||
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
|
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
|
from os import path
|
||||||
|
|
||||||
|
from Model.granulo_loader import GranuloLoader
|
||||||
|
|
||||||
|
from View.checkable_combobox import CheckableComboBox
|
||||||
|
|
||||||
|
import Translation.constant_string as cs
|
||||||
|
|
||||||
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
|
||||||
|
class SampleDataTab(QWidget):
|
||||||
|
|
||||||
|
# clicked_signal = pyqtSignal(str)
|
||||||
|
|
||||||
|
def __init__(self, widget_tab):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
### --- General layout of widgets ---
|
||||||
|
|
||||||
|
self.verticalLayout_sampleDataTab = QVBoxLayout(widget_tab)
|
||||||
|
|
||||||
|
self.horizontalLayoutTop_sampleDataTab = QHBoxLayout()
|
||||||
|
self.verticalLayout_sampleDataTab.addLayout(self.horizontalLayoutTop_sampleDataTab, 5)
|
||||||
|
|
||||||
|
self.horizontalLayoutBottom_sampleDataTab = QHBoxLayout()
|
||||||
|
self.verticalLayout_sampleDataTab.addLayout(self.horizontalLayoutBottom_sampleDataTab, 5)
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------------------
|
||||||
|
### --- Layout of groupbox in the Top horizontal layout box
|
||||||
|
|
||||||
|
# Download | Table of values | Sample position
|
||||||
|
# Display options
|
||||||
|
|
||||||
|
self.groupbox_download = QGroupBox()
|
||||||
|
self.horizontalLayoutTop_sampleDataTab.addWidget(self.groupbox_download, 3)
|
||||||
|
|
||||||
|
self.groupbox_table = QGroupBox()
|
||||||
|
self.horizontalLayoutTop_sampleDataTab.addWidget(self.groupbox_table, 4)
|
||||||
|
|
||||||
|
self.verticalLayout_sampleposition_displayoption = QVBoxLayout()
|
||||||
|
self.horizontalLayoutTop_sampleDataTab.addLayout(self.verticalLayout_sampleposition_displayoption, 3)
|
||||||
|
|
||||||
|
path_icon = "./icons/"
|
||||||
|
icon_folder = QIcon(path_icon + "folder.png")
|
||||||
|
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
# +++ --- GroupBox Download Sample --- +++
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_download = QVBoxLayout(self.groupbox_download)
|
||||||
|
|
||||||
|
self.tab_download_experimental_numerical_data = QTabWidget()
|
||||||
|
|
||||||
|
self.tab_download_experimental_data = QWidget()
|
||||||
|
self.tab_download_experimental_numerical_data.addTab(self.tab_download_experimental_data, "Experimental data")
|
||||||
|
|
||||||
|
self.verticalLayout_experimentalTab_groupbox_download = QVBoxLayout()
|
||||||
|
self.tab_download_experimental_data.setLayout(self.verticalLayout_experimentalTab_groupbox_download)
|
||||||
|
|
||||||
|
self.groupbox_particle_size_file = QGroupBox()
|
||||||
|
self.verticalLayout_groupbox_particle_size_file = QVBoxLayout(self.groupbox_particle_size_file)
|
||||||
|
|
||||||
|
self.groupbox_fine_sediment = QGroupBox()
|
||||||
|
self.horizontalLayout_fine_sediment = QHBoxLayout(self.groupbox_fine_sediment)
|
||||||
|
self.pushbutton_fine_sediment = QPushButton()
|
||||||
|
self.pushbutton_fine_sediment.setIcon(icon_folder)
|
||||||
|
self.horizontalLayout_fine_sediment.addWidget(self.pushbutton_fine_sediment)
|
||||||
|
self.lineEdit_fine_sediment = QLineEdit()
|
||||||
|
self.horizontalLayout_fine_sediment.addWidget(self.lineEdit_fine_sediment)
|
||||||
|
self.verticalLayout_groupbox_particle_size_file.addWidget(self.groupbox_fine_sediment)
|
||||||
|
|
||||||
|
self.pushbutton_fine_sediment.clicked.connect(self.open_dialog_box_fine_sediment)
|
||||||
|
|
||||||
|
self.groupbox_sand = QGroupBox()
|
||||||
|
self.horizontalLayout_sand = QHBoxLayout(self.groupbox_sand)
|
||||||
|
self.pushbutton_sand = QPushButton()
|
||||||
|
self.pushbutton_sand.setIcon(icon_folder)
|
||||||
|
self.horizontalLayout_sand.addWidget(self.pushbutton_sand)
|
||||||
|
self.lineEdit_sand = QLineEdit()
|
||||||
|
self.horizontalLayout_sand.addWidget(self.lineEdit_sand)
|
||||||
|
self.verticalLayout_groupbox_particle_size_file.addWidget(self.groupbox_sand)
|
||||||
|
|
||||||
|
self.pushbutton_sand.clicked.connect(self.open_dialog_box_sand_sediment)
|
||||||
|
|
||||||
|
self.verticalLayout_experimentalTab_groupbox_download.addWidget(self.groupbox_particle_size_file)
|
||||||
|
|
||||||
|
# self.groupbox_total_concentration = QGroupBox()
|
||||||
|
# self.horizontalLayout_groupbox_total_concentration = QHBoxLayout(self.groupbox_total_concentration)
|
||||||
|
# self.pushbutton_total_concentration = QPushButton()
|
||||||
|
# self.pushbutton_total_concentration.setIcon(icon_folder)
|
||||||
|
# self.horizontalLayout_groupbox_total_concentration.addWidget(self.pushbutton_total_concentration)
|
||||||
|
# self.lineEdit_total_concentration = QLineEdit()
|
||||||
|
# self.horizontalLayout_groupbox_total_concentration.addWidget(self.lineEdit_total_concentration)
|
||||||
|
#
|
||||||
|
# self.pushbutton_total_concentration.clicked.connect(self.open_dialog_box_total_concentration)
|
||||||
|
#
|
||||||
|
# self.verticalLayout_groupbox_download.addWidget(self.groupbox_total_concentration)
|
||||||
|
|
||||||
|
# self.verticalLayout_experimentalTab_groupbox_download.addWidget(self.groupbox_total_concentration)
|
||||||
|
|
||||||
|
self.tab_compute_numerical_data = QWidget()
|
||||||
|
self.tab_download_experimental_numerical_data.addTab(self.tab_compute_numerical_data, "Numerical data")
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_download.addWidget(self.tab_download_experimental_numerical_data)
|
||||||
|
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
# +++ --- GroupBox Table of values --- +++
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_table = QVBoxLayout(self.groupbox_table)
|
||||||
|
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable = QHBoxLayout()
|
||||||
|
|
||||||
|
self.pushbutton_fill_table = QPushButton()
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable.addWidget(self.pushbutton_fill_table)
|
||||||
|
|
||||||
|
self.horizontalSpacerItem_pushButton_fill_table = QSpacerItem(20, 10, QSizePolicy.Expanding,
|
||||||
|
QSizePolicy.Minimum)
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable.addItem(self.horizontalSpacerItem_pushButton_fill_table)
|
||||||
|
|
||||||
|
self.allChkBox = QCheckBox()
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable.addWidget(self.allChkBox)
|
||||||
|
|
||||||
|
self.horizontalSpacerItem_pushButton_export_table = QSpacerItem(240, 10, QSizePolicy.Expanding,
|
||||||
|
QSizePolicy.Minimum)
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable.addItem(self.horizontalSpacerItem_pushButton_export_table)
|
||||||
|
|
||||||
|
self.pushButton_export_table = QPushButton()
|
||||||
|
self.horizontalLayout_checkAll_spacer_exportTable.addWidget(self.pushButton_export_table)
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_table.addLayout(self.horizontalLayout_checkAll_spacer_exportTable)
|
||||||
|
|
||||||
|
self.tableWidget_sample = QTableWidget()
|
||||||
|
|
||||||
|
self.row = self.tableWidget_sample.setRowCount(10)
|
||||||
|
self.column = self.tableWidget_sample.setColumnCount(10)
|
||||||
|
|
||||||
|
self.pushbutton_fill_table.clicked.connect(self.fill_table)
|
||||||
|
self.pushButton_export_table.clicked.connect(self.export_table)
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_table.addWidget(self.tableWidget_sample)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
# +++ --- GroupBox plot sample position --- +++
|
||||||
|
# +++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
self.groupbox_plot_sample_position = QGroupBox()
|
||||||
|
self.verticalLayout_groupbox_plot_sample_position = QVBoxLayout(self.groupbox_plot_sample_position)
|
||||||
|
|
||||||
|
self.canvas_transect_sample_position = None
|
||||||
|
|
||||||
|
# if self.canvas_transect_sample_position
|
||||||
|
|
||||||
|
# self.figure_sample_position, self.axis_sample_position = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||||
|
# self.canvas_sample_position = FigureCanvas(self.figure_sample_position)
|
||||||
|
# # self.toolbar_sampleposition = NavigationToolBar(self.canvas_sampleposition, self)
|
||||||
|
# self.empty_field_for_transect_plot()
|
||||||
|
# self.verticalLayout_groupbox_plot_sample_position.addWidget(self.canvas_sample_position)
|
||||||
|
|
||||||
|
self.verticalLayout_sampleposition_displayoption.addWidget(self.groupbox_plot_sample_position, 5)
|
||||||
|
|
||||||
|
# +++++++++++++++++++++++++++++++++++++++
|
||||||
|
# +++ --- GroupBox display option --- +++
|
||||||
|
# +++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
self.groupbox_display_option = QGroupBox()
|
||||||
|
self.verticalLayout_groupbox_display_option = QVBoxLayout(self.groupbox_display_option)
|
||||||
|
|
||||||
|
# self.pushbutton_plot_transect = QPushButton()
|
||||||
|
# self.pushbutton_plot_transect.setText("Plot transect to visualise sample position")
|
||||||
|
# self.verticalLayout_groupbox_display_option.addWidget(self.pushbutton_plot_transect)
|
||||||
|
|
||||||
|
self.horizontalLayout_Ctot_PSD_plot = QHBoxLayout()
|
||||||
|
self.verticalLayout_groupbox_display_option.addLayout(self.horizontalLayout_Ctot_PSD_plot)
|
||||||
|
|
||||||
|
self.groupbox_option_total_concentration_plot = QGroupBox()
|
||||||
|
self.groupbox_option_total_concentration_plot.setTitle("Total concentration plot")
|
||||||
|
self.horizontalLayout_Ctot_PSD_plot.addWidget(self.groupbox_option_total_concentration_plot)
|
||||||
|
|
||||||
|
self.gridLayout_groupbox_option_total_concentration_plot = QGridLayout(self.groupbox_option_total_concentration_plot)
|
||||||
|
self.label_x_axis = QLabel()
|
||||||
|
self.label_x_axis.setText("x axis")
|
||||||
|
self.gridLayout_groupbox_option_total_concentration_plot.addWidget(self.label_x_axis, 0, 0)
|
||||||
|
|
||||||
|
self.combobox_x_axis = QComboBox()
|
||||||
|
self.combobox_x_axis.addItems(['Concentration (g/L)', '% fine', '% sand', '% fine, % sand'])
|
||||||
|
self.gridLayout_groupbox_option_total_concentration_plot.addWidget(self.combobox_x_axis, 0, 1)
|
||||||
|
|
||||||
|
self.combobox_x_axis.currentTextChanged.connect(self.empty_field_for_total_concentration_plot)
|
||||||
|
|
||||||
|
self.label_y_axis = QLabel()
|
||||||
|
self.label_y_axis.setText("y axis")
|
||||||
|
self.gridLayout_groupbox_option_total_concentration_plot.addWidget(self.label_y_axis, 1, 0)
|
||||||
|
|
||||||
|
self.combobox_y_axis = QComboBox()
|
||||||
|
self.combobox_y_axis.addItems(['z (m)', 'z / h'])
|
||||||
|
self.gridLayout_groupbox_option_total_concentration_plot.addWidget(self.combobox_y_axis, 1, 1)
|
||||||
|
|
||||||
|
self.combobox_y_axis.currentTextChanged.connect(self.empty_field_for_total_concentration_plot)
|
||||||
|
self.combobox_y_axis.currentTextChanged.connect(self.update_plot_total_concentration)
|
||||||
|
|
||||||
|
self.groupbox_option_PSD_plot = QGroupBox()
|
||||||
|
self.groupbox_option_PSD_plot.setTitle("Particle Size Distribution plot")
|
||||||
|
self.horizontalLayout_Ctot_PSD_plot.addWidget(self.groupbox_option_PSD_plot)
|
||||||
|
|
||||||
|
self.horizontalLayout_groupbox_option_PSD_plot = QHBoxLayout(self.groupbox_option_PSD_plot)
|
||||||
|
self.pushbutton_class_PSD = QPushButton()
|
||||||
|
self.pushbutton_class_PSD.setText("Class PSD")
|
||||||
|
self.horizontalLayout_groupbox_option_PSD_plot.addWidget(self.pushbutton_class_PSD)
|
||||||
|
|
||||||
|
# self.pushbutton_class_PSD.clicked_signal[str].connect(self.on_clicked)
|
||||||
|
|
||||||
|
# if self.tableWidget_sample.columnCount() == 10:
|
||||||
|
# self.pushbutton_class_PSD.clicked.connect(self.empty_field_to_plot_fine_sediment_distribution)
|
||||||
|
# else:
|
||||||
|
# self.pushbutton_class_PSD.clicked.connect(self.update_plot_fine_sediment_PSD_class_cumul)
|
||||||
|
|
||||||
|
self.pushbutton_cumulative_PSD = QPushButton()
|
||||||
|
self.pushbutton_cumulative_PSD.setText("Cumulative PSD")
|
||||||
|
self.horizontalLayout_groupbox_option_PSD_plot.addWidget(self.pushbutton_cumulative_PSD)
|
||||||
|
|
||||||
|
# if self.tableWidget_sample.columnCount() == 10:
|
||||||
|
# self.pushbutton_cumulative_PSD.clicked.connect(self.empty_field_to_plot_fine_sediment_distribution)
|
||||||
|
# else:
|
||||||
|
# self.pushbutton_cumulative_PSD.clicked.connect(self.update_plot_fine_sediment_PSD_class_cumul)
|
||||||
|
|
||||||
|
# self.pushbutton_plot_PSD_distribution.setText("Class distribution")
|
||||||
|
|
||||||
|
# self.horizontalLayout_calibration_sample_vertical_profile = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_displayoption_sampletab.addLayout(
|
||||||
|
# self.horizontalLayout_calibration_sample_vertical_profile)
|
||||||
|
#
|
||||||
|
# self.label_calibration_sample_vertical_profile = QLabel()
|
||||||
|
# # self.label_calibration_sample_vertical_profile.setText("Calibration sample vertical profile :")
|
||||||
|
# self.horizontalLayout_calibration_sample_vertical_profile.addWidget(
|
||||||
|
# self.label_calibration_sample_vertical_profile)
|
||||||
|
#
|
||||||
|
# self.combobox_calibration_sample_vertical_profile = CheckableComboBox()
|
||||||
|
# self.combobox_calibration_sample_vertical_profile.addItems(["S1, S2, S3", "S4, S5, S6, S7", "S8, S9, S10, S11"])
|
||||||
|
# self.horizontalLayout_calibration_sample_vertical_profile.addWidget(
|
||||||
|
# self.combobox_calibration_sample_vertical_profile)
|
||||||
|
#
|
||||||
|
self.verticalLayout_sampleposition_displayoption.addWidget(self.groupbox_display_option, 5)
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------------------------------
|
||||||
|
### --- Layout of groupbox in the Bottom horizontal layout box
|
||||||
|
|
||||||
|
# Plot Ctot | Plot PSD fine + sand
|
||||||
|
|
||||||
|
self.groupbox_plot_total_concentration = QGroupBox()
|
||||||
|
self.verticalLayout_plot_total_concentration = QVBoxLayout(self.groupbox_plot_total_concentration)
|
||||||
|
self.figure_total_concentration, self.axis_total_concentration \
|
||||||
|
= plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||||
|
self.canvas_total_concentration = FigureCanvas(self.figure_total_concentration)
|
||||||
|
# self.plotToolbar_sample_total_concentration = NavigationToolBar(self.canvas_sample_total_concentration, self)
|
||||||
|
self.empty_field_for_total_concentration_plot()
|
||||||
|
self.verticalLayout_plot_total_concentration.addWidget(self.canvas_total_concentration)
|
||||||
|
|
||||||
|
self.horizontalLayoutBottom_sampleDataTab.addWidget(self.groupbox_plot_total_concentration, 3)
|
||||||
|
|
||||||
|
self.groupbox_plot_PSD = QGroupBox()
|
||||||
|
self.verticalLayout_plot_PSD = QVBoxLayout(self.groupbox_plot_PSD)
|
||||||
|
self.figure_plot_PSD, self.axis_plot_PSD = plt.subplots(nrows=1, ncols=2, layout="constrained")
|
||||||
|
self.canvas_plot_PSD = FigureCanvas(self.figure_plot_PSD)
|
||||||
|
# self.plotToolbar_sample_distribution = NavigationToolBar(self.canvas_sample_distribution, self)
|
||||||
|
self.empty_field_for_plot_fine_PSD_class()
|
||||||
|
self.empty_field_for_plot_sand_PSD_class()
|
||||||
|
self.verticalLayout_plot_PSD.addWidget(self.canvas_plot_PSD)
|
||||||
|
|
||||||
|
self.horizontalLayoutBottom_sampleDataTab.addWidget(self.groupbox_plot_PSD, 6)
|
||||||
|
|
||||||
|
self.retranslate_data_sample_tab()
|
||||||
|
|
||||||
|
# -------------------- Functions for Sample Data Tab --------------------
|
||||||
|
|
||||||
|
def retranslate_data_sample_tab(self):
|
||||||
|
|
||||||
|
self.groupbox_download.setTitle(_translate("CONSTANT_STRING", cs.DOWNLOAD))
|
||||||
|
self.groupbox_particle_size_file.setTitle(_translate("CONSTANT_STRING", cs.PARTICLE_SIZE_DISTRIBUTION_FILE))
|
||||||
|
self.groupbox_fine_sediment.setTitle(_translate("CONSTANT_STRING", cs.FINE_SEDIMENTS))
|
||||||
|
self.groupbox_sand.setTitle(_translate("CONSTANT_STRING", cs.SAND_SEDIMENTS))
|
||||||
|
# self.groupbox_total_concentration.setTitle(_translate("CONSTANT_STRING", cs.TOTAL_CONCENTRATION))
|
||||||
|
|
||||||
|
self.groupbox_table.setTitle(_translate("CONSTANT_STRING", cs.TABLE_VALUES))
|
||||||
|
self.pushbutton_fill_table.setText(_translate("CONSTANT_STRING", cs.FILL_TABLE))
|
||||||
|
self.allChkBox.setText(_translate("CONSTANT_STRING", cs.CHECK_ALL))
|
||||||
|
self.pushButton_export_table.setText(_translate("CONSTANT_STRING", cs.EXPORT_TABLE))
|
||||||
|
|
||||||
|
self.groupbox_plot_sample_position.setTitle(_translate("CONSTANT_STRING", cs.PLOT_SAMPLE_POSITION))
|
||||||
|
|
||||||
|
self.groupbox_display_option.setTitle(_translate("CONSTANT_STRING", cs.OPTIONS))
|
||||||
|
# self.pushbutton_plot_cumulative_distribution.setText(_translate("CONSTANT_STRING", cs.CUMULATIVE_DISTRIBUTION))
|
||||||
|
# self.pushbutton_plot_PSD_distribution.setText(_translate("CONSTANT_STRING", cs.CLASS_DISTRIBUTION))
|
||||||
|
# self.label_calibration_sample_vertical_profile.setText(_translate("CONSTANT_STRING", cs.VERTICAL_PROFILE_FOR_CALIBRATION))
|
||||||
|
|
||||||
|
self.groupbox_plot_total_concentration.setTitle(_translate("CONSTANT_STRING", cs.PLOT_TOTAL_CONCENTRATION))
|
||||||
|
|
||||||
|
self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT))
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------------------------
|
||||||
|
# --- Function to select directory and file name of fine sediments sample data ---
|
||||||
|
def open_dialog_box_fine_sediment(self):
|
||||||
|
filename_fine_sediment = QFileDialog.getOpenFileName(self, "Open file",
|
||||||
|
"/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/Data/Granulo_data",
|
||||||
|
"Fine sediment file (*.xls, *.ods)")
|
||||||
|
path_name = path.dirname(filename_fine_sediment[0])
|
||||||
|
file_name = path.basename(filename_fine_sediment[0])
|
||||||
|
self.lineEdit_fine_sediment.setText(file_name)
|
||||||
|
self.lineEdit_fine_sediment.setToolTip(path_name)
|
||||||
|
return filename_fine_sediment[0]
|
||||||
|
|
||||||
|
# --- Function to select directory and file name of sand sediments sample data ---
|
||||||
|
def open_dialog_box_sand_sediment(self):
|
||||||
|
filename_sand_sediment = QFileDialog.getOpenFileName(self, "Open file",
|
||||||
|
"/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/Data/Granulo_data",
|
||||||
|
"Sand sediment file (*.xls, *.ods)")
|
||||||
|
path_name = path.dirname(filename_sand_sediment[0])
|
||||||
|
file_name = path.basename(filename_sand_sediment[0])
|
||||||
|
self.lineEdit_sand.setText(file_name)
|
||||||
|
self.lineEdit_sand.setToolTip(path_name)
|
||||||
|
return filename_sand_sediment[0]
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------------------------
|
||||||
|
# --- Function to fill table of values ---
|
||||||
|
def fill_table(self):
|
||||||
|
if self.lineEdit_fine_sediment.text():
|
||||||
|
# print("push button", self.pushbutton_fill_table.isChecked())
|
||||||
|
# print("self.lineEdit_fine_sediment.text() ", self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text())
|
||||||
|
# print("self.lineEdit_sand.text() ", self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text())
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.row = self.tableWidget_sample.setRowCount(granulo_data._data_fine.shape[0])
|
||||||
|
self.col = self.tableWidget_sample.setColumnCount(2*granulo_data._data_fine.shape[1])
|
||||||
|
|
||||||
|
# --- Set horizontal header ---
|
||||||
|
horizontal_header = list(map(str, ["Color", "Sample"] + granulo_data._data_fine.columns.values.tolist() +
|
||||||
|
granulo_data._data_sand.columns.values.tolist()[2:]))
|
||||||
|
# print(len(horizontal_header))
|
||||||
|
for horizontal_header_text in horizontal_header:
|
||||||
|
# print(horizontal_header_text)
|
||||||
|
self.horizontal_header_item = QTableWidgetItem()
|
||||||
|
# print(np.where(horizontal_header == horizontal_header_text)[0][0])
|
||||||
|
self.tableWidget_sample.setHorizontalHeaderItem(horizontal_header.index(horizontal_header_text),
|
||||||
|
self.horizontal_header_item)
|
||||||
|
self.horizontal_header_item.setText(horizontal_header_text)
|
||||||
|
|
||||||
|
# --- Set vertical header (color) ---
|
||||||
|
self.tableWidget_sample.verticalHeader().setVisible(False)
|
||||||
|
color_list = CSS4_COLORS
|
||||||
|
for i in range(self.tableWidget_sample.rowCount()):
|
||||||
|
exec("self.comboBox_sample_table" + str(i) + "= QComboBox()")
|
||||||
|
exec("self.comboBox_sample_table" + str(i) + ".addItems(color_list)")
|
||||||
|
eval(f"self.tableWidget_sample.setCellWidget(i, 0, self.comboBox_sample_table{i})")
|
||||||
|
eval(f"self.comboBox_sample_table{i}.currentTextChanged.connect(self.update_plots_from_table_checkboxes)")
|
||||||
|
|
||||||
|
# --- Fill Sample column with checkbox ---
|
||||||
|
for i in range(self.tableWidget_sample.rowCount()):
|
||||||
|
self.item_checkbox = QTableWidgetItem()
|
||||||
|
self.item_checkbox.setCheckState(Qt.Unchecked)
|
||||||
|
self.tableWidget_sample.setItem(i, 1, self.item_checkbox)
|
||||||
|
self.item_checkbox.setText("S " + str(i + 1))
|
||||||
|
# print(f"S{i+1} ", self.tableWidget_sample.item(i, 1).checkState())
|
||||||
|
|
||||||
|
# --- Fill table with data ---
|
||||||
|
for i in range(granulo_data._frac_vol_fine.shape[0]):
|
||||||
|
for j in range(granulo_data._frac_vol_fine.shape[1]):
|
||||||
|
# self.tableWidget_sample.setItem(i, j + 2, QTableWidgetItem(str(granulo_data._data_fine.iloc[i, j])))
|
||||||
|
self.tableWidget_sample.setItem(i, 2, QTableWidgetItem(str(granulo_data._y[i])))
|
||||||
|
self.tableWidget_sample.setItem(i, 3, QTableWidgetItem(str(granulo_data._z[i])))
|
||||||
|
|
||||||
|
self.tableWidget_sample.setItem(i, 4, QTableWidgetItem(str(granulo_data._Ctot_fine[i])))
|
||||||
|
self.tableWidget_sample.setItem(i, 5, QTableWidgetItem(str(granulo_data._D50_fine[i])))
|
||||||
|
self.tableWidget_sample.setItem(i, j + 6, QTableWidgetItem(str(granulo_data._frac_vol_fine[i, j])))
|
||||||
|
|
||||||
|
self.tableWidget_sample.setItem(i, granulo_data._frac_vol_fine.shape[1] + 6, QTableWidgetItem(str(granulo_data._Ctot_sand[i])))
|
||||||
|
self.tableWidget_sample.setItem(i, granulo_data._frac_vol_fine.shape[1] + 7, QTableWidgetItem(str(granulo_data._D50_sand[i])))
|
||||||
|
self.tableWidget_sample.setItem(i, granulo_data._frac_vol_fine.shape[1] + 8 + j, QTableWidgetItem(str(granulo_data._frac_vol_sand[i, j])))
|
||||||
|
|
||||||
|
# --- Connect checkbox to all checkboxes of tableWidget ---
|
||||||
|
# self.allChkBox.stateChanged.connect(self.check_allChkBox)
|
||||||
|
|
||||||
|
# --- Connect checkbox items of tableWidget to update plots ---
|
||||||
|
self.tableWidget_sample.itemChanged.connect(self.extract_position_list_and_color_list_from_table_checkboxes)
|
||||||
|
|
||||||
|
else:
|
||||||
|
# print("PLease download first file")
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Fill table Error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Download files before fill table")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
|
# --- Function to extract position of sample from table checkboxes to update plots ---
|
||||||
|
def extract_position_list_and_color_list_from_table_checkboxes(self):
|
||||||
|
position = []
|
||||||
|
color_list = []
|
||||||
|
sample_checkbox = np.zeros((1, len(range(self.tableWidget_sample.rowCount()))))
|
||||||
|
for i in range(self.tableWidget_sample.rowCount()):
|
||||||
|
if self.tableWidget_sample.item(i, 1).checkState() == 2:
|
||||||
|
if self.tableWidget_sample.item(i, 1).checkState() == Qt.Checked:
|
||||||
|
position.append(i)
|
||||||
|
eval(f"color_list.append(self.comboBox_sample_table{i}.currentText())")
|
||||||
|
sample_checkbox[0, i] = 2
|
||||||
|
|
||||||
|
# Called functions to update plots simultaneously with table checkboxes selection
|
||||||
|
# if self.tableWidget_sample.columnCount() > 12:
|
||||||
|
# self.update_plot_fine_sediment_PSD_class_cumul(position, color_list)
|
||||||
|
self.update_plot_total_concentration(position, color_list)
|
||||||
|
|
||||||
|
return position, color_list
|
||||||
|
|
||||||
|
# --- Function to export data of table ---
|
||||||
|
def export_table(self):
|
||||||
|
if self.tableWidget_sample.columnCount() > 10:
|
||||||
|
print("Export table")
|
||||||
|
else:
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Export table Error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Fill table before export table")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------------------------
|
||||||
|
# --- Functions to plot samples positions on transect ---
|
||||||
|
def empty_field_for_transect_plot(self):
|
||||||
|
self.axis_sample_position.set_xticks([])
|
||||||
|
self.axis_sample_position.set_yticks([])
|
||||||
|
|
||||||
|
def update_plots_from_table_checkboxes(self):
|
||||||
|
# color_value_row = self.tableWidget_sample.currentRow()
|
||||||
|
# exec("color_value = self.comboBox_sample_table{color_value_row}.currentText()")
|
||||||
|
# eval("color_list.append(color_value)")
|
||||||
|
# print(color_list)
|
||||||
|
position = []
|
||||||
|
color_list = []
|
||||||
|
sample_checkbox = np.zeros((1, len(range(self.tableWidget_sample.rowCount()))))
|
||||||
|
# print(sample_checkbox.shape)
|
||||||
|
for i in range(self.tableWidget_sample.rowCount()):
|
||||||
|
# print(f"S{i+1} ", self.tableWidget_sample.item(i, 1).checkState())
|
||||||
|
if self.tableWidget_sample.item(i, 1).checkState() == 2:
|
||||||
|
if self.tableWidget_sample.item(i, 1).checkState() == Qt.Checked:
|
||||||
|
# print(f"S{i} = Checked")
|
||||||
|
position.append(i)
|
||||||
|
eval(f"color_list.append(self.comboBox_sample_table{i}.currentText())")
|
||||||
|
# print("position", position)
|
||||||
|
# print("color_list", color_list)
|
||||||
|
# self.update_plot_transect_bottom_with_sample_position(position, color_list)
|
||||||
|
self.update_plot_total_concentration(position, color_list)
|
||||||
|
# self.update_plot_fine_and_sand_sediments_PSD(position, color_list)
|
||||||
|
if self.pushbutton_cumulative_PSD.sender():
|
||||||
|
self.update_plot_fine_PSD_cumul(position, color_list)
|
||||||
|
self.update_plot_sand_PSD_cumul(position, color_list)
|
||||||
|
else:
|
||||||
|
self.update_plot_fine_PSD_class(position, color_list)
|
||||||
|
self.update_plot_sand_PSD_class(position, color_list)
|
||||||
|
sample_checkbox[0, i] = 2
|
||||||
|
return position, color_list
|
||||||
|
|
||||||
|
# print("sample_checkbox", np.append(sample_checkbox, self.tableWidget_sample.item(i, 1).checkState()))
|
||||||
|
# print(sample_checkbox[0self.tableWidget_sample.item(i, 1).checkState(), i])
|
||||||
|
# sample_checkbox[0, i] == self.tableWidget_sample.item(i, 1).checkState()
|
||||||
|
# if self.tableWidget_sample.item(i, 1).checkState() == Qt.Unchecked:
|
||||||
|
# print(f"S{i} = Unchecked")
|
||||||
|
# elif np.sum(sample_checkbox) == 0:
|
||||||
|
# self.plot_total_concentration()
|
||||||
|
# print("position", position)
|
||||||
|
# print("color_list", color_list)
|
||||||
|
# print(self.tableWidget_sample.item(i, 1))
|
||||||
|
# print("sample_checkbox tot", sample_checkbox)
|
||||||
|
# print(np.any(sample_checkbox == 0, axis=0))
|
||||||
|
# print(sample_checkbox.all())
|
||||||
|
# print(~sample_checkbox.all())
|
||||||
|
# if np.sum(sample_checkbox) == 0:
|
||||||
|
# print("True")
|
||||||
|
# # self.plot_transect_bottom_with_sample_position()
|
||||||
|
# # self.plot_total_concentration()
|
||||||
|
# else:
|
||||||
|
# print("False")
|
||||||
|
|
||||||
|
# def choice_color_sample_position_point(self):
|
||||||
|
# row_value = self.tableWidget_sample.currentRow()
|
||||||
|
# print("row = ", row_value)
|
||||||
|
# print(eval(f"self.comboBox_sample_table{row_value}.currentText()"))
|
||||||
|
# # print("row value", row_value)
|
||||||
|
# # print("cell widget ", self.tableWidget_sample.cellWidget(row_value, 0))
|
||||||
|
# # print("isinstance(widget, QComboBox)", isinstance(self.tableWidget_sample.cellWidget(row_value, 0), QComboBox))
|
||||||
|
# # print("cell item ", self.tableWidget_sample.item(row_value, 0))
|
||||||
|
# # print("combobox tablewidget ", self.comboBox_sample_table.currentText())
|
||||||
|
# # print("combobox change value")
|
||||||
|
|
||||||
|
# def plot_transect_bottom_with_sample_position(self):
|
||||||
|
# frequency = self.model.Freq[0]
|
||||||
|
# val_min = 0 # np.nanmin(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
|
||||||
|
# val_max = np.nanmax(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
|
||||||
|
# if val_min == 0:
|
||||||
|
# val_min = 1e-5
|
||||||
|
# # if val_min == 0:
|
||||||
|
# # val_min = 1e-5
|
||||||
|
# # self.axis_sampleposition.imshow(np.asarray(np.array(self.model.V[:, 0, :2300], dtype=float)), aspect='auto',
|
||||||
|
# # extent=[0, 2300, self.model.depth[-1][0], self.model.depth[0][0]],
|
||||||
|
# # cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
|
||||||
|
# self.axis_sampleposition.pcolormesh(self.model.dist_BS_section,
|
||||||
|
# np.flipud(self.model.BS_raw_cross_section.r),
|
||||||
|
# self.model.BS_averaged_cross_section_corr.V[:, 0, :],
|
||||||
|
# cmap='viridis',
|
||||||
|
# norm=LogNorm(vmin=val_min, vmax=val_max), shading='gouraud')
|
||||||
|
# self.axis_sampleposition.plot(self.model.dist_BS_section,
|
||||||
|
# np.max(self.model.r_bottom_cross_section) - self.model.r_bottom_cross_section
|
||||||
|
# + np.min(self.model.r_bottom_cross_section),
|
||||||
|
# color='k', linewidth=2)
|
||||||
|
# self.axis_sampleposition.set_xticks([])
|
||||||
|
# self.axis_sampleposition.set_yticks([])
|
||||||
|
# self.figure_sampleposition.canvas.draw_idle()
|
||||||
|
#
|
||||||
|
# def update_plot_transect_bottom_with_sample_position(self, position_value, color_list):
|
||||||
|
# frequency = self.model.Freq[0]
|
||||||
|
# val_min = 0 # np.nanmin(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
|
||||||
|
# val_max = np.nanmax(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
|
||||||
|
# if val_min == 0:
|
||||||
|
# val_min = 1e-5
|
||||||
|
# # if val_min == 0:
|
||||||
|
# # val_min = 1e-5
|
||||||
|
# # self.axis_sampleposition.imshow(np.asarray(np.array(self.model.V[:, 0, :2300], dtype=float)), aspect='auto',
|
||||||
|
# # extent=[0, 2300, self.model.depth[-1][0], self.model.depth[0][0]],
|
||||||
|
# # cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
|
||||||
|
# self.axis_sampleposition.cla()
|
||||||
|
# self.plot_transect_bottom_with_sample_position()
|
||||||
|
# self.axis_sampleposition.pcolormesh(self.model.dist_BS_section,
|
||||||
|
# np.flipud(self.model.BS_raw_cross_section.r),
|
||||||
|
# self.model.BS_averaged_cross_section_corr.V[:, 0, :],
|
||||||
|
# cmap='viridis',
|
||||||
|
# norm=LogNorm(vmin=val_min, vmax=val_max), shading='gouraud')
|
||||||
|
# self.axis_sampleposition.plot(self.model.dist_BS_section,
|
||||||
|
# np.max(self.model.r_bottom_cross_section) - self.model.r_bottom_cross_section
|
||||||
|
# + np.min(self.model.r_bottom_cross_section),
|
||||||
|
# color='k', linewidth=2)
|
||||||
|
# # marker_color = ["orange", "green"]
|
||||||
|
# # for i in range(len(marker_color)):
|
||||||
|
# self.axis_sampleposition.scatter(self.model._fine_sediment_file.iloc[position_value]["y"],
|
||||||
|
# np.max(self.model.r_bottom_cross_section) - self.model._fine_sediment_file.iloc[position_value]["z"]
|
||||||
|
# + np.min(self.model.r_bottom_cross_section),
|
||||||
|
# linestyle='None', marker="o", s=14, c=color_list)
|
||||||
|
# # markerfacecolor=["orange", "green"], markeredgecolor=["orange", "green"])
|
||||||
|
# # self.axis_sampleposition.set_axis_off()
|
||||||
|
# self.axis_sampleposition.set_xticks([])
|
||||||
|
# self.axis_sampleposition.set_yticks([])
|
||||||
|
# self.figure_sampleposition.canvas.draw_idle()
|
||||||
|
# # self.figure_sampleposition.tight_layout()
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------------------------
|
||||||
|
# --- Functions to plot total concentration ---
|
||||||
|
def empty_field_for_total_concentration_plot(self):
|
||||||
|
self.axis_total_concentration.cla()
|
||||||
|
self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText())
|
||||||
|
self.axis_total_concentration.set_ylabel(self.combobox_y_axis.currentText())
|
||||||
|
self.canvas_total_concentration.draw()
|
||||||
|
|
||||||
|
def update_plot_total_concentration(self, position_list, color_list):
|
||||||
|
if self.lineEdit_fine_sediment.text():
|
||||||
|
if self.lineEdit_sand.text():
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
if self.tableWidget_sample.columnCount() > 15:
|
||||||
|
if self.combobox_x_axis.currentIndex() == 0:
|
||||||
|
# position_list, color_list = self.extract_position_list_and_color_list_from_table_checkboxes()
|
||||||
|
self.axis_total_concentration.cla()
|
||||||
|
self.axis_total_concentration.scatter(granulo_data._Ctot_fine[position_list],
|
||||||
|
granulo_data._z[position_list],
|
||||||
|
s=100, facecolor=color_list, edgecolor="None", alpha=0.5)
|
||||||
|
self.axis_total_concentration.scatter(granulo_data._Ctot_sand[position_list],
|
||||||
|
granulo_data._z[position_list],
|
||||||
|
s=300, facecolors="None", edgecolors=color_list)
|
||||||
|
self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText())
|
||||||
|
self.axis_total_concentration.set_ylabel(self.combobox_y_axis.currentText())
|
||||||
|
self.canvas_total_concentration.draw()
|
||||||
|
elif self. combobox_x_axis.currentIndex() == 1:
|
||||||
|
# position_list, color_list = self.extract_position_list_and_color_list_from_table_checkboxes()
|
||||||
|
self.axis_total_concentration.cla()
|
||||||
|
print(position_list)
|
||||||
|
self.axis_total_concentration.scatter(granulo_data._Ctot_fine[position_list],
|
||||||
|
granulo_data._z[position_list] / np.max(granulo_data._z[position_list]),
|
||||||
|
s=12, c=color_list)
|
||||||
|
self.axis_total_concentration.scatter(granulo_data._Ctot_sand[position_list],
|
||||||
|
granulo_data._z[position_list],
|
||||||
|
s=16, facecolors=None, edgecolors=color_list)
|
||||||
|
self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText())
|
||||||
|
self.axis_total_concentration.set_ylabel(self.combobox_y_axis.currentText())
|
||||||
|
self.canvas_total_concentration.draw()
|
||||||
|
else:
|
||||||
|
self.empty_field_for_total_concentration_plot()
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def on_clicked(self):
|
||||||
|
self.pushbutton_class_PSD.clicked_signal.emit()
|
||||||
|
|
||||||
|
def empty_field_to_plot_fine_sediment_distribution(self):
|
||||||
|
if self.pushbutton_class_PSD.sender().text() == "Class PSD":
|
||||||
|
print("button Class PSD")
|
||||||
|
elif self.pushbutton_cumulative_PSD.sender().text() == "Cumulative PSD":
|
||||||
|
print("button Cumulative PSD")
|
||||||
|
# print("cumul button push ", self.pushbutton_cumulative_PSD.sender().text())
|
||||||
|
button = self.sender()
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
if self.tableWidget_sample.columnCount() == 10:
|
||||||
|
if button.text() == "Class PSD":
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
elif button.text() == "Cumulative PSD":
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
else:
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
else:
|
||||||
|
print("Table size is not equal to 10")
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def update_plot_fine_sediment_PSD_class_cumul(self, sample_position_list, color_list):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
if self.pushbutton_class_PSD.sender().text() == "Class PSD":
|
||||||
|
for profil_position_num, color_plot in zip(sample_position_list, color_list):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain,
|
||||||
|
granulo_data._frac_vol_fine[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
elif self.pushbutton_cumulative_PSD.sender().text() == "Cumulative PSD":
|
||||||
|
for profil_position_num, color_plot in zip(sample_position_list, color_list):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain,
|
||||||
|
granulo_data._frac_vol_fine_cumul[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
else:
|
||||||
|
for profil_position_num, color_plot in zip(sample_position_list, color_list):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain,
|
||||||
|
granulo_data._frac_vol_fine[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def on_clicked_pushbutton_PSD_class(self):
|
||||||
|
if self.pushbutton_class_PSD.sender():
|
||||||
|
print("button is clicked")
|
||||||
|
if self.tableWidget_sample.columnCount() > 10:
|
||||||
|
position, color_list = self.update_plots_from_table_checkboxes()
|
||||||
|
self.update_plot_fine_PSD_class(position, color_list)
|
||||||
|
self.update_plot_sand_PSD_class(position, color_list)
|
||||||
|
else:
|
||||||
|
self.empty_field_for_plot_fine_PSD_class()
|
||||||
|
self.empty_field_for_plot_sand_PSD_class()
|
||||||
|
|
||||||
|
def on_clicked_pushbutton_PSD_cumul(self):
|
||||||
|
print(self.pushbutton_cumulative_PSD.sender())
|
||||||
|
if self.tableWidget_sample.columnCount() > 10:
|
||||||
|
position, color_list = self.update_plots_from_table_checkboxes()
|
||||||
|
self.update_plot_fine_PSD_cumul(position, color_list)
|
||||||
|
self.update_plot_sand_PSD_cumul(position, color_list)
|
||||||
|
else:
|
||||||
|
self.empty_field_for_plot_fine_PSD_cumul()
|
||||||
|
self.empty_field_for_plot_sand_PSD_cumul()
|
||||||
|
|
||||||
|
def empty_field_for_plot_fine_PSD_class(self):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def empty_field_for_plot_fine_sand_PSD_class(self):
|
||||||
|
button = self.sender()
|
||||||
|
print(button.text())
|
||||||
|
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Size class volume fraction')
|
||||||
|
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def update_plot_fine_and_sand_sediments_PSD(self):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
if self.pushbutton_class_PSD.sender():
|
||||||
|
if self.tableWidget_sample.columnCount() > 10:
|
||||||
|
position_list, color_list = self.extract_position_list_and_color_list_from_table_checkboxes()
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
for profil_position_num, color_plot in zip(position_list, color_list):
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain, granulo_data._frac_vol_fine[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
else:
|
||||||
|
self.empty_field_for_plot_fine_PSD_class()
|
||||||
|
self.empty_field_for_plot_sand_PSD_class()
|
||||||
|
elif self.pushbutton_cumulative_PSD.sender():
|
||||||
|
if self.tableWidget_sample.columnCount() > 10:
|
||||||
|
position_list, color_list = self.extract_position_list_and_color_list_from_table_checkboxes()
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
for profil_position_num, color_plot in zip(position_list, color_list):
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain,
|
||||||
|
granulo_data._frac_vol_fine_cumul[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
else:
|
||||||
|
self.empty_field_for_plot_fine_PSD_cumul()
|
||||||
|
self.empty_field_for_plot_sand_PSD_cumul()
|
||||||
|
|
||||||
|
def update_plot_fine_PSD_class(self, profil_position, color_list):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
for profil_position_num, color_plot in zip(profil_position, color_list):
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain, granulo_data._frac_vol_fine[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def empty_field_for_plot_fine_sand_PSD_cumul(self):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Cumulated size volume fraction')
|
||||||
|
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
def empty_field_for_plot_fine_PSD_cumul(self):
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def update_plot_fine_PSD_cumul(self, profil_position, color_list):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.axis_plot_PSD[0].cla()
|
||||||
|
for profil_position_num, color_plot in zip(profil_position, color_list):
|
||||||
|
self.axis_plot_PSD[0].plot(granulo_data._r_grain, granulo_data._frac_vol_fine_cumul[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[0].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[0].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[0].set_ylabel('Cumulated size volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def empty_field_for_plot_sand_PSD_class(self):
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def update_plot_sand_PSD_class(self, profil_position, color_list):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
for profil_position_num, color_plot in zip(profil_position, color_list):
|
||||||
|
self.axis_plot_PSD[1].plot(granulo_data._r_grain, granulo_data._frac_vol_sand[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Size class volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def empty_field_for_plot_sand_PSD_cumul(self):
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius ($\mu m$)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Cumulated size volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
def update_plot_sand_PSD_cumul(self, profil_position, color_list):
|
||||||
|
granulo_data = deepcopy(
|
||||||
|
GranuloLoader(self.lineEdit_fine_sediment.toolTip() + "/" + self.lineEdit_fine_sediment.text(),
|
||||||
|
self.lineEdit_sand.toolTip() + "/" + self.lineEdit_sand.text()))
|
||||||
|
self.axis_plot_PSD[1].cla()
|
||||||
|
for profil_position_num, color_plot in zip(profil_position, color_list):
|
||||||
|
self.axis_plot_PSD[1].plot(granulo_data._r_grain, granulo_data._frac_vol_sand_cumul[profil_position_num, :],
|
||||||
|
color=color_plot)
|
||||||
|
self.axis_plot_PSD[1].set_xscale('log')
|
||||||
|
self.axis_plot_PSD[1].set_xlabel('Radius (m)')
|
||||||
|
self.axis_plot_PSD[1].set_ylabel('Cumulated size volume fraction')
|
||||||
|
self.canvas_plot_PSD.draw()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,783 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QGroupBox, QLabel, QCheckBox, \
|
||||||
|
QSpinBox, QDoubleSpinBox, QComboBox, QLineEdit, QSlider
|
||||||
|
from PyQt5.QtGui import QFont, QIcon, QPixmap
|
||||||
|
from PyQt5.QtCore import Qt, QCoreApplication
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
|
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
||||||
|
from matplotlib.colors import LogNorm
|
||||||
|
|
||||||
|
import Translation.constant_string as cs
|
||||||
|
|
||||||
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
|
||||||
|
class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
|
''' This class generates the Signal Processing Tab '''
|
||||||
|
|
||||||
|
def __init__(self, widget_tab):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
path_icon = "./icons/"
|
||||||
|
|
||||||
|
### --- General layout of widgets ---
|
||||||
|
|
||||||
|
# ___________ ____________________________
|
||||||
|
# | profile | | Profile |
|
||||||
|
# | position | | |
|
||||||
|
# | | | |
|
||||||
|
# | | | Averaged profile |
|
||||||
|
# | post | | |
|
||||||
|
# | proc | | |
|
||||||
|
# | options | | FCB option |
|
||||||
|
# |___________| |____________________________|
|
||||||
|
|
||||||
|
self.horizontalLayout_SignalProceesingTab = QHBoxLayout(widget_tab)
|
||||||
|
|
||||||
|
self.verticalLayout_Left_SignalProcessingTab = QVBoxLayout()
|
||||||
|
self.horizontalLayout_SignalProceesingTab.addLayout(self.verticalLayout_Left_SignalProcessingTab, 2)
|
||||||
|
|
||||||
|
self.verticalLayout_Right_SignalProcessingTab = QVBoxLayout()
|
||||||
|
self.horizontalLayout_SignalProceesingTab.addLayout(self.verticalLayout_Right_SignalProcessingTab, 8)
|
||||||
|
|
||||||
|
# # --------------------------------------------------------------------------------------------------------------
|
||||||
|
# ### --- 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)
|
||||||
|
# self.plot_transect_bottom_with_profile_position(0)
|
||||||
|
#
|
||||||
|
# # self.axis_plot_profile_position_on_transect.plot(
|
||||||
|
# # 0 * np.ones(self.model.r_bottom_cross_section.shape[0]),
|
||||||
|
# # self.model.r_bottom_cross_section, color='red', linestyle="solid", linewidth=2)
|
||||||
|
#
|
||||||
|
# self.verticalLayout_groupbox_display_profile_position.addWidget(self.canvas_plot_profile_position_on_transect)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_slider_plot_profile_position = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_display_profile_position.addLayout(
|
||||||
|
# self.horizontalLayout_slider_plot_profile_position)
|
||||||
|
#
|
||||||
|
# # self.icon_triangle_left = QPixmap(path_icon + "triangle_left.png")
|
||||||
|
# # self.pushButton_slider_plot_profile_position_left = QPushButton()
|
||||||
|
# # self.pushButton_slider_plot_profile_position_left.setIcon(QIcon(self.icon_triangle_left))
|
||||||
|
# # self.icon_triangle_right = QPixmap(path_icon + "triangle_right.png")
|
||||||
|
# # self.pushButton_slider_plot_profile_position_right = QPushButton()
|
||||||
|
# # self.pushButton_slider_plot_profile_position_right.setIcon(QIcon(self.icon_triangle_right))
|
||||||
|
# #
|
||||||
|
# # self.horizontalLayout_slider_plot_profile_position.addWidget(self.pushButton_slider_plot_profile_position_left)
|
||||||
|
# # self.horizontalLayout_slider_plot_profile_position.addWidget(self.pushButton_slider_plot_profile_position_right)
|
||||||
|
# #
|
||||||
|
# # self.lineEdit_slider_plot_profile_position = QLineEdit()
|
||||||
|
# # self.horizontalLayout_slider_plot_profile_position.addWidget(self.lineEdit_slider_plot_profile_position)
|
||||||
|
# #
|
||||||
|
# # self.slider_plot_profile_position = QSlider()
|
||||||
|
# # self.slider_plot_profile_position.setOrientation(Qt.Horizontal)
|
||||||
|
# # self.slider_plot_profile_position.setTickPosition(QSlider.TicksBelow)
|
||||||
|
# # self.slider_plot_profile_position.setCursor(Qt.OpenHandCursor)
|
||||||
|
# # self.slider_plot_profile_position.setMinimum(0)
|
||||||
|
# # self.slider_plot_profile_position.setMaximum(1)
|
||||||
|
# # self.slider_plot_profile_position.setTickInterval(1)
|
||||||
|
# # self.slider_plot_profile_position.setValue(0)
|
||||||
|
# # 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)
|
||||||
|
#
|
||||||
|
# # self.checkbox_substract_noise = QCheckBox()
|
||||||
|
# # self.checkbox_substract_noise.setText("Substract the noise")
|
||||||
|
# # self.verticalLayout_averaged_profile = QVBoxLayout(self.checkbox_substract_noise)
|
||||||
|
# # self.pushbutton_averaged_profile = QPushButton()
|
||||||
|
# # self.pushbutton_averaged_profile.setText("Plot averaged profile")
|
||||||
|
#
|
||||||
|
# # self.verticalLayout_groupbox_plotacousticprofile.addWidget(self.checkbox_substract_noise)
|
||||||
|
#
|
||||||
|
# # self.groupbox_SNR_criterion = QGroupBox()
|
||||||
|
# # self.groupbox_SNR_criterion.setTitle("SNR criterion")
|
||||||
|
# # self.verticalLayout_SNR_criterion = QVBoxLayout(self.groupbox_SNR_criterion)
|
||||||
|
# # self.horizontalLayout_SNR_criterion = QHBoxLayout()
|
||||||
|
# # self.label_SNR_crterion = QLabel()
|
||||||
|
# # self.label_SNR_crterion.setText("Remove point if SNR <")
|
||||||
|
# # self.horizontalLayout_SNR_criterion.addWidget(self.label_SNR_crterion)
|
||||||
|
# # self.lineEdit_SNR_criterion = QLineEdit()
|
||||||
|
# # self.horizontalLayout_SNR_criterion.addWidget(self.lineEdit_SNR_criterion)
|
||||||
|
# # self.verticalLayout_SNR_criterion.addLayout(self.horizontalLayout_SNR_criterion)
|
||||||
|
# # self.pushbutton_SNR_criterion = QPushButton()
|
||||||
|
# # self.pushbutton_SNR_criterion.setText("Remove points on profile")
|
||||||
|
# # self.verticalLayout_SNR_criterion.addWidget(self.pushbutton_SNR_criterion)
|
||||||
|
# # self.verticalLayout_groupbox_plotacousticprofile.addWidget(self.groupbox_SNR_criterion)
|
||||||
|
#
|
||||||
|
# # self.horizontalLayoutTop_signalProcessing.addWidget(self.groupbox_profile, 3)
|
||||||
|
#
|
||||||
|
# # 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)
|
||||||
|
# self.horizontalLayout_acoustic_profile = QHBoxLayout(self.groupbox_acoustic_profile)
|
||||||
|
# # self.label_subtract_noise = QLabel()
|
||||||
|
# # self.label_subtract_noise.setText("Subtract the noise")
|
||||||
|
# self.checkbox_substract_noise = QCheckBox()
|
||||||
|
# self.checkbox_substract_noise.setChecked(False)
|
||||||
|
# # self.checkbox_substract_noise.setText("Subtract the noise")
|
||||||
|
# self.checkbox_substract_noise.setToolTip("Enable for further computation")
|
||||||
|
# self.horizontalLayout_acoustic_profile.addWidget(self.checkbox_substract_noise)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.checkbox_substract_noise, 0, 0, 1, 1)
|
||||||
|
# # self.checkbox_subtract_noise_enable = QCheckBox()
|
||||||
|
# # self.checkbox_subtract_noise_enable.setChecked(False)
|
||||||
|
# # self.checkbox_subtract_noise_enable.setText("Enable")
|
||||||
|
# # self.horizontalLayout_label_subtract_noise.addWidget(self.checkbox_subtract_noise_enable)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.checkbox_subtract_noise_enable, 0, 1, 1, 1)
|
||||||
|
# # self.checkbox_subtract_noise_disable = QCheckBox()
|
||||||
|
# # self.checkbox_subtract_noise_disable.setChecked(True)
|
||||||
|
# # self.checkbox_subtract_noise_disable.setText("Disable")
|
||||||
|
# # self.checkbox_subtract_noise_add_noisy_profile = QCheckBox()
|
||||||
|
# # self.checkbox_subtract_noise_add_noisy_profile.setText("Add noisy profile")
|
||||||
|
# # self.horizontalLayout_label_subtract_noise.addWidget(self.checkbox_subtract_noise_disable)
|
||||||
|
# # self.verticalLayout_post_processing.addLayout(self.horizontalLayout_label_subtract_noise)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.checkbox_subtract_noise_add_noisy_profile, 0, 2, 1, 1)
|
||||||
|
# # self.horizontalLayout_SNR_criterion = QHBoxLayout()
|
||||||
|
# # self.formLayout_SNR_criterion = QFormLayout()
|
||||||
|
# # self.formLayout_SNR_criterion.set
|
||||||
|
# # self.label_SNR_criterion = QLabel()
|
||||||
|
# # self.label_SNR_criterion.setText("SNR criterion")
|
||||||
|
# self.checkbox_SNR_criterion = QCheckBox()
|
||||||
|
# self.checkbox_SNR_criterion.setChecked(False)
|
||||||
|
# # self.checkbox_SNR_criterion.setText("SNR criterion")
|
||||||
|
# self.checkbox_SNR_criterion.setToolTip("Enable for further computation")
|
||||||
|
# self.horizontalLayout_acoustic_profile.addWidget(self.checkbox_SNR_criterion)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.label_SNR_criterion, 1, 0, 1, 1)
|
||||||
|
# # self.lineEdit_SNR_criterion = QLineEdit()
|
||||||
|
# # self.lineEdit_SNR_criterion.setEnabled(True)
|
||||||
|
# # self.lineEdit_SNR_criterion.setText("10")
|
||||||
|
# self.spinbox_SNR_criterion = QSpinBox()
|
||||||
|
# self.spinbox_SNR_criterion.setRange(0, 9999)
|
||||||
|
# self.spinbox_SNR_criterion.setValue(10)
|
||||||
|
# # self.lineEdit_SNR_criterion.setFixedWidth(5)
|
||||||
|
# self.horizontalLayout_acoustic_profile.addWidget(self.spinbox_SNR_criterion)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.lineEdit_SNR_criterion, 1, 1, 1, 1)
|
||||||
|
# # self.checkbox_SNR_criterion_enable = QCheckBox()
|
||||||
|
# # self.checkbox_SNR_criterion_enable.setChecked(False)
|
||||||
|
# # self.checkbox_SNR_criterion_enable.setText("Enable")
|
||||||
|
# # self.horizontalLayout_SNR_criterion.addWidget(self.checkbox_SNR_criterion_enable)
|
||||||
|
# # self.gridLayout_groupbox_acoustic_profile.addWidget(self.checkbox_SNR_criterion_enable, 1, 2, 1, 1)
|
||||||
|
# # self.checkbox_SNR_criterion_disable = QCheckBox()
|
||||||
|
# # self.checkbox_SNR_criterion_disable.setChecked(True)
|
||||||
|
# # self.checkbox_SNR_criterion_disable.setText("Disable")
|
||||||
|
# # 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)
|
||||||
|
#
|
||||||
|
# # 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()
|
||||||
|
# # self.checkbox_nb_horizontal_cell_enable.setText("Enable")
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.checkbox_nb_horizontal_cell_enable, 0, 3, 1, 1)
|
||||||
|
# # self.checkbox_nb_horizontal_cell_add_raw_profile = QCheckBox()
|
||||||
|
# # self.checkbox_nb_horizontal_cell_add_raw_profile.setText("Add raw profile")
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.checkbox_nb_horizontal_cell_add_raw_profile, 0, 4, 1, 1)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_vertical_average = QHBoxLayout()
|
||||||
|
# self.verticalLayout_windowsize.addLayout(self.horizontalLayout_vertical_average)
|
||||||
|
# # self.label_nb_vertical_cells = QLabel()
|
||||||
|
# # self.label_nb_vertical_cells.setText("Vertical: +/-")
|
||||||
|
# self.checkbox_nb_vertical_cells = QCheckBox()
|
||||||
|
# self.checkbox_nb_vertical_cells.setChecked(False)
|
||||||
|
# # self.checkbox_nb_vertical_cells.setText("Vertical: +/-")
|
||||||
|
# self.checkbox_nb_vertical_cells.setToolTip("Enable for further computation")
|
||||||
|
# self.horizontalLayout_vertical_average.addWidget(self.checkbox_nb_vertical_cells)
|
||||||
|
# # self.horizontalLayout_vertical_average.addWidget(self.label_nb_vertical_cells)
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.label_nb_vertical_cells, 1, 0, 1, 1)
|
||||||
|
# # self.lineEdit_nb_vertical_cells = QLineEdit()
|
||||||
|
# # self.lineEdit_nb_vertical_cells.setText("1")
|
||||||
|
# self.spinbox_nb_vertical_cells = QSpinBox()
|
||||||
|
# self.spinbox_nb_vertical_cells.setRange(0, 9999)
|
||||||
|
# self.spinbox_nb_vertical_cells.setValue(0)
|
||||||
|
# self.horizontalLayout_vertical_average.addWidget(self.spinbox_nb_vertical_cells)
|
||||||
|
# # self.horizontalLayout_vertical_average.addWidget(self.lineEdit_nb_vertical_cells)
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.lineEdit_nb_vertical_cells, 1, 1, 1, 1)
|
||||||
|
# self.label_nb_vertical_cells_cm = QLabel()
|
||||||
|
# # self.label_nb_vertical_cells_cm.setText("cells = +/- ? cm")
|
||||||
|
# self.horizontalLayout_vertical_average.addWidget(self.label_nb_vertical_cells_cm)
|
||||||
|
# # self.verticalLayout_plot_averaged_profile.addLayout(self.horizontalLayout_vertical_average)
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.label_nb_vertical_cells_cm, 1, 2, 1, 1)
|
||||||
|
# # self.checkbox_nb_vertical_cells_enable = QCheckBox()
|
||||||
|
# # self.checkbox_nb_vertical_cells_enable.setText("Enable")
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.checkbox_nb_vertical_cells_enable, 1, 3, 1, 1)
|
||||||
|
# # self.checkbox_nb_vertical_cells_add_raw_profile = QCheckBox()
|
||||||
|
# # self.checkbox_nb_vertical_cells_add_raw_profile.setText("Add raw profile")
|
||||||
|
# # self.gridLayout_groupbox_window_size.addWidget(self.checkbox_nb_vertical_cells_add_raw_profile, 1, 4, 1, 1)
|
||||||
|
#
|
||||||
|
# # self.pushbutton_plot_averaged_profile = QPushButton()
|
||||||
|
# # self.pushbutton_plot_averaged_profile.setText("Plot averaged profiles")
|
||||||
|
# # self.verticalLayout_plot_averaged_profile.addWidget(self.pushbutton_plot_averaged_profile)
|
||||||
|
# #
|
||||||
|
# # 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()
|
||||||
|
# # self.groupbox_rayleigh_criterion.setTitle("Rayleigh criterion")
|
||||||
|
# # self.groupbox_despiking_signal = QGroupBox()
|
||||||
|
# # self.groupbox_despiking_signal.setTitle("Despiking the signal")
|
||||||
|
# # self.verticalLayout_despiking_signal = QVBoxLayout(self.groupbox_despiking_signal)
|
||||||
|
# # self.horizontalLayout_despiking_signal_label = QHBoxLayout()
|
||||||
|
#
|
||||||
|
# # self.gridLayout_rayleigh_criterion = QGridLayout(self.groupbox_rayleigh_criterion)
|
||||||
|
# self.horizontalLayout_rayleigh_criterion = QHBoxLayout(self.groupbox_rayleigh_criterion)
|
||||||
|
#
|
||||||
|
# self.label_Rayleigh_criterion = QLabel()
|
||||||
|
# self.label_Rayleigh_criterion.setText("<V²>/<V>² <=")
|
||||||
|
# # self.horizontalLayout_despiking_signal_label.addWidget(self.label_Rayleigh_criterion)
|
||||||
|
# # self.gridLayout_rayleigh_criterion.addWidget(self.label_Rayleigh_criterion, 0, 0, 1, 1)
|
||||||
|
# self.horizontalLayout_rayleigh_criterion.addWidget(self.label_Rayleigh_criterion)
|
||||||
|
# # self.lineEdit_despiking_signal_label = QLineEdit()
|
||||||
|
# # self.lineEdit_despiking_signal_label.setText("10")
|
||||||
|
# self.spinbox_rayleigh_criterion = QSpinBox()
|
||||||
|
# self.spinbox_rayleigh_criterion.setRange(0, 9999)
|
||||||
|
# self.spinbox_rayleigh_criterion.setValue(10)
|
||||||
|
# # self.horizontalLayout_despiking_signal_label.addWidget(self.lineEdit_despiking_signal_label)
|
||||||
|
# # self.gridLayout_rayleigh_criterion.addWidget(self.lineEdit_despiking_signal_label, 0, 1, 1, 1)
|
||||||
|
# self.horizontalLayout_rayleigh_criterion.addWidget(self.spinbox_rayleigh_criterion)
|
||||||
|
# self.label_4pi = QLabel()
|
||||||
|
# self.label_4pi.setText("% x 4/pi")
|
||||||
|
# # self.horizontalLayout_despiking_signal_label.addWidget(self.label_4pi)
|
||||||
|
# # self.gridLayout_rayleigh_criterion.addWidget(self.label_4pi, 0, 2, 1, 1)
|
||||||
|
# self.horizontalLayout_rayleigh_criterion.addWidget(self.label_4pi)
|
||||||
|
# # self.verticalLayout_despiking_signal.addLayout(self.horizontalLayout_despiking_signal_label)
|
||||||
|
# # self.pushbutton_despiking_signal = QPushButton()
|
||||||
|
# # self.pushbutton_despiking_signal.setText("Despiking the signal")
|
||||||
|
# # self.verticalLayout_despiking_signal.addWidget(self.pushbutton_despiking_signal)
|
||||||
|
# self.checkbox_despiked_acoustic_signal = QCheckBox()
|
||||||
|
# # self.checkbox_despiked_acoustic_signal.setText("Despiking")
|
||||||
|
# self.checkbox_despiked_acoustic_signal.setToolTip("Enable for further computation")
|
||||||
|
# # self.gridLayout_rayleigh_criterion.addWidget(self.checkbox_rayleigh_criterion_enable, 0, 3, 1, 1)
|
||||||
|
# self.horizontalLayout_rayleigh_criterion.addWidget(self.checkbox_despiked_acoustic_signal)
|
||||||
|
# # 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")
|
||||||
|
# self.verticalLayout_groupbox_water_attenuation = QVBoxLayout(self.groupbox_water_attenuation)
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_water_attenuation.addLayout(
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature)
|
||||||
|
#
|
||||||
|
# self.combobox_water_attenuation_model = QComboBox()
|
||||||
|
# self.combobox_water_attenuation_model.addItem("François & Garrison 1982")
|
||||||
|
# self.combobox_water_attenuation_model.addItem("Other model")
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature.addWidget(self.combobox_water_attenuation_model)
|
||||||
|
#
|
||||||
|
# self.label_temperature_water_attenation = QLabel()
|
||||||
|
# # self.label_temperature_water_attenation.setText("Temperature:")
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature.addWidget(self.label_temperature_water_attenation)
|
||||||
|
#
|
||||||
|
# # self.lineEdit_temperature_water_attenuation = QLineEdit()
|
||||||
|
# self.spinbox_temperature_water_attenuation = QSpinBox()
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature.addWidget(self.spinbox_temperature_water_attenuation)
|
||||||
|
#
|
||||||
|
# self.label_degre_celsius = QLabel()
|
||||||
|
# self.label_degre_celsius.setText("°C")
|
||||||
|
# self.horizontalLayout_waterAttenuationModel_temperature.addWidget(self.label_degre_celsius)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_comboboxFrequencies_WaterAttenuationValue = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_water_attenuation.addLayout(
|
||||||
|
# self.horizontalLayout_comboboxFrequencies_WaterAttenuationValue)
|
||||||
|
#
|
||||||
|
# self.combobox_water_attenuation = QComboBox()
|
||||||
|
# self.combobox_water_attenuation.addItem('0.3 MHz')
|
||||||
|
# self.combobox_water_attenuation.addItem('0.5 MHz')
|
||||||
|
# self.combobox_water_attenuation.addItem('1 MHz')
|
||||||
|
# self.combobox_water_attenuation.addItem('5 MHz')
|
||||||
|
# # self.combobox_water_attenuation.currentIndexChanged.connect(self.alpha_value_changed)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_comboboxFrequencies_WaterAttenuationValue.addWidget(self.combobox_water_attenuation)
|
||||||
|
#
|
||||||
|
# self.label_water_attenuation = QLabel()
|
||||||
|
# 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")
|
||||||
|
# self.verticalLayout_groupbox_fit_regression = QVBoxLayout(self.groupbox_fit_regression_line)
|
||||||
|
#
|
||||||
|
# self.label_alphaS_expression = QLabel()
|
||||||
|
# # self.label_alphaS_expression.setText("For homogeneous suspension: dFCB/dr = -2\u03B1<sub>s<\sub>")
|
||||||
|
# self.verticalLayout_groupbox_fit_regression.addWidget(self.label_alphaS_expression)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_alphaS_computation = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_fit_regression.addLayout(self.horizontalLayout_alphaS_computation)
|
||||||
|
#
|
||||||
|
# self.combobox_frequency_compute_alphaS = QComboBox()
|
||||||
|
# self.combobox_frequency_compute_alphaS.addItem("0.3 MHz")
|
||||||
|
# self.combobox_frequency_compute_alphaS.addItem("0.5 MHz")
|
||||||
|
# self.combobox_frequency_compute_alphaS.addItem("1 MHz")
|
||||||
|
# self.combobox_frequency_compute_alphaS.addItem("5 MHz")
|
||||||
|
# self.combobox_frequency_compute_alphaS.addItem("All frequencies")
|
||||||
|
# self.horizontalLayout_alphaS_computation.addWidget(self.combobox_frequency_compute_alphaS)
|
||||||
|
#
|
||||||
|
# self.label_alphaS_computation_from = QLabel()
|
||||||
|
# # self.label_alphaS_computation_from.setText("From")
|
||||||
|
# self.horizontalLayout_alphaS_computation.addWidget(self.label_alphaS_computation_from)
|
||||||
|
#
|
||||||
|
# # self.lineEdit_alphaS_computation_from = QLineEdit()
|
||||||
|
# self.spinbox_alphaS_computation_from = QDoubleSpinBox()
|
||||||
|
# self.spinbox_alphaS_computation_from.setRange(0, 9999)
|
||||||
|
# self.horizontalLayout_alphaS_computation.addWidget(self.spinbox_alphaS_computation_from)
|
||||||
|
#
|
||||||
|
# self.label_alphaS_computation_to = QLabel()
|
||||||
|
# # self.label_alphaS_computation_to.setText("to")
|
||||||
|
# self.horizontalLayout_alphaS_computation.addWidget(self.label_alphaS_computation_to)
|
||||||
|
#
|
||||||
|
# # self.lineEdit_alphaS_computation_to = QLineEdit()
|
||||||
|
# self.spinbox_alphaS_computation_to = QDoubleSpinBox()
|
||||||
|
# self.horizontalLayout_alphaS_computation.addWidget(self.spinbox_alphaS_computation_to)
|
||||||
|
#
|
||||||
|
# self.horizontalLayout_fitButton_alphaWvalue = QHBoxLayout()
|
||||||
|
# self.verticalLayout_groupbox_fit_regression.addLayout(self.horizontalLayout_fitButton_alphaWvalue)
|
||||||
|
#
|
||||||
|
# self.pushbutton_fit_regression_line = QPushButton()
|
||||||
|
# self.pushbutton_fit_regression_line.setText("Fit && Compute \u03B1s")
|
||||||
|
# self.horizontalLayout_fitButton_alphaWvalue.addWidget(self.pushbutton_fit_regression_line)
|
||||||
|
#
|
||||||
|
# self.label_alphaS = QLabel()
|
||||||
|
# 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 ----------
|
||||||
|
#
|
||||||
|
# # 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')
|
||||||
|
# self.canvas_profile = FigureCanvas(self.figure_profile)
|
||||||
|
# # self.toolbar_profile =import NavigationToolBar(self.canvas_profile, self)
|
||||||
|
# # self.addToolBar(Qt.RightToolBarArea, self.toolbar_profile)
|
||||||
|
# # self.linear(self.figure_profile, self.axis_profile)
|
||||||
|
# for i in range(4):
|
||||||
|
# self.axis_profile[i].plot(self.model.BS_raw_cross_section.V[:, i, 0], self.model.r, c='k')
|
||||||
|
# # self.axis_profile.plot(self.data_test_slider[0, :], self.data_test_slider[0, :])
|
||||||
|
#
|
||||||
|
# self.toolbar_post_processing_tab = NavigationToolBar(self.canvas_profile, self)
|
||||||
|
# # self.addToolBar(Qt.RightToolBarArea, self.toolbar_post_processing_tab)
|
||||||
|
#
|
||||||
|
# # self.label_icon = QLabel()
|
||||||
|
# # self.label_icon.setPixmap(QPixmap("../icons/smiley1.jpg"))
|
||||||
|
#
|
||||||
|
# # self.verticalLayout_plotprofiles.addWidget(self.toolbar_profile)
|
||||||
|
# self.verticalLayout_plotprofiles.addWidget(self.canvas_profile)
|
||||||
|
# # self.verticalLayout_plotprofiles.addLayout(self.horizontalLayout_slider_plotprofil)
|
||||||
|
#
|
||||||
|
# # # self.verticalLayout_plotprofiles.addWidget(self.label_icon)
|
||||||
|
# # self.verticalLayout_plotprofiles.addWidget(self.slider_plotprofile)
|
||||||
|
#
|
||||||
|
# # self.slider_plotprofile.valueChanged.connect(self.changePlot)
|
||||||
|
#
|
||||||
|
# # 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")
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
# # self.toolbar_averagedprofile = NavigationToolBar(self.canvas_averagedprofile, self)
|
||||||
|
# # self.addToolBar(Qt.RightToolBarArea, self.toolbar_averagedprofile)
|
||||||
|
# # self.toolbar_profile = NavigationToolBar(self.canvas_averagedprofile, self)
|
||||||
|
# # self.polynome(self.figure_averagedprofile, self.axis_averagedprofile)
|
||||||
|
# for i in range(4):
|
||||||
|
# self.axis_averagedprofile[i].plot(self.model.BS_averaged_cross_section.V[:, i, 0], self.model.r, c='b')
|
||||||
|
#
|
||||||
|
# self.toolbar_post_processing_tab = NavigationToolBar(self.canvas_averagedprofile, self)
|
||||||
|
#
|
||||||
|
# # self.horizontalLayout_slider_averagedprofile = QHBoxLayout()
|
||||||
|
# #
|
||||||
|
# # self.pushButton_slider_averagedprofile_right = QPushButton()
|
||||||
|
# # self.pushButton_slider_averagedprofile_right.setIcon(icon_triangle_right)
|
||||||
|
# #
|
||||||
|
# # self.pushButton_slider_averagedprofile_left = QPushButton()
|
||||||
|
# # self.pushButton_slider_averagedprofile_left.setIcon(icon_triangle_left)
|
||||||
|
# #
|
||||||
|
# # self.horizontalLayout_slider_averagedprofile.addWidget(self.pushButton_slider_averagedprofile_left)
|
||||||
|
# # self.horizontalLayout_slider_averagedprofile.addWidget(self.pushButton_slider_averagedprofile_right)
|
||||||
|
# #
|
||||||
|
# # self.lineEdit_slider_averaged_profile = QLineEdit()
|
||||||
|
# # self.lineEdit_slider_averaged_profile.setFixedWidth(50)
|
||||||
|
# # self.lineEdit_slider_averaged_profile.setText("1")
|
||||||
|
# # self.horizontalLayout_slider_averagedprofile.addWidget(self.lineEdit_slider_averaged_profile)
|
||||||
|
# #
|
||||||
|
# # self.slider_averagedprofile = QSlider()
|
||||||
|
# # self.slider_averagedprofile.setOrientation(Qt.Horizontal)
|
||||||
|
# # self.slider_averagedprofile.setTickPosition(QSlider.TicksBelow)
|
||||||
|
# # self.slider_averagedprofile.setCursor(Qt.OpenHandCursor)
|
||||||
|
# # self.slider_averagedprofile.setMinimum(0)
|
||||||
|
# # self.slider_averagedprofile.setMaximum(1)
|
||||||
|
# # self.slider_averagedprofile.setTickInterval(1)
|
||||||
|
# # self.slider_averagedprofile.setValue(0)
|
||||||
|
# # # self.slider_plotprofile.valueChanged.connect(self.changePlot)
|
||||||
|
# #
|
||||||
|
# # self.horizontalLayout_slider_averagedprofile.addWidget(self.slider_averagedprofile)
|
||||||
|
#
|
||||||
|
# # self.verticalLayout_averagedprofile.addWidget(self.toolbar_averagedprofile)
|
||||||
|
# self.verticalLayout_averagedprofile.addWidget(self.canvas_averagedprofile)
|
||||||
|
# # self.verticalLayout_averagedprofile.addLayout(self.horizontalLayout_slider_averagedprofile)
|
||||||
|
#
|
||||||
|
# # 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")
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
# self.toolbar_FCBoptions = NavigationToolBar(self.canvas_FCBoptions, self)
|
||||||
|
# # self.addToolBar(Qt.LeftToolBarArea, self.toolbar_FCBoptions)
|
||||||
|
# # self.toolbar_profile = NavigationToolBar(self.canvas_FCBoptions, self)
|
||||||
|
# # self.cubique(self.figure_FCBoptions, self.axis_FCBoptions)
|
||||||
|
# for i in range(4):
|
||||||
|
# self.axis_FCBoptions[i].plot(self.model.FCB[:, i, 0], self.model.r, c='r')
|
||||||
|
#
|
||||||
|
# self.toolbar_post_processing_tab = NavigationToolBar(self.canvas_FCBoptions, self)
|
||||||
|
#
|
||||||
|
# # self.horizontalLayout_slider_FCBoptions = QHBoxLayout()
|
||||||
|
# #
|
||||||
|
# # self.pushButton_slider_FCBoptions_right = QPushButton()
|
||||||
|
# # self.pushButton_slider_FCBoptions_right.setIcon(icon_triangle_right)
|
||||||
|
# #
|
||||||
|
# # self.pushButton_slider_FCBoptions_left = QPushButton()
|
||||||
|
# # self.pushButton_slider_FCBoptions_left.setIcon(icon_triangle_left)
|
||||||
|
# #
|
||||||
|
# # self.horizontalLayout_slider_FCBoptions.addWidget(self.pushButton_slider_FCBoptions_left)
|
||||||
|
# # self.horizontalLayout_slider_FCBoptions.addWidget(self.pushButton_slider_FCBoptions_right)
|
||||||
|
# #
|
||||||
|
# # self.lineEdit_slider_FCBplot = QLineEdit()
|
||||||
|
# # self.lineEdit_slider_FCBplot.setFixedWidth(50)
|
||||||
|
# # self.lineEdit_slider_FCBplot.setText("1")
|
||||||
|
# # self.horizontalLayout_slider_FCBoptions.addWidget(self.lineEdit_slider_FCBplot)
|
||||||
|
# #
|
||||||
|
# # self.slider_FCBoptions = QSlider()
|
||||||
|
# # self.slider_FCBoptions.setOrientation(Qt.Horizontal)
|
||||||
|
# # self.slider_FCBoptions.setTickPosition(QSlider.TicksBelow)
|
||||||
|
# # self.slider_FCBoptions.setCursor(Qt.OpenHandCursor)
|
||||||
|
# # self.slider_FCBoptions.setMinimum(0)
|
||||||
|
# # self.slider_FCBoptions.setMaximum(1)
|
||||||
|
# # self.slider_FCBoptions.setTickInterval(1)
|
||||||
|
# # self.slider_FCBoptions.setValue(0)
|
||||||
|
# # # self.slider_plotprofile.valueChanged.connect(self.changePlot)
|
||||||
|
# #
|
||||||
|
# # self.horizontalLayout_slider_FCBoptions.addWidget(self.slider_FCBoptions)
|
||||||
|
#
|
||||||
|
# # self.verticalLayout_FCBoptions.addWidget(self.toolbar_FCBoptions)
|
||||||
|
# self.verticalLayout_FCBoptions.addWidget(self.canvas_FCBoptions)
|
||||||
|
# # self.verticalLayout_FCBoptions.addLayout(self.horizontalLayout_slider_FCBoptions)
|
||||||
|
#
|
||||||
|
# # 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)
|
||||||
|
#
|
||||||
|
# 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_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.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()
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# # -------------------- Functions for Signal processing Tab --------------------
|
||||||
|
#
|
||||||
|
# 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.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.checkbox_despiked_acoustic_signal.setText(_translate("CONSTANT_STRING", cs.DESPIKING))
|
||||||
|
#
|
||||||
|
# self.groupbox_FCBoption.setTitle(_translate("CONSTANT_STRING", cs.FCB_OPTIONS))
|
||||||
|
#
|
||||||
|
# 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.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))
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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, :])
|
||||||
|
# val_max = np.nanmax(self.model.BS_averaged_cross_section_corr.V[:, 0, :])
|
||||||
|
# # print('val_min=', val_min)
|
||||||
|
# # print('val_max=', val_max)
|
||||||
|
# if val_min == 0:
|
||||||
|
# val_min = 1e-5
|
||||||
|
# # print('val_min update=', val_min)
|
||||||
|
# # if val_min == 0:
|
||||||
|
# # val_min = 1e-5
|
||||||
|
# # self.axis_plot_profile_position_on_transect.imshow(np.asarray(np.array(self.model.V[:, 0, :2300], dtype=float)), aspect='auto',
|
||||||
|
# # extent=[0, 2300, self.model.depth[-1][0], self.model.depth[0][0]],
|
||||||
|
# # cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
|
||||||
|
# self.axis_plot_profile_position_on_transect.cla()
|
||||||
|
# # self.figure_plot_profile_position_on_transect.clf()
|
||||||
|
# self.axis_plot_profile_position_on_transect.pcolormesh(self.model.dist_BS_section,
|
||||||
|
# np.flipud(self.model.BS_raw_cross_section.r),
|
||||||
|
# self.model.BS_averaged_cross_section_corr.V[:, 0,
|
||||||
|
# :],
|
||||||
|
# cmap='viridis',
|
||||||
|
# norm=LogNorm(vmin=val_min, vmax=val_max),
|
||||||
|
# shading='gouraud')
|
||||||
|
# self.axis_plot_profile_position_on_transect.plot(self.model.dist_BS_section,
|
||||||
|
# np.max(self.model.r_bottom_cross_section) -
|
||||||
|
# self.model.r_bottom_cross_section +
|
||||||
|
# np.min(self.model.r_bottom_cross_section),
|
||||||
|
# color='k', linewidth=2)
|
||||||
|
# self.axis_plot_profile_position_on_transect.plot(
|
||||||
|
# self.model.dist_BS_section[profile_position] * np.ones(self.model.r_bottom_cross_section.shape[0]),
|
||||||
|
# self.model.r_bottom_cross_section, color='red', linestyle="solid", linewidth=2)
|
||||||
|
# self.axis_plot_profile_position_on_transect.set_xticks([])
|
||||||
|
# self.axis_plot_profile_position_on_transect.set_yticks([])
|
||||||
|
# self.figure_plot_profile_position_on_transect.canvas.draw_idle()
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# def changePlot(self):
|
||||||
|
# value = self.slider_plotprofile.value()
|
||||||
|
#
|
||||||
|
# self.string_profile_number = value
|
||||||
|
# self.label_profile_number.setText("Profile " + str(value) +
|
||||||
|
# " / " + str(self.string_profile_number_max))
|
||||||
|
#
|
||||||
|
# self.plot_transect_bottom_with_profile_position(value)
|
||||||
|
#
|
||||||
|
# self.lineEdit_slider_acoustic_profile.setText(str(value))
|
||||||
|
#
|
||||||
|
# for i in range(4):
|
||||||
|
# self.axis_profile[i].cla()
|
||||||
|
# self.axis_profile[i].plot(self.model.BS_raw_cross_section.V[:, i, value-1], self.model.r, c='k')
|
||||||
|
#
|
||||||
|
# self.axis_averagedprofile[i].cla()
|
||||||
|
# self.axis_averagedprofile[i].plot(self.model.BS_averaged_cross_section.V[:, i, value-1], self.model.r, c='b')
|
||||||
|
#
|
||||||
|
# self.axis_FCBoptions[i].cla()
|
||||||
|
# self.axis_FCBoptions[i].plot(self.model.FCB[:, i, value-1], self.model.r, c='r')
|
||||||
|
# # self.axis_profile.plot(self.data_test_slider[0, :], self.data_test_slider[value-1, :])
|
||||||
|
#
|
||||||
|
# self.figure_profile.canvas.draw_idle()
|
||||||
|
# # self.figure_profile.canvas.flush_events()
|
||||||
|
# self.figure_averagedprofile.canvas.draw_idle()
|
||||||
|
# # 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], '*-')
|
||||||
|
# # figure.tight_layout()
|
||||||
|
# for i in range(4):
|
||||||
|
# axis[i].plot(self.model.BS_raw_cross_section.V[:, i, 800], self.model.r, c='k')
|
||||||
|
#
|
||||||
|
# def polynome(self, figure, axis):
|
||||||
|
# # for i in range(4):
|
||||||
|
# # axis[i].plot([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100], '*-')
|
||||||
|
# # figure.tight_layout()
|
||||||
|
# for i in range(4):
|
||||||
|
# axis[i].plot(self.model.BS_averaged_cross_section.V[:, i, 800], self.model.r, c='b')
|
||||||
|
#
|
||||||
|
# def cubique(self, figure, axis):
|
||||||
|
# # for i in range(4):
|
||||||
|
# # axis[i].plot([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000], '*-')
|
||||||
|
# # figure.tight_layout()
|
||||||
|
# for i in range(4):
|
||||||
|
# axis[i].plot(self.model.FCB[:, i, 800], self.model.r, c='r')
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
|
||||||
|
from PyQt5.QtGui import QFont, QPixmap
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
class UserManualTab(QWidget):
|
||||||
|
|
||||||
|
def __init__(self, widget_tab):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.verticalLayout_main = QVBoxLayout(widget_tab)
|
||||||
|
|
||||||
|
self.label_title = QLabel(self, alignment=Qt.AlignHCenter | Qt.AlignTop)
|
||||||
|
self.label_title.setText("User Manual")
|
||||||
|
self.label_title.setFont(QFont("Times", 30, weight=QFont.Bold))
|
||||||
|
self.verticalLayout_main.addWidget(self.label_title)
|
||||||
|
|
||||||
|
# pic = QPixmap("./View/acoustic_inversion_theory.png")
|
||||||
|
# self.label_picture_theory = QLabel()
|
||||||
|
# self.label_picture_theory.setPixmap(pic)
|
||||||
|
# print(pic.width())
|
||||||
|
# # self.label_picture_theory.setScaledContents(True)
|
||||||
|
# self.label_picture_theory.resize(np.int(pic.width()/100), np.int(pic.height()/100))
|
||||||
|
# self.verticalLayout_main.addWidget(self.label_picture_theory)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue