From 94b3f1ac5a55b12c11ef194092d852e1510b6419 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Mon, 24 Nov 2025 10:24:36 +0100 Subject: [PATCH] improve the doxygen docu of main.cpp and musredit.h (musredit_qt6). --- src/musredit_qt6/musredit/main.cpp | 45 ++++++++++-- src/musredit_qt6/musredit/musredit.h | 104 ++++++++++++++++++--------- 2 files changed, 112 insertions(+), 37 deletions(-) diff --git a/src/musredit_qt6/musredit/main.cpp b/src/musredit_qt6/musredit/main.cpp index 09c6bf45d..ac2a331c9 100644 --- a/src/musredit_qt6/musredit/main.cpp +++ b/src/musredit_qt6/musredit/main.cpp @@ -27,6 +27,18 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +/** + * @file main.cpp + * @brief Entry point for the musredit application. + * @details This file contains the main() function which initializes the Qt + * application and creates the main editor window for musredit. + * + * @author Andreas Suter + * @date 2010-2025 + * @copyright Copyright (C) 2010-2025 by Andreas Suter + * @license GNU General Public License v2 or later + */ + #include #include @@ -39,11 +51,36 @@ #include "PFitOutputHandler.h" /** - *

musredit is a simple editor based interface to the musrfit programs. It is based on Qt 4.6 - * of Digia (http://qt.digia.com and http://qt-project.org/). + * @brief Main entry point for the musredit application. * - *

musredit is free software liensenced under GPL 2 or later (for detail license informations see - * http://www.gnu.org/licenses). + * @details musredit is a simple editor-based interface to the musrfit programs, + * providing a graphical environment for creating, editing, and managing + * muon spin rotation (μSR) fit parameter files. + * + * The application is built using the Qt framework and provides the following features: + * - Multi-document editing of msr (muon spin rotation) parameter files + * - Syntax highlighting for msr file format + * - Integration with musrfit analysis tools (musrfit, musrview, msr2data, etc.) + * - Recent file tracking and session management + * + * @par Command Line Options: + * - No arguments: Launch the editor with an empty document + * - \: Open the specified msr file(s) for editing + * - \c -h, \c --help: Display usage information and exit + * - \c -v, \c --version: Display version/git revision information and exit + * + * @par License: + * musredit is free software licensed under GPL v2 or later. + * See http://www.gnu.org/licenses for details. + * + * @param argc Number of command-line arguments + * @param argv Array of command-line argument strings + * + * @return 0 on successful execution or when displaying help/version, + * or the Qt application exit code from QApplication::exec() + * + * @see PTextEdit The main editor window class + * @see https://qt.io Qt framework documentation */ int main( int argc, char ** argv ) { diff --git a/src/musredit_qt6/musredit/musredit.h b/src/musredit_qt6/musredit/musredit.h index 01861c247..377a5e408 100644 --- a/src/musredit_qt6/musredit/musredit.h +++ b/src/musredit_qt6/musredit/musredit.h @@ -27,56 +27,94 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +/** + * @file musredit.h + * @brief Common definitions and data structures for the musredit application. + * @details This header file contains shared constants, data structures, and type + * definitions used throughout the musredit application. It defines structures + * for msr2data parameter handling and find/replace operations. + * + * @author Andreas Suter + * @date 2010-2025 + * @copyright Copyright (C) 2010-2025 by Andreas Suter + * @license GNU General Public License v2 or later + */ + #ifndef _MUSREDIT_H_ #define _MUSREDIT_H_ #include +/** + * @def MAX_RECENT_FILES + * @brief Maximum number of recently opened files to track. + * @details This constant defines the maximum number of entries in the + * "Recent Files" menu. When this limit is exceeded, the oldest entry + * is removed to make room for new entries. + */ #define MAX_RECENT_FILES 5 //------------------------------------------------------------------------------------------------- /** - *

This structure is used in conjunction to msr2data. It stores the necessary - * parameters to handle msr2data. For a detailed description of the meaning of these - * parameters see msr2data --help and the online documentation. + * @struct PMsr2DataParam + * @brief Parameter structure for msr2data tool integration. + * + * @details This structure holds all the configuration parameters needed to invoke + * the msr2data tool from within musredit. The msr2data tool is used to: + * - Generate msr files from templates for multiple runs + * - Perform batch fitting operations + * - Export fit parameters to database (db) files or column-formatted ASCII files + * + * For a detailed description of these parameters, see the msr2data documentation + * (\c msr2data \c --help) and the online musrfit user manual. + * + * @see https://lmu.web.psi.ch/musrfit/user/html/user-manual.html#msr2data msr2data documentation */ struct PMsr2DataParam { - QString runList; ///< list of run numbers (usage 3 of msr2data) - QString runListFileName; ///< run list filename (usage 4 of msr2data) - QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13' - int templateRunNo; ///< fit template run number - QString paramList; ///< parameter list to be exported. - QString dbOutputFileName; ///< output file name for the generated (trumf-like) db-file. - bool writeDbHeader; ///< flag indicating if a db header shall be generated (== !noheader in msr2data) - bool ignoreDataHeaderInfo; ///< flag indicating if data header info (like temp.) shall be ignored (== nosummary in msr2data) - bool keepMinuit2Output; ///< flag indicating if the minuit2 output shall be kept ('-k' in msr2data) - bool writeColumnData; ///< flag indicating if instead of a db-file a column data ascii file shall be written ('data' in msr2data) - bool recreateDbFile; ///< flag: true = recreate db-file, false = append to present db-file - bool chainFit; ///< flag: true = chain fit, i.e. the template for a fit is the preceeding run. false = the template is always the source for the new msr-file - bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit. - bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data) - bool estimateN0; ///< flag indicating if the N0 shall be estimated for single histogram fitting - bool yamlOut; ///< flag indicating if the MINUIT2.OUTPUT content should be written to .yaml - bool perRunBlockChisq; ///< flag indicating if per-run-block-chisq shall be dumped into the msr-file - bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-