Compare commits

...

7 Commits

8 changed files with 522 additions and 510 deletions

View File

@ -32,7 +32,7 @@ from PyQt5.QtWidgets import QFileDialog, QApplication, QMessageBox
import settings as stg
from settings import ABS_name
logger = logging.getLogger()
logger = logging.getLogger("acoused")
class CreateTableForSaveAs:

View File

@ -34,7 +34,7 @@ from settings import BS_raw_data, acoustic_data
from View.acoustic_data_tab import AcousticDataTab
logger = logging.getLogger()
logger = logging.getLogger("acoused")
class ReadTableForOpen:

View File

@ -64,7 +64,7 @@ locale.setlocale(locale.LC_ALL, '')
_translate = QCoreApplication.translate
logger = logging.getLogger()
logger = logging.getLogger("acoused")
class AcousticDataTab(QWidget):
COMPTEUR = 1

View File

@ -50,7 +50,7 @@ import settings as stg
_translate = QCoreApplication.translate
logger = logging.getLogger()
logger = logging.getLogger("acoused")
class SampleDataTab(QWidget):

View File

@ -48,7 +48,7 @@ import settings as stg
from View.checkable_combobox import CheckableComboBox
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
logger = logging.getLogger()
logger = logging.getLogger("acoused")
class SedimentCalibrationTab(QWidget):
@ -2762,4 +2762,3 @@ class SedimentCalibrationTab(QWidget):
self.lineEdit_slider_FCB.setText(
str(stg.time[self.combobox_acoustic_data_choice.currentIndex()][
self.combobox_frequency_FCB.currentIndex(), self.slider_FCB.value()-1]))

File diff suppressed because it is too large Load Diff

View File

@ -28,13 +28,13 @@ PERCENT_SCREEN_SIZE = 0.85
_translate = QCoreApplication.translate
logging.basicConfig(
level=logging.DEBUG,
level=logging.INFO,
format=('[AcouSed][%(levelname)s] %(message)s')
)
logger = logging.getLogger()
# logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
logger = logging.getLogger("acoused")
logger.setLevel(logging.DEBUG)
#logger.setLevel(logging.INFO)
class MainApplication(QMainWindow):

45
tools.py Normal file
View File

@ -0,0 +1,45 @@
import os
import time
import logging
import traceback
from datetime import datetime, timedelta
from pathlib import Path
from functools import wraps
###########
# LOGGING #
###########
logger = logging.getLogger("acoused")
#########
# WRAPS #
#########
def trace(func):
@wraps(func)
def wrapper(*args, **kwargs):
t = time.time()
head = f"[TRACE]"
logger.debug(
f"{head} Call {func.__module__}." +
f"{func.__qualname__}({args}, {kwargs})"
)
value = func(*args, **kwargs)
t1 = time.time()
logger.debug(
f"{head} Return {func.__module__}." +
f"{func.__qualname__}: {value}"
)
logger.debug(
f"{head}[TIME] {func.__module__}." +
f"{func.__qualname__}: {t1-t} sec"
)
return value
return wrapper