|
mupp 1.1.0
|
Implementation of mupp (muon parameter plotter) main application. More...
#include <iostream>#include <QObject>#include <QScopedPointer>#include <QApplication>#include <QCoreApplication>#include <QFile>#include <QString>#include <QStringList>#include <QVector>#include <QTextStream>#include <QTimer>#include "mupp_version.h"#include "PmuppScript.h"#include "PmuppGui.h"
Go to the source code of this file.
Functions | |
| void | mupp_script_syntax () |
| Displays the mupp script syntax help to stdout. | |
| void | mupp_syntax () |
| Displays the mupp application syntax and usage help to stdout. | |
| int | mupp_script_read (const char *fln, QStringList &list) |
| Reads a mupp script file and parses its content into a string list. | |
| bool | mupp_bash_variable_exists (const QString str) |
| Checks if a bash environment variable exists and is non-empty. | |
| int | mupp_script_syntax_check (QStringList &list) |
| Validates the syntax of mupp script commands. | |
| QCoreApplication * | createApplication (int &argc, char *argv[], bool gui) |
| Factory function to create the appropriate Qt application object. | |
| int | main (int argc, char *argv[]) |
| Main entry point of the mupp application. | |
Implementation of mupp (muon parameter plotter) main application.
mupp is a tool for plotting muon spin spectroscopy (muSR) fit parameters as a function of various experimental conditions (temperature, field, etc.). The application supports both GUI and script-based modes. It can handle parameter files in db, dat, and msr formats, allowing users to visualize trends in fit parameters across multiple runs.
The main functionality includes:
Definition in file mupp.cpp.
| QCoreApplication * createApplication | ( | int & | argc, |
| char * | argv[], | ||
| bool | gui ) |
Factory function to create the appropriate Qt application object.
This function selects and creates the proper Qt application class based on whether GUI or console mode is required. It creates a QApplication instance for GUI mode (which supports widgets and graphics) or a QCoreApplication instance for script/console mode (which is lighter and has no GUI support).
| argc | reference to the argument count from main() |
| argv | argument vector from main() containing command-line arguments |
| gui | if true, a GUI application (QApplication) is created; if false, a console application (QCoreApplication) is created |
| int main | ( | int | argc, |
| char * | argv[] ) |
Main entry point of the mupp application.
mupp (muon parameter plotter) is an application designed to visualize muSR fit parameters from db-files, dat-files, or msr-files. The typical use case is plotting fit parameters as a function of experimental conditions such as temperature, pressure, magnetic field, energy, etc.
The application supports two operational modes:
Command-line usage:
Processing flow:
| argc | argument count from the command line |
| argv | argument vector containing command-line arguments |
| bool mupp_bash_variable_exists | ( | const QString | str | ) |
Checks if a bash environment variable exists and is non-empty.
This function verifies the existence of a bash environment variable by querying the system environment. The variable name can be specified with or without the leading '$' symbol, as it will be removed internally.
| str | name of the bash variable to be checked (with or without '$' prefix) |
| int mupp_script_read | ( | const char * | fln, |
| QStringList & | list ) |
Reads a mupp script file and parses its content into a string list.
This function reads a mupp script file line by line, processes each line by:
| fln | the mupp script file name (path) to be read |
| list | reference to QStringList that will contain the parsed script commands |
| void mupp_script_syntax | ( | ) |
Displays the mupp script syntax help to stdout.
This function prints detailed information about the mupp script commands, including available commands, their syntax, and descriptions. The script commands allow for batch processing and automated plotting of parameter data without user interaction.
| int mupp_script_syntax_check | ( | QStringList & | list | ) |
Validates the syntax of mupp script commands.
This function performs comprehensive validation of mupp script commands, including:
The function tracks defined variables and ensures they are properly linked to collections before use. It also validates that all collections referenced in the script have been loaded.
| list | reference to QStringList containing the parsed mupp script commands |
| void mupp_syntax | ( | ) |
Displays the mupp application syntax and usage help to stdout.
This function prints the complete usage information for the mupp application, including command-line options, file path specifications, and supported file formats. It also calls mupp_script_syntax() to display script-specific help.
Command-line options include: