|
musrWiz 0.1.0
|
The PAdmin class is the main administration class for musrWiz. More...
#include <PAdmin.h>
Public Member Functions | |
| PAdmin () | |
| Constructor. Loads all configuration files. | |
| ~PAdmin () | |
| Destructor. | |
| bool | IsValid () |
| Checks if the admin object was initialized successfully. | |
| void | dump (int tag) |
| Dumps debug information to stdout. | |
| QString | getDefaultInstitute () |
| Returns the default institute name. | |
| QString | getDefaultInstrument () |
| Returns the default instrument name. | |
| QString | getDefaultFitType () |
| Returns the default fit type. | |
| QStringList | getInstituteList () |
| Returns a list of all available institute names. | |
| QStringList | getInstrumentList (QString institute) |
| Returns a list of instruments for a given institute. | |
| PInstrument * | getInstrument (QString institute, QString instrument) |
| Returns a pointer to an instrument object. | |
| int | getTheoTemplateSize () |
| Returns the number of theory templates. | |
| QVector< PTheoTemplate > | getTheoTemplates () |
| Returns all theory templates. | |
| PTheoTemplate | getTheoTemplate (int idx) |
| Returns a theory template by index. | |
| int | getMusrfitFuncSize () |
| Returns the number of musrfit functions. | |
| QVector< PMusrfitFunc > | getMusrfitFunc () |
| Returns all musrfit functions. | |
| PMusrfitFunc | getMusrfitFunc (QString name) |
| Returns a musrfit function by name or abbreviation. | |
Protected Member Functions | |
| int | addInstrument (QString institute, PInstrument instrument) |
| Adds an instrument to an institute. | |
Private Member Functions | |
| int | loadMusrWizDefault (QString fln) |
| Loads the musrWiz.xml default settings file. | |
| int | loadMusrfitFunc (QString fln) |
| Loads the musrfit_funcs.xml file. | |
| int | loadInstrumentDef (QString path, QString fln) |
| Loads an instrument definition XML file. | |
Private Attributes | |
| bool | fValid |
| flag indicating successful initialization | |
| PMusrWizDefault | fDefault |
| default wizard settings | |
| QVector< PInstitute > | fInstitute |
| list of institutes with their instruments | |
| QVector< PTheoTemplate > | fTheoTemplate |
| list of theory templates | |
| QVector< PMusrfitFunc > | fMusrfitFunc |
| list of musrfit functions | |
Friends | |
| class | PFuncXMLParser |
| class | PInstrumentDefXMLParser |
| class | PMusrWizDefaultXMLParser |
The PAdmin class is the main administration class for musrWiz.
This class serves as the central repository for all configuration data needed by the musrWiz application. It loads and manages:
The XML parser friend classes populate this class with data from the configuration files.
| PAdmin::PAdmin | ( | ) |
Constructor. Loads all configuration files.
Attempts to load configuration files first from the local directory, then from $HOME/.musrfit/musrWiz/. If files don't exist, creates them from built-in resources.
Initializes that PAdmin object, and calls the XML parser which feeds the object variables.
|
inline |
Destructor.
|
protected |
Adds an instrument to an institute.
PAdmin::addInstrument adds an instrument to an institute.
| institute | Institute name. Creates the institute if it doesn't exist. |
| instrument | Instrument object to add. |
Searches for the specified institute. If found, adds the instrument to it. If the institute doesn't exist, creates a new institute entry and adds the instrument to it.
| institute | Institute name (e.g., "PSI"). |
| instrument | Instrument object to add. |
| void PAdmin::dump | ( | int | tag | ) |
Dumps debug information to stdout.
| tag | Debug tag: 0=instrument defs, 1=musrfit funcs, 2=both, -1=none. |
dump all the instrument defs to stdout. This routine is there for debug purposes only.
|
inline |
Returns the default fit type.
|
inline |
Returns the default institute name.
|
inline |
Returns the default instrument name.
| QStringList PAdmin::getInstituteList | ( | ) |
Returns a list of all available institute names.
PAdmin::getInstituteList returns a list of all available institute names.
Iterates through all loaded institutes and collects their names into a QStringList.
| PInstrument * PAdmin::getInstrument | ( | QString | institute, |
| QString | instrument ) |
Returns a pointer to an instrument object.
PAdmin::getInstrument returns a pointer to an instrument object.
| institute | Institute name. |
| instrument | Instrument name. |
Searches for the specified institute and instrument combination.
| institute | Institute name (e.g., "PSI"). |
| instrument | Instrument name (e.g., "HAL9500"). |
| QStringList PAdmin::getInstrumentList | ( | QString | institute | ) |
Returns a list of instruments for a given institute.
PAdmin::getInstrumentList returns a list of instruments for a given institute.
| institute | Institute name to query. |
Searches for the specified institute and returns the names of all instruments associated with it.
| institute | Institute name to query (e.g., "PSI"). |
|
inline |
Returns all musrfit functions.
| PMusrfitFunc PAdmin::getMusrfitFunc | ( | QString | name | ) |
Returns a musrfit function by name or abbreviation.
PAdmin::getMusrfitFunc returns a musrfit function by name or abbreviation.
| name | Function name or abbreviation. |
Searches the list of loaded musrfit functions for one matching the given name (either full name or abbreviation).
| name | Function name (e.g., "simpleGss") or abbreviation (e.g., "sg"). |
|
inline |
Returns the number of musrfit functions.
| PTheoTemplate PAdmin::getTheoTemplate | ( | int | idx | ) |
Returns a theory template by index.
PAdmin::getTheoTemplate returns a theory template by index.
| idx | Index of the template. |
| idx | Index of the requested theory template. |
|
inline |
Returns all theory templates.
|
inline |
Returns the number of theory templates.
|
inline |
Checks if the admin object was initialized successfully.
|
private |
Loads an instrument definition XML file.
PAdmin::loadInstrumentDef loads an instrument definition XML file.
| path | Directory path containing the file. |
| fln | Filename of the instrument definition file. |
If the file doesn't exist at the specified path, copies the default from the built-in Qt resource system to $HOME/.musrfit/musrWiz/.
| path | Directory path containing the file. |
| fln | Filename of the instrument definition file (e.g., "instrument_def_psi.xml"). |
|
private |
Loads the musrfit_funcs.xml file.
PAdmin::loadMusrfitFunc loads the musrfit_funcs.xml file.
| fln | Path to the file. |
If the file doesn't exist at the specified path, copies the default from the built-in Qt resource system to $HOME/.musrfit/musrWiz/.
| fln | Path to the musrfit_funcs.xml file. |
|
private |
Loads the musrWiz.xml default settings file.
PAdmin::loadMusrWizDefault loads the musrWiz.xml default settings file.
| fln | Path to the file. |
If the file doesn't exist at the specified path, copies the default from the built-in Qt resource system to $HOME/.musrfit/musrWiz/.
| fln | Path to the musrWiz.xml file. |
|
friend |
|
friend |
|
friend |
|
private |
default wizard settings
|
private |
list of institutes with their instruments
|
private |
list of musrfit functions
|
private |
list of theory templates
|
private |
flag indicating successful initialization