feat: add hostname+user to gui logs
Build and Publish / test (pull_request) Successful in 2m16s
Build and Publish / test (pull_request_target) Successful in 2m7s
Build and Publish / build (pull_request) Successful in 19s
Build and Publish / test (push) Successful in 2m28s
Build and Publish / build (pull_request_target) Successful in 19s
Build and Publish / Build and Deploy Docs (pull_request) Successful in 38s
Build and Publish / build (push) Successful in 18s
Build and Publish / Build and Deploy Docs (pull_request_target) Successful in 33s
Build and Publish / Build and Deploy Docs (push) Successful in 33s

This commit was merged in pull request #91.
This commit is contained in:
2026-07-06 16:27:08 +02:00
parent 99326614ae
commit 3ec2bc011b
26 changed files with 79 additions and 25 deletions
+9
View File
@@ -0,0 +1,9 @@
[
{
"label": "Python Active File",
"adapter": "Debugpy",
"program": "$ZED_FILE",
"request": "launch",
"justMyCode": false,
},
]
+3 -1
View File
@@ -6,7 +6,9 @@ from aarecommon.config.logger import setup_logger
from aarecommon.models.auth import get_user
from aarecommon.models.models import TokenData
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
def auth(base_url: str | None, cert_path: str | None) -> str:
+10
View File
@@ -0,0 +1,10 @@
import getpass
import socket
def _try_clean_hostname(raw_name: str) -> str:
return raw_name.removesuffix(".psi.ch")
CLEAN_HOSTNAME = _try_clean_hostname(socket.gethostname())
LOGGER_NAME = f"AareGUI: {CLEAN_HOSTNAME} - {getpass.getuser()}"
+2 -1
View File
@@ -10,10 +10,11 @@ from PySide6.QtCore import QCommandLineOption, QCommandLineParser
from PySide6.QtWidgets import QApplication, QMessageBox
from aare.gui.auth import auth
from aare.gui.constants import LOGGER_NAME
from aare.gui.main_window import MainWindow
from aare.gui.widgets.splash_screen import LoadingSplashScreen
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
def main():
+3 -1
View File
@@ -27,6 +27,8 @@ from PySide6.QtWidgets import (
QWidget,
)
from aare.gui.constants import LOGGER_NAME
# Gui Models
from aare.gui.models.gui_state_manager import UIStateManager
from aare.gui.panels.automation_panel import AutomationProgressWidget
@@ -84,7 +86,7 @@ from aare.gui.widgets.no_wheel_scroll_area import NoWheelScrollArea
from aare.gui.widgets.status_bar import StatusBar
from aare.gui.widgets.video_image import VideoGraphicsView
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class MainWindow(QMainWindow):
+3 -1
View File
@@ -9,7 +9,9 @@ from aarecommon.models.automation import AutomationProgress, StepStatus, Workflo
from PySide6.QtCore import QTimer, Slot
from PySide6.QtWidgets import QLabel, QVBoxLayout, QWidget
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class AutomationProgressWidget(QWidget):
+2 -1
View File
@@ -5,10 +5,11 @@ from matplotlib.figure import Figure
from PySide6.QtCore import Signal
from PySide6.QtWidgets import QGridLayout, QLabel, QPushButton, QVBoxLayout, QWidget
from aare.gui.constants import LOGGER_NAME
from aare.gui.widgets.number_line_edit import NumberLineEdit
from aare.gui.widgets.title_label import TitleLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class FaceDetectionPanel(QWidget):
+3 -1
View File
@@ -6,7 +6,9 @@ from PySide6.QtCore import QEvent, QPointF, Qt, Slot
from PySide6.QtGui import QColor, QPainter, QPen
from PySide6.QtWidgets import QGraphicsSimpleTextItem, QGridLayout, QLabel, QWidget
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class FluorescencePanel(QWidget):
+2 -1
View File
@@ -25,13 +25,14 @@ from PySide6.QtWidgets import (
QWidget,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.panels.beamline_recovery_panel import RecoveryPanel
from aare.gui.threads.daq_worker import DAQWorker
from aare.gui.widgets.local_contact_status_widget import LocalContactStatusWidget
from aare.gui.widgets.text_list_dialog import TextListDialog
from aare.gui.widgets.title_label import TitleLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class LocalContactPanel(QFrame):
+3 -2
View File
@@ -1,6 +1,5 @@
from __future__ import annotations
from aarecommon.config.logger import setup_logger
from aarecommon.models.automation import AutomationProgress, StepStatus, WorkflowStateKind
from PySide6.QtCore import QPointF, QRectF, Qt, QTimer, Signal, Slot
@@ -18,7 +17,9 @@ from PySide6.QtWidgets import (
QWidget,
)
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
# ---------------------------------------------------------------------------
# Colour palette (kept identical to gui_designer.py)
@@ -40,7 +40,9 @@ from PySide6.QtWidgets import (
QWidget,
)
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
# ─────────────────────────────────────────────────────────────────────────────
@@ -12,12 +12,13 @@ from PySide6.QtWidgets import (
QSpacerItem,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.panels.scan_settings_panel import ScanSettingsPanel
from aare.gui.scan_logic.raster_grid_manager import RasterGridManager, RasterGridMetric
from aare.gui.widgets.number_line_edit import DbOverrideLineEdit
from aare.gui.widgets.raster_grid_table import RasterGridTable
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
# TODO prevent raster if no grid, or at least rpevent smargon from doing danngerous move to 0,0,0!!!
+2 -1
View File
@@ -16,9 +16,10 @@ from PySide6.QtWidgets import (
QTableView,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.widgets.title_label import TitleLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
def get_entry(sample: SampleShortInfo, column: int):
@@ -7,10 +7,11 @@ from aarecommon.models.rotation_scan import RotationScanRequest
from PySide6.QtCore import Qt, Signal, Slot
from PySide6.QtWidgets import QComboBox, QLabel, QMessageBox, QPushButton
from aare.gui.constants import LOGGER_NAME
from aare.gui.panels.scan_settings_panel import ScanSettingsPanel
from aare.gui.widgets.number_line_edit import DbOverrideLineEdit, NumberLineEdit
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
def add_screening_to_path(path):
+2 -1
View File
@@ -20,11 +20,12 @@ from PySide6.QtWidgets import (
QVBoxLayout,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.models.sample_queue_model import SampleQueueSpreadsheet
from aare.gui.widgets.message_box import LOW_CURRENT_THRESHOLD, conditions_auto_check
from aare.gui.widgets.title_label import TitleLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class SampleQueuePanel(QFrame):
+2 -1
View File
@@ -13,10 +13,11 @@ from PySide6.QtWidgets import (
QWidget,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.widgets.message_box import precondition_check
from aare.gui.widgets.number_line_edit import DbOverrideLineEdit
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class ScanSettingsPanel(QWidget):
+2 -1
View File
@@ -6,10 +6,11 @@ from aarecommon.models.rotation_scan import RotationScanRequest
from PySide6.QtCore import Qt, Signal, Slot
from PySide6.QtWidgets import QGridLayout, QLabel, QPushButton, QSizePolicy, QSpacerItem, QWidget
from aare.gui.constants import LOGGER_NAME
from aare.gui.panels.rotation_data_collection import add_data_to_path
from aare.gui.widgets.number_line_edit import NumberLineEdit
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class SimpleRotationSettingsPanel(QWidget):
@@ -22,7 +22,9 @@ from PySide6.QtWidgets import (
QWidget,
)
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class InteractiveChartView(QChartView):
+2 -1
View File
@@ -17,10 +17,11 @@ from PySide6.QtWidgets import (
QTableView,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.models.user_sample_model import UserSampleSpreadsheet
from aare.gui.widgets.title_label import TitleLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class TellSamplePanel(QFrame):
@@ -17,7 +17,9 @@ from aarecommon.models.raster_grid import (
from PySide6.QtCore import QLineF, QObject, QPointF, QRect, QRectF, Qt, Signal, Slot
from PySide6.QtGui import QBrush, QColor, QImage, QPainter, QPen
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class RasterGridMetric(Enum):
+3 -1
View File
@@ -50,7 +50,9 @@ from jfjoch_client import ScanResult, ScanResultImagesInner
from PySide6.QtCore import QByteArray, QObject, QTimer, QUrl, Signal, Slot
from PySide6.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetworkRequest, QSslError
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
SPREADHSEET_FREQUENCY = 25 # Every 5 seconds
@@ -10,7 +10,9 @@ from aarecommon.models.models import DAQStatusModel
from PySide6.QtCore import QThread, Signal, Slot
from PySide6.QtGui import QImage, QPixmap
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class PredictionSubscriber(QThread):
+3 -1
View File
@@ -3,7 +3,9 @@ from PySide6.QtCore import Qt, QTimer, Slot
from PySide6.QtGui import QColor
from PySide6.QtWidgets import QFrame, QGraphicsDropShadowEffect, QHBoxLayout, QLabel, QSizePolicy
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
class AlertBanner(QFrame):
+2 -1
View File
@@ -37,11 +37,12 @@ from PySide6.QtWidgets import (
QToolTip,
)
from aare.gui.constants import LOGGER_NAME
from aare.gui.models.bookmark import SmargonBookmarkList
from aare.gui.scan_logic.raster_grid_manager import RasterGridManager
from aare.gui.widgets.busy_overlay import BusyOverlayStyle, build_busy_overlay_style
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class SampleCameraImageState(Enum):
+3 -1
View File
@@ -4,7 +4,9 @@ from aarecommon.config.logger import setup_logger
from PySide6.QtCore import QEventLoop, QTimer
from PySide6.QtWidgets import QCheckBox, QMessageBox
logger = setup_logger("aareGUI")
from aare.gui.constants import LOGGER_NAME
logger = setup_logger(LOGGER_NAME)
LOW_CURRENT_THRESHOLD = 100.0
SNOOZE_SECONDS = 3600.0 # "Don't ask again for 1 hour"
+2 -1
View File
@@ -7,12 +7,13 @@ from PySide6.QtCore import QPoint, QTimer, Signal, Slot
from PySide6.QtGui import QFont
from PySide6.QtWidgets import QDialog, QLabel, QMenu, QMessageBox, QSizePolicy, QStatusBar
from aare.gui.constants import LOGGER_NAME
from aare.gui.widgets.baton_request_dialog import BatonRequestDialog
from aare.gui.widgets.clickable_label import ClickableLabel
from aare.gui.widgets.pgroup_dialog import PGroupDialog
from aare.gui.widgets.value_label import ValueLabel
logger = setup_logger("aareGUI")
logger = setup_logger(LOGGER_NAME)
class StatusBar(QStatusBar):