Main window

The MainWindow hosts the panels and docks listed in GUI components. Its surface is large enough to keep on a page of its own, within the documentation’s page-size budget.

class asymmetry.gui.mainwindow.MainWindow(parent=None)[source]

Bases: QMainWindow

Top-level application window for the Asymmetry μSR analysis GUI.

Orchestrates all panels (data browser, plot, fit, Fourier, log) and manages the central data flow between them. Also owns project-file save/load and the recent-projects list stored in PySide6.QtCore.QSettings.

Project files (.asymp)

The collect_project_state / restore_project_state pair serialises and deserialises the full application state as a versioned JSON file. Source data files are referenced rather than embedded, so each relevant data file must remain accessible at its original path (or at the same relative path from the .asymp file) for the project to reopen cleanly. Missing files are skipped with a WARNING log entry; the rest of the session restores normally.

Saved state includes:

  • List of loaded datasets with source-file paths and field overrides

  • Co-added (combined) dataset group definitions

  • Data browser sort column, active filters, and selected runs

  • Plot panel axis limits and fit-curve overlay

  • Single-fit and global-fit model selection and parameter table contents

  • Fourier panel window, zero-pad factor, and display mode

Previously not saved (now persisted where available):

  • Raw asymmetry / time / error arrays (reloaded from source files)

  • Fit result statistics (χ², uncertainties) — only the fitted parameter values that were written back to the parameter table

  • Fourier transform output (cached spectra are now saved when computed)

dirty_changed

Unsaved-work state changed; lets a hosting ProjectShell mirror the marker on this project’s tab.

__init__(parent=None)[source]
showEvent(event)[source]
set_compact_mode(enabled)[source]

Legacy compatibility shim after compact-mode removal.

eventFilter(obj, event)[source]

Record inspector-dock closes into the per-representation memory.

The dock X button sends a Close event; programmatic hide() does not — so this captures exactly the user closes consumed by _apply_inspector_for_domain.

collect_project_state()[source]

Snapshot current application state with live reference timing requests.

restore_project_state(state, project_path)[source]

Prepare direct input before any mutation, then restore canonical owners.

closeEvent(event)[source]

Stop background work and save plot axis ranges before closing.

staticMetaObject = PySide6.QtCore.QMetaObject("MainWindow" inherits "QMainWindow": Methods:   #39 type=Signal, signature=_background_log(QString), parameters=QString   #40 type=Signal, signature=dirty_changed(bool), parameters=bool )