|
musredit 1.0.0
|
Central administration class for musredit configuration management. More...
#include <PAdmin.h>


Public Member Functions | |
| PAdmin () | |
| Constructs the PAdmin object and loads configuration. | |
Configuration Getters | |
Methods to retrieve current configuration values. | |
| int | getTimeout () |
| Get musrfit process timeout in seconds. | |
| QString | getFontName () |
| Get editor font family name. | |
| int | getFontSize () |
| Get editor font size in points. | |
| QString | getExecPath () |
| Get path to musrfit executables. | |
| QString | getDefaultSavePath () |
| Get default directory for saving files. | |
| bool | getTitleFromDataFileFlag () |
| Check if title extraction from data file is enabled. | |
| bool | getMusrviewShowFourierFlag () |
| Check if musrview shows Fourier at startup. | |
| bool | getMusrviewShowAvgFlag () |
| Check if musrview shows averaged data. | |
| bool | getMusrviewShowOneToOneFlag () |
| Check if one-to-one theory display is enabled. | |
| bool | getEnableMusrT0Flag () |
| Check if musrT0 is enabled. | |
| bool | getYamlOutFlag () |
| Check if YAML output is enabled. | |
| int | getNoOfThreadsToBeUsed () |
| Get number of threads to be used. | |
| bool | getKeepMinuit2OutputFlag () |
| Check if MINUIT2 output files are preserved. | |
| bool | getDumpAsciiFlag () |
| Check if ASCII dump is enabled. | |
| bool | getDumpRootFlag () |
| Check if ROOT dump is enabled. | |
| bool | getEstimateN0Flag () |
| Check if N0 estimation is enabled. | |
| bool | getChisqPerRunBlockFlag () |
| Check if per-run-block chi-square is enabled. | |
| bool | getIgnoreThemeAutoDetection () |
| Check if theme auto-detection is ignored. | |
| bool | getDarkThemeIconsMenuFlag () |
| Check if dark theme icons are used in menus. | |
| bool | getDarkThemeIconsToolbarFlag () |
| Check if dark theme icons are used in toolbar. | |
| int | getEditWidth () |
| Get editor window width in pixels. | |
| int | getEditHeight () |
| Get editor window height in pixels. | |
| QString | getBeamline () |
| Get default beamline name. | |
| QString | getInstitute () |
| Get default institute name. | |
| QString | getFileFormat () |
| Get default data file format. | |
| bool | getLifetimeCorrectionFlag () |
| Check if lifetime correction is enabled. | |
| QString | getHelpUrl (QString tag) |
| Get the help URL for a specific documentation section. | |
| QString | getTheoFuncPixmapPath () |
| Get path to theory function pixmaps. | |
| unsigned int | getTheoryCounts () |
| Get number of registered theory functions. | |
| PTheory * | getTheoryItem (const unsigned int idx) |
| Get a theory function definition by index. | |
| PMsr2DataParam | getMsr2DataParam () |
| Get msr2data default parameters. | |
| int | getNumRecentFiles () |
| Get number of recent files in list. | |
| QString | getDefaultPrefPathName () |
| Get path to active configuration file. | |
| QString | getRecentFile (int idx) |
| Get a recent file path by index. | |
Configuration Setters | |
Methods to modify configuration values. | |
| void | setTimeout (const int ival) |
| Set musrfit process timeout. | |
| void | setTitleFromDataFileFlag (const bool flag) |
| Enable/disable title extraction from data file. | |
| void | setMusrviewShowFourierFlag (const bool flag) |
| Enable/disable Fourier display at startup. | |
| void | setMusrviewShowAvgFlag (const bool flag) |
| Enable/disable averaged data display. | |
| void | setMusrviewShowOneToOneFlag (const bool flag) |
| Enable/disable one-to-one theory. | |
| void | setEnableMusrT0Flag (const bool flag) |
| Enable/disable musrT0. | |
| void | setKeepMinuit2OutputFlag (const bool flag) |
| Enable/disable MINUIT2 output preservation. | |
| void | setDumpAsciiFlag (const bool flag) |
| Enable/disable ASCII dump. | |
| void | setDumpRootFlag (const bool flag) |
| Enable/disable ROOT dump. | |
| void | setEstimateN0Flag (const bool flag) |
| Enable/disable N0 estimation. | |
| void | setYamlOutFlag (const bool flag) |
| Enable/disable YAML output. | |
| void | setNoOfThreadsToBeUsed (const int num) |
| set number of threads to be used | |
| void | setChisqPerRunBlockFlag (const bool flag) |
| Enable/disable per-run-block chi-square. | |
| void | setIgnoreThemeAutoDetection (const bool flag) |
| Enable/disable theme auto-detection. | |
| void | setDarkThemeIconsMenuFlag (const bool flag) |
| Enable/disable dark theme menu icons. | |
| void | setDarkThemeIconsToolbarFlag (const bool flag) |
| Enable/disable dark theme toolbar icons. | |
| void | setEditWidth (const int width) |
| Set editor window width. | |
| void | setEditHeight (const int height) |
| Set editor window height. | |
| void | setFontName (const QString str) |
| Set editor font family. | |
| void | setFontSize (const int ival) |
| Set editor font size. | |
| void | addRecentFile (const QString str) |
| Add a file to the recent files list. | |
Persistence Methods | |
Methods for loading and saving configuration. | |
| int | loadPrefs (QString fln) |
| Load configuration from an XML file. | |
| int | savePrefs (QString pref_fln) |
| Save current configuration to an XML file. | |
| void | saveRecentFiles () |
| Save recent file list to configuration file. | |
Protected Member Functions | |
Protected Setters | |
Setters accessible to friend class PAdminXMLParser during parsing. | |
| void | setExecPath (const QString str) |
| Set path to musrfit executables. | |
| void | setDefaultSavePath (const QString str) |
| Set default save directory. | |
| void | setBeamline (const QString str) |
| Set default beamline name. | |
| void | setInstitute (const QString str) |
| Set default institute name. | |
| void | setFileFormat (const QString str) |
| Set default file format. | |
| void | setLifetimeCorrectionFlag (const bool flag) |
| Enable/disable lifetime correction. | |
| void | setHelpUrl (const QString tag, const QString url) |
| Set the help URL for a documentation section. | |
| void | setTheoFuncPixmapPath (const QString str) |
| Set path to theory pixmaps. | |
| void | addTheoryItem (const PTheory theo) |
| Add a theory function definition. | |
Private Member Functions | |
| void | createMusreditStartupFile () |
| Create default musredit_startup.xml in user's home directory. | |
Private Attributes | |
General Settings | |
Core application settings. | |
| int | fTimeout {3600} |
| Timeout for musrfit processes in seconds (default: 1 hour). | |
| QString | fFontName {QString("Monospace")} |
| Editor font family name (default: Monospace on Linux, Courier New on macOS). | |
| int | fFontSize {11} |
| Editor font size in points (default: 11 on Linux, 16 on macOS). | |
Path Settings | |
File and directory paths. | |
| QString | fPrefPathName {QString("")} |
| Full path to the active musredit_startup.xml configuration file. | |
| QString | fExecPath {QString("")} |
| Directory containing musrfit executables (musrfit, musrview, etc.). | |
| QString | fDefaultSavePath {QString("")} |
| Default directory for saving msr files. | |
| QString | fTheoFuncPixmapPath {QString("")} |
| Directory containing theory function formula pixmaps. | |
Recent Files | |
Recently opened file tracking. | |
| QVector< QString > | fRecentFile |
| Ring buffer of recently opened file paths (max MAX_RECENT_FILES entries). | |
Display Flags | |
Flags controlling musrview and editor display behavior. | |
| bool | fMusrviewShowFourier {false} |
| If true, musrview shows Fourier transform at startup instead of time-domain data. | |
| bool | fMusrviewShowAvg {false} |
| If true, musrview shows run-averaged data; if false, shows individual runs. | |
| bool | fMusrviewShowOneToOne {false} |
| If true, theory is calculated only at data points; if false, uses higher density. | |
| bool | fEnableMusrT0 {true} |
| If true, musrT0 tool is enabled in musredit (default: yes). | |
| bool | fIgnoreThemeAutoDetection {false} |
| If true, ignore OS theme detection and use manual icon settings. | |
| bool | fDarkThemeIconsMenu {false} |
| If true, use dark theme icons in application menus. | |
| bool | fDarkThemeIconsToolbar {false} |
| If true, use dark theme icons in the toolbar. | |
| int | fEditWidth {900} |
| Initial editor window width in pixels. | |
| int | fEditHeight {800} |
| Initial editor window height in pixels. | |
Fit Output Flags | |
Flags controlling musrfit output options. | |
| bool | fKeepMinuit2Output {false} |
| If true, preserve MINUIT2.OUTPUT and MINUIT2.root files after fitting. | |
| bool | fDumpAscii {false} |
| If true, musrfit creates ASCII dump files (for debugging). | |
| bool | fDumpRoot {false} |
| If true, musrfit creates ROOT dump files (for debugging). | |
| bool | fTitleFromDataFile {true} |
| If true, extract msr-file title from the data file header. | |
| bool | fChisqPreRunBlock {false} |
| If true, write per-run-block chi-square values to msr-file. | |
| bool | fEstimateN0 {true} |
| If true, estimate N0 parameter for single histogram fits. | |
| bool | fYamlOut {false} |
| If true, write MINUIT2 output additionally as <msr-file>.yaml. | |
| int | fNoOfThreadsToBeUsed {1} |
| number of threads to be used | |
MSR File Defaults | |
Default values for new msr files. | |
| QString | fBeamline |
| Default beamline name for new msr-file RUN blocks (e.g., "GPS", "LEM"). | |
| QString | fInstitute |
| Default institute name for new msr-file RUN blocks (e.g., "PSI", "ISIS"). | |
| QString | fFileFormat |
| Default data file format for new msr-files (e.g., "ROOT-NPP", "MusrRoot"). | |
| bool | fLifetimeCorrection |
| If true, enable lifetime correction flag in single histogram msr-files. | |
Msr2Data Parameters | |
Default parameters for msr2data batch operations. | |
| PMsr2DataParam | fMsr2DataParam |
| Default parameter values for msr2data tool integration. | |
Help System | |
Online help URL mappings. | |
| QMap< QString, QString > | fHelpUrl |
| Maps section tags (e.g., "theory", "parameters") to help URLs. | |
Theory Functions | |
Available theory function definitions. | |
| QVector< PTheory > | fTheory |
| Collection of theory functions available in the Theory menu. | |
Friends | |
| class | PAdminXMLParser |
| Allow XML parser to access protected setters. | |
Central administration class for musredit configuration management.
The PAdmin class serves as the central repository for all musredit configuration settings. It loads configuration from the musredit_startup.xml file and provides getters/setters for all configurable parameters.
musredit_startup.xml in:$HOME/.musrfit/musredit/$MUSRFITPATH/ $ROOTSYS/bin/ If no configuration file is found, a default one is created in $HOME/.musrfit/musredit/.
| PAdmin::PAdmin | ( | ) |
Constructs the PAdmin object and loads configuration.
Initializes all member variables to default values, then searches for and loads the musredit_startup.xml configuration file. The search order is:
$HOME/.musrfit/musredit/$MUSRFITPATH/ $ROOTSYS/bin/ If no configuration file is found, a default one is created in the user's home directory. After loading, the constructor verifies that the musrfit executable can be found and that required environment variables are set.
Definition at line 852 of file PAdmin.cpp.
| void PAdmin::addRecentFile | ( | const QString | str | ) |
Add a file to the recent files list.
Adds the specified file path to the front of the recent files list. If the file is already in the list, it is not added again (no duplicates). The list is maintained as a ring buffer with a maximum of MAX_RECENT_FILES entries.
| str | Full path to the file to add to the recent list. |
Definition at line 1223 of file PAdmin.cpp.
|
inlineprotected |
|
private |
Create default musredit_startup.xml in user's home directory.
Create a default musredit_startup.xml configuration file.
Creates a new configuration file with default settings in the user's home directory at $HOME/.musrfit/musredit/musredit_startup.xml. The method:
Definition at line 1328 of file PAdmin.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| QString PAdmin::getHelpUrl | ( | QString | tag | ) |
Get the help URL for a specific documentation section.
Retrieves the URL for online help corresponding to the given tag. The URLs are loaded from the configuration file and map to sections of the musrfit user manual.
| tag | Section identifier. Supported tags include:
|
Definition at line 959 of file PAdmin.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| QString PAdmin::getRecentFile | ( | int | idx | ) |
Get a recent file path by index.
Retrieves the full path of a recently opened file from the recent files list. The list is ordered with most recently opened files first.
| idx | Zero-based index into the recent files list. |
Definition at line 1000 of file PAdmin.cpp.
|
inline |
|
inline |
| PTheory * PAdmin::getTheoryItem | ( | const unsigned int | idx | ) |
Get a theory function definition by index.
Retrieves a pointer to a PTheory structure containing the definition of a theory function. Theory functions are used for fitting muon spin rotation/relaxation data.
| idx | Zero-based index of the theory item in the collection. |
Definition at line 978 of file PAdmin.cpp.
|
inline |
|
inline |
|
inline |
| int PAdmin::loadPrefs | ( | QString | fln | ) |
Load configuration from an XML file.
Parses the specified musredit_startup.xml file and populates this PAdmin instance with the configuration values. Uses PAdminXMLParser for the actual XML parsing.
| fln | Full path to the configuration XML file to load. |
Definition at line 1039 of file PAdmin.cpp.
| int PAdmin::savePrefs | ( | QString | pref_fln | ) |
Save current configuration to an XML file.
Saves modified preferences (timeout, flags, font settings) to the configuration file. The method reads the existing XML file, updates the relevant values in-place, and writes the result to the specified output file.
If a local musredit_startup.xml exists in the current directory, it is used as the source; otherwise, the master configuration file is used.
| pref_fln | Full path to the output configuration file. |
Definition at line 1076 of file PAdmin.cpp.
| void PAdmin::saveRecentFiles | ( | ) |
Save recent file list to configuration file.
Save the recent files list to the configuration file.
Persists the current recent files list to musredit_startup.xml. The method reads the existing XML file, removes all existing <path_file_name> entries, inserts the current list, and writes the file back.
If a local musredit_startup.xml exists in the current directory, it is updated; otherwise, the master configuration file (fPrefPathName) is used.
Definition at line 1250 of file PAdmin.cpp.
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
protected |
Set the help URL for a documentation section.
Associates a URL with a documentation section tag. This is typically called during XML configuration parsing to load help URL mappings.
| tag | Section identifier (e.g., "main", "theory", "parameters"). |
| url | Full URL to the online documentation for this section. |
Definition at line 1020 of file PAdmin.cpp.
|
inline |
|
inlineprotected |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |