|
musredit 1.0.0
|
Dialog for creating THEORY blocks in msr files. More...
#include <PGetTheoryBlockDialog.h>


Public Member Functions | |
| PGetTheoryBlockDialog (PAdmin *admin=0, const QString helpUrl="") | |
| Constructs a dialog for creating THEORY blocks. | |
| QString | getTheoryBlock () |
| Returns the complete theory block text. | |
Private Slots | |
| QString | getTheoFuncString () |
| Generates the theory function string for the selected function. | |
| void | addPlus () |
| Adds the selected function followed by a '+' operator. | |
| void | addMultiply () |
| Adds the selected function (multiplication with next line). | |
| void | helpContent () |
| Opens the online help for THEORY blocks. | |
Private Attributes | |
| PAdmin * | fAdmin |
| Pointer to the administration object for accessing theory function definitions. | |
| QString | fHelpUrl |
| URL to the online documentation for THEORY blocks. | |
Dialog for creating THEORY blocks in msr files.
This dialog allows users to build theory function expressions by selecting from a list of available theory functions. Functions can be combined using addition (+) or multiplication (*) operators. The dialog displays LaTeX-rendered equation icons for visual function identification.
Definition at line 91 of file PGetTheoryBlockDialog.h.
| PGetTheoryBlockDialog::PGetTheoryBlockDialog | ( | PAdmin * | admin = 0, |
| const QString | helpUrl = "" ) |
Constructs a dialog for creating THEORY blocks.
Constructor - Initializes the THEORY block dialog.
Initializes the dialog with available theory functions from the administration object. Sets up the combo box with function names and LaTeX equation icons loaded from embedded resources. The dialog is configured as modal to ensure user interaction completion.
| admin | Pointer to the PAdmin object containing theory function definitions loaded from the XML configuration file. If nullptr, the dialog will not function properly. |
| helpUrl | URL string pointing to online documentation for THEORY blocks. If empty, help button will show a placeholder message. |
Sets up the user interface and populates the theory function combo box with all available theory functions from the administration object. Each function is displayed with its label and, if available, a LaTeX-rendered equation icon.
The combo box icon size is set to 250x20 pixels to accommodate LaTeX equation images. Icons are loaded from embedded Qt resources (:/latex_images/) based on the pixmap name specified in each theory function definition.
The dialog is configured as modal, requiring user interaction before returning control to the parent window.
| admin | Pointer to the PAdmin administration object containing theory function definitions loaded from musrfit_startup.xml. Must not be nullptr for proper operation. |
| helpUrl | URL string for the online help documentation. If empty, help button will display a placeholder message instead of opening a web browser. |
Definition at line 84 of file PGetTheoryBlockDialog.cpp.
|
privateslot |
Adds the selected function (multiplication with next line).
Adds the current theory function for multiplication.
Appends the currently selected theory function to the text editor on a new line. In musrfit theory blocks, functions on consecutive lines (without a '+' separator) are multiplied together. This is the default operation for combining functions like asymmetry with relaxation.
Example result in editor:
Represents: A1 * Gss(t)
Retrieves the formatted string for the currently selected theory function and appends it to the theory block text editor on a new line. In musrfit theory block syntax, functions on consecutive lines (without a '+' separator between them) are implicitly multiplied together.
This creates multiplicative terms in the fit model. For example:
Represents: A1 * Gss(t) * cos(ωt + φ)
Definition at line 222 of file PGetTheoryBlockDialog.cpp.
|
privateslot |
Adds the selected function followed by a '+' operator.
Adds the current theory function followed by a '+' operator.
Appends the currently selected theory function to the text editor, followed by a '+' character on a new line. This indicates that the next function should be added (summed) rather than multiplied. In musrfit theory blocks, the '+' operator creates additive terms in the fit function.
Example result in editor:
Retrieves the formatted string for the currently selected theory function and appends it to the theory block text editor, followed by a newline and a '+' character. The '+' indicates that the next function should be added (summed) rather than multiplied with the current function.
This creates additive terms in the fit model. For example:
Represents: A1*Gss(t) + A2*Lor(t)
Definition at line 192 of file PGetTheoryBlockDialog.cpp.
|
privateslot |
Generates the theory function string for the selected function.
Generates the formatted theory function string for the selected function.
Constructs a formatted string for the currently selected theory function from the combo box. The string includes:
Example output: "simpleGss 1 2 (phase frequency)"
Constructs a complete theory function line suitable for insertion into an msr file THEORY block. The format depends on the function type:
For standard functions:
For user-defined functions (userFcn):
The parameter numbers (1, 2, 3, ...) are placeholders that should be replaced with actual FITPARAMETER indices or map references before the msr file is used for fitting.
Definition at line 145 of file PGetTheoryBlockDialog.cpp.
|
inline |
Returns the complete theory block text.
Retrieves all theory function expressions entered by the user through the dialog interface. The returned string is formatted according to musrfit msr file specifications and is ready for direct insertion into the THEORY section of an msr file.
Definition at line 130 of file PGetTheoryBlockDialog.h.
|
privateslot |
Opens the online help for THEORY blocks.
Opens online help documentation for THEORY blocks.
Attempts to open the help URL in the system's default web browser using QDesktopServices. If the URL is empty, displays a placeholder information message. If the browser cannot be opened, shows an error dialog with the URL for manual access.
The help documentation typically covers:
Attempts to open the help URL in the user's default web browser using QDesktopServices::openUrl(). The help typically provides comprehensive documentation on:
Error handling:
Definition at line 250 of file PGetTheoryBlockDialog.cpp.
|
private |
Pointer to the administration object for accessing theory function definitions.
Definition at line 214 of file PGetTheoryBlockDialog.h.
|
private |
URL to the online documentation for THEORY blocks.
Definition at line 215 of file PGetTheoryBlockDialog.h.