Acoustic data: Minor refactoring.
parent
de54303e0b
commit
56a26c04b6
|
|
@ -1,6 +1,6 @@
|
||||||
# ============================================================================== #
|
# ============================================================================== #
|
||||||
# acoustic_data_tab.py - AcouSed #
|
# acoustic_data_tab.py - AcouSed #
|
||||||
# Copyright (C) 2024 INRAE #
|
# Copyright (C) 2024-2025 INRAE #
|
||||||
# #
|
# #
|
||||||
# This program is free software: you can redistribute it and/or modify #
|
# This program is free software: you can redistribute it and/or modify #
|
||||||
# it under the terms of the GNU General Public License as published by #
|
# it under the terms of the GNU General Public License as published by #
|
||||||
|
|
@ -20,6 +20,20 @@
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import locale
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from re import findall
|
||||||
|
from copy import deepcopy
|
||||||
|
from scipy.signal import savgol_filter
|
||||||
|
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from matplotlib.colors import LogNorm, CSS4_COLORS, BoundaryNorm
|
||||||
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
|
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QWidget, QVBoxLayout, QHBoxLayout, QGroupBox,
|
QWidget, QVBoxLayout, QHBoxLayout, QGroupBox,
|
||||||
|
|
@ -34,26 +48,9 @@ from PyQt5.QtCore import (
|
||||||
QPropertyAnimation
|
QPropertyAnimation
|
||||||
)
|
)
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
from matplotlib.colors import LogNorm, CSS4_COLORS, BoundaryNorm
|
|
||||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
|
||||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
|
||||||
|
|
||||||
import os
|
|
||||||
from copy import deepcopy
|
|
||||||
import locale
|
|
||||||
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
|
||||||
|
|
||||||
from scipy.signal import savgol_filter
|
|
||||||
|
|
||||||
from re import findall
|
|
||||||
|
|
||||||
from pyqt_file_list_widget.fileListWidget import FileListWidget
|
from pyqt_file_list_widget.fileListWidget import FileListWidget
|
||||||
|
|
||||||
|
import settings as stg
|
||||||
import Translation.constant_string as cs
|
import Translation.constant_string as cs
|
||||||
|
|
||||||
from Model.TableModel import TableModel
|
from Model.TableModel import TableModel
|
||||||
|
|
@ -61,7 +58,8 @@ from Model.acoustic_data_loader import AcousticDataLoader
|
||||||
from Model.acoustic_data_loader_UBSediFlow import AcousticDataLoaderUBSediFlow
|
from Model.acoustic_data_loader_UBSediFlow import AcousticDataLoaderUBSediFlow
|
||||||
from Model.calibration_constant_kt import CalibrationConstantKt
|
from Model.calibration_constant_kt import CalibrationConstantKt
|
||||||
|
|
||||||
import settings as stg
|
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
|
@ -79,18 +77,8 @@ class AcousticDataTab(QWidget):
|
||||||
def __init__(self, tab_widget):
|
def __init__(self, tab_widget):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.path_icon = "./icons/"
|
self._setup_icons()
|
||||||
self.icon_folder = QIcon(self.path_icon + "folder.png")
|
|
||||||
self.icon_apply_limits = QIcon(self.path_icon + "circle_green_arrow_right.png")
|
|
||||||
self.icon_triangle_left_to_begin = QIcon(self.path_icon + "triangle_left_to_begin.png")
|
|
||||||
self.icon_triangle_left = QIcon(self.path_icon + "triangle_left.png")
|
|
||||||
self.icon_triangle_right = QIcon(self.path_icon + "triangle_right.png")
|
|
||||||
self.icon_triangle_right_to_end = QIcon(self.path_icon + "triangle_right_to_end.png")
|
|
||||||
self.icon_add = QIcon(self.path_icon + "add.png")
|
|
||||||
self.icon_delete = QIcon(self.path_icon + "delete.png")
|
|
||||||
self.icon_clear = QIcon(self.path_icon + "clear.png")
|
|
||||||
self.icon_between = QPixmap(self.path_icon + "between.png")
|
|
||||||
self.icon_refresh = QIcon(self.path_icon + "update.png")
|
|
||||||
self.calib_kt = CalibrationConstantKt()
|
self.calib_kt = CalibrationConstantKt()
|
||||||
|
|
||||||
### --- General layout of widgets ---
|
### --- General layout of widgets ---
|
||||||
|
|
@ -691,6 +679,25 @@ class AcousticDataTab(QWidget):
|
||||||
self.slider.valueChanged.connect(self.update_plot_profile)
|
self.slider.valueChanged.connect(self.update_plot_profile)
|
||||||
self.slider.valueChanged.connect(self.update_plot_backscattered_acoustic_signal_recording)
|
self.slider.valueChanged.connect(self.update_plot_backscattered_acoustic_signal_recording)
|
||||||
|
|
||||||
|
def _setup_icons(self):
|
||||||
|
def path_icon(icon):
|
||||||
|
return os.path.join(
|
||||||
|
"icons", icon
|
||||||
|
)
|
||||||
|
|
||||||
|
self.icon_folder = QIcon(path_icon("folder.png"))
|
||||||
|
self.icon_apply_limits = QIcon(path_icon("circle_green_arrow_right.png"))
|
||||||
|
self.icon_triangle_left_to_begin = QIcon(path_icon("triangle_left_to_begin.png"))
|
||||||
|
self.icon_triangle_left = QIcon(path_icon("triangle_left.png"))
|
||||||
|
self.icon_triangle_right = QIcon(path_icon("triangle_right.png"))
|
||||||
|
self.icon_triangle_right_to_end = QIcon(path_icon("triangle_right_to_end.png"))
|
||||||
|
self.icon_add = QIcon(path_icon("add.png"))
|
||||||
|
self.icon_delete = QIcon(path_icon("delete.png"))
|
||||||
|
self.icon_clear = QIcon(path_icon("clear.png"))
|
||||||
|
self.icon_between = QPixmap(path_icon("between.png"))
|
||||||
|
self.icon_refresh = QIcon(path_icon("update.png"))
|
||||||
|
|
||||||
|
|
||||||
# -------------------- Functions for Acoustic dataTab --------------------
|
# -------------------- Functions for Acoustic dataTab --------------------
|
||||||
|
|
||||||
def retranslate_acoustic_data_tab(self):
|
def retranslate_acoustic_data_tab(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue