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

This commit is contained in:
2025-11-24 13:40:15 +01:00
parent 1aec75d5ad
commit cbd6bb984e
2 changed files with 141 additions and 11 deletions

View File

@@ -27,14 +27,62 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/**
* @file PGetParameterBlockDialog.h
* @brief Dialog for creating FITPARAMETER blocks in msr files.
* @details This header defines the PGetParameterBlockDialog class which provides
* a dialog for entering fit parameters needed to create a FITPARAMETER block
* in a musrfit msr file. The dialog supports parameter entry with validation
* and optional boundary constraints.
*
* @author Andreas Suter
* @date 2009-2025
* @copyright Copyright (C) 2009-2025 by Andreas Suter
* @license GNU General Public License v2 or later
*
* @see PGetFunctionsBlockDialog For creating FUNCTIONS blocks using these parameters
* @see PGetTheoryBlockDialog For creating THEORY blocks
*/
#ifndef _PGETPARAMETERBLOCKDIALOG_H_
#define _PGETPARAMETERBLOCKDIALOG_H_
#include "ui_PGetParameterBlockDialog.h"
//-----------------------------------------------------------------------------------
//---------------------------------------------------------------------------
/**
* <p>Handles the content of the PARAMETER block dialog.
* @class PGetParameterBlockDialog
* @brief Dialog for creating FITPARAMETER blocks in msr files.
*
* @details This dialog allows users to define fit parameters for musrfit.
* Each parameter consists of a number, name, initial value, step size, and
* optional lower/upper boundaries. Parameters are formatted with proper
* column alignment for the msr file format.
*
* @par Parameter Fields:
* - **No**: Parameter number (auto-incremented)
* - **Name**: Parameter name (required, max ~12 chars for alignment)
* - **Value**: Initial parameter value (required)
* - **Step**: Initial step size for minimizer (required)
* - **Lower**: Lower boundary ("none" or numeric value)
* - **Upper**: Upper boundary ("none" or numeric value)
*
* @par Generated Output Format:
* The dialog generates properly formatted FITPARAMETER lines:
* @code
* FITPARAMETER
* 1 alpha 1.0 0.01 none
* 2 beta 0.5 0.001 none 0.0 1.0
* 3 frequency 10.5 0.1 none
* @endcode
*
* @par User Interaction:
* - Press Return/Enter key to quickly add parameters
* - Parameter number auto-increments after each addition
* - Input fields are reset after adding a parameter
* - Focus returns to the Name field for rapid entry
*
* @see PGetFunctionsBlockDialog For defining functions using these parameters
*/
class PGetParameterBlockDialog : public QDialog, private Ui::PGetParameterBlockDialog
{
@@ -43,17 +91,37 @@ class PGetParameterBlockDialog : public QDialog, private Ui::PGetParameterBlockD
public:
PGetParameterBlockDialog(const QString helpUrl);
/**
* @brief Returns all entered parameters as formatted text.
* @return Complete FITPARAMETER block content ready for insertion
* into an msr file.
*/
QString getParams() { return fParam_plainTextEdit->toPlainText(); }
protected:
/**
* @brief Event filter to handle keyboard shortcuts.
* @details Intercepts the Return key to trigger parameter addition,
* allowing for rapid parameter entry without clicking the Add button.
* @param obj The object that generated the event.
* @param ev The event to be filtered.
* @return true if the event was handled (Return key), false otherwise.
*/
bool eventFilter( QObject *obj, QEvent *ev );
private slots:
/**
* @brief Validates and adds a parameter to the FITPARAMETER block.
*/
void paramAdd();
/**
* @brief Opens the online help for FITPARAMETER blocks.
*/
void helpContent();
private:
QString fHelpUrl; ///< help url of the PARAMETER block description.
QString fHelpUrl; ///< URL to the online documentation for FITPARAMETER blocks.
};
#endif // _PGETPARAMETERBLOCKDIALOG_H_