improve the doxygen docu of PGetNonMusrRunBlockDialog.* (musredit_qt6).

This commit is contained in:
2025-11-24 13:35:54 +01:00
parent a0d37a4ae5
commit ad9765cccd
2 changed files with 149 additions and 18 deletions

View File

@@ -27,6 +27,19 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/**
* @file PGetNonMusrRunBlockDialog.cpp
* @brief Implementation of the PGetNonMusrRunBlockDialog class.
* @details This file implements the dialog for creating non-muSR type RUN blocks
* in msr files. It handles user input validation and generates properly formatted
* msr-file text for fitting generic x-y data.
*
* @author Andreas Suter
* @date 2009-2025
* @copyright Copyright (C) 2009-2025 by Andreas Suter
* @license GNU General Public License v2 or later
*/
#include <QLineEdit>
#include <QValidator>
#include <QComboBox>
@@ -38,9 +51,18 @@
//----------------------------------------------------------------------------------------------------
/**
* <p>Constructor
* @brief Constructs the non-muSR RUN block dialog.
*
* \param helpUrl help url for the NonMusr run block.
* @details Initializes the dialog UI and sets up input validators for numeric
* fields. The dialog is created as modal. The file format combo box is
* automatically set to "DB" (database format) as the default, which is the
* most common format for non-muSR data.
*
* @par Input Validators:
* - Double validators: fit range start and end values
*
* @param helpUrl URL to the online documentation for non-muSR RUN blocks.
* Defaults to empty string if not provided.
*/
PGetNonMusrRunBlockDialog::PGetNonMusrRunBlockDialog(const QString helpUrl) : fHelpUrl(helpUrl)
{
@@ -65,7 +87,14 @@ PGetNonMusrRunBlockDialog::PGetNonMusrRunBlockDialog(const QString helpUrl) : fH
//----------------------------------------------------------------------------------------------------
/**
* <p>Extracts the run header information from the dialog, and returns it as a string.
* @brief Generates the RUN header line for the non-muSR block.
*
* @details Creates the first line of the RUN block containing the run file name,
* beamline identifier, institute name, and data file format. The beamline is
* converted to uppercase.
*
* @return Formatted RUN header string, e.g.:
* "RUN datafile BEAMLINE PSI DB (name beamline institute data-file-format)\\n"
*/
QString PGetNonMusrRunBlockDialog::getRunHeaderInfo()
{
@@ -81,9 +110,16 @@ QString PGetNonMusrRunBlockDialog::getRunHeaderInfo()
//----------------------------------------------------------------------------------------------------
/**
* <p>Extracts the map from the dialog, and returns it as a string.
* @brief Generates the parameter map line for the non-muSR block.
*
* \param valid flag indicating of the map is potentially being valid.
* @details The map line defines the mapping between theory function parameters
* and the fit parameters defined in the FITPARAMETER block. The method validates
* that the map contains only space-separated integers.
*
* @param[out] valid Set to true if the map contains only digits and spaces,
* false if invalid characters are found.
*
* @return Formatted map string, e.g.: "map 1 2 3\\n"
*/
QString PGetNonMusrRunBlockDialog::getMap(bool &valid)
{
@@ -104,9 +140,17 @@ QString PGetNonMusrRunBlockDialog::getMap(bool &valid)
//----------------------------------------------------------------------------------------------------
/**
* <p>Extracts xy-data from the dialog and returns it as a string.
* @brief Generates the xy-data specification line for the non-muSR block.
*
* \param valid flag showing that x/y-data are present.
* @details Creates the "xy-data" line specifying which columns in the data file
* contain the x (independent variable) and y (dependent variable) values.
* Both columns must be specified for the line to be valid.
*
* @param[out] valid Set to true if both x and y data column numbers are provided,
* false if either is missing.
*
* @return Formatted xy-data string, e.g.: "xy-data 1 2\\n"
* Returns empty string if either x or y data is not specified.
*/
QString PGetNonMusrRunBlockDialog::getXYData(bool &valid)
{
@@ -126,10 +170,17 @@ QString PGetNonMusrRunBlockDialog::getXYData(bool &valid)
//----------------------------------------------------------------------------------------------------
/**
* <p>Extracts the fit-range from the dialog and returns it as a string. If not fit-range was given,
* a fit-range from 0 to 10 us will be returned and the valid flag will be set to false.
* @brief Generates the fit range specification line for the non-muSR block.
*
* \param valid flag showing if a fit-range is given.
* @details Creates the "fit" line specifying the x-value range over which the
* fit will be performed. If no fit range is provided by the user, a default
* range of [0.0, 10.0] is returned.
*
* @param[out] valid Set to true if both fit range values are provided by the user,
* false if using the default range.
*
* @return Formatted fit range string, e.g.: "fit 0.5 99.5\\n"
* Returns default "fit 0.0 10.0\\n" if values are missing.
*/
QString PGetNonMusrRunBlockDialog::getFitRange(bool &valid)
{
@@ -150,7 +201,11 @@ QString PGetNonMusrRunBlockDialog::getFitRange(bool &valid)
//----------------------------------------------------------------------------------------------------
/**
* <p>Generates a help content window showing the description of the NonMusr run block.
* @brief Opens the online help documentation for non-muSR RUN blocks.
*
* @details Attempts to open the help URL in the system's default web browser
* using QDesktopServices. If the URL is empty, displays an informational message.
* If the browser fails to open, displays an error message with a clickable link.
*/
void PGetNonMusrRunBlockDialog::helpContent()
{