mupp: worked on the doxygen docu.
This commit is contained in:
parent
f19a94651b
commit
1a2853e548
@ -40,6 +40,10 @@
|
|||||||
#include "PVarDialog.h"
|
#include "PVarDialog.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PShowVarNameDialog::PShowVarNameDialog. Ctor
|
||||||
|
* @param info containing the necessary information of the collection
|
||||||
|
*/
|
||||||
PShowVarNameDialog::PShowVarNameDialog(PCollInfo &info)
|
PShowVarNameDialog::PShowVarNameDialog(PCollInfo &info)
|
||||||
{
|
{
|
||||||
// if fCollName is a path name, extract the fln
|
// if fCollName is a path name, extract the fln
|
||||||
@ -80,6 +84,14 @@ PShowVarNameDialog::PShowVarNameDialog(PCollInfo &info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::PVarDialog. Variable GUI allowing the users to define
|
||||||
|
* variables.
|
||||||
|
* @param collection_list list of all the collections
|
||||||
|
* @param darkTheme plain/dark theme flag
|
||||||
|
* @param parent parent widget pointer
|
||||||
|
* @param f window flag
|
||||||
|
*/
|
||||||
PVarDialog::PVarDialog(QVector<PCollInfo> collection_list, bool darkTheme,
|
PVarDialog::PVarDialog(QVector<PCollInfo> collection_list, bool darkTheme,
|
||||||
QWidget *parent, Qt::WindowFlags f) :
|
QWidget *parent, Qt::WindowFlags f) :
|
||||||
QDialog(parent, f), fCollList(collection_list)
|
QDialog(parent, f), fCollList(collection_list)
|
||||||
@ -152,6 +164,9 @@ PVarDialog::PVarDialog(QVector<PCollInfo> collection_list, bool darkTheme,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::check. Allows the user to check the variable string.
|
||||||
|
*/
|
||||||
void PVarDialog::check()
|
void PVarDialog::check()
|
||||||
{
|
{
|
||||||
if (!basic_check())
|
if (!basic_check())
|
||||||
@ -170,6 +185,9 @@ void PVarDialog::check()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::add. It is used to initiate the add variable to the mupp GUI.
|
||||||
|
*/
|
||||||
void PVarDialog::add()
|
void PVarDialog::add()
|
||||||
{
|
{
|
||||||
if (fVarEdit->toPlainText().isEmpty()) {
|
if (fVarEdit->toPlainText().isEmpty()) {
|
||||||
@ -198,12 +216,19 @@ void PVarDialog::add()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::help
|
||||||
|
*/
|
||||||
void PVarDialog::help()
|
void PVarDialog::help()
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, "Var Help", "Syntax: var <var_name> = <expr>.\n<expr> can contain identifiers defined in the collections.\nExample:\nvar sigSC = pow(abs(pow($sigma,2.0)-pow(0.11,2.0)),0.5)");
|
QMessageBox::information(this, "Var Help", "Syntax: var <var_name> = <expr>.\n<expr> can contain identifiers defined in the collections.\nExample:\nvar sigSC = pow(abs(pow($sigma,2.0)-pow(0.11,2.0)),0.5)");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::showVarNames. Show a variable name dialog for a given
|
||||||
|
* selected collection.
|
||||||
|
*/
|
||||||
void PVarDialog::showVarNames()
|
void PVarDialog::showVarNames()
|
||||||
{
|
{
|
||||||
// get the selected collection
|
// get the selected collection
|
||||||
@ -229,6 +254,11 @@ void PVarDialog::showVarNames()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::basic_check. Carry out basic checks before feeding it
|
||||||
|
* to the parser.
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
bool PVarDialog::basic_check()
|
bool PVarDialog::basic_check()
|
||||||
{
|
{
|
||||||
QString varStr = fVarEdit->toPlainText();
|
QString varStr = fVarEdit->toPlainText();
|
||||||
@ -275,6 +305,12 @@ bool PVarDialog::basic_check()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::var_consistency_check. Variable consistency checks. For
|
||||||
|
* instance it is checked that for each variable there is also the corresponding
|
||||||
|
* error variable defined.
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
bool PVarDialog::var_consistency_check()
|
bool PVarDialog::var_consistency_check()
|
||||||
{
|
{
|
||||||
QString varStr = fVarEdit->toPlainText();
|
QString varStr = fVarEdit->toPlainText();
|
||||||
@ -360,6 +396,12 @@ bool PVarDialog::var_consistency_check()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::collectVarNames. Collect variable names from edit variable.
|
||||||
|
* @param list input list
|
||||||
|
* @param ok true if ok
|
||||||
|
* @return return variable list
|
||||||
|
*/
|
||||||
QStringList PVarDialog::collectVarNames(QStringList &list, bool &ok)
|
QStringList PVarDialog::collectVarNames(QStringList &list, bool &ok)
|
||||||
{
|
{
|
||||||
QStringList name;
|
QStringList name;
|
||||||
@ -380,6 +422,12 @@ QStringList PVarDialog::collectVarNames(QStringList &list, bool &ok)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PVarDialog::hasErrorDef. Check for error definition
|
||||||
|
* @param varNames variable name list
|
||||||
|
* @param name failed variable name
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
bool PVarDialog::hasErrorDef(QStringList &varNames, QString &name)
|
bool PVarDialog::hasErrorDef(QStringList &varNames, QString &name)
|
||||||
{
|
{
|
||||||
QString errStr;
|
QString errStr;
|
||||||
|
@ -37,13 +37,20 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief The PCollInfo struct
|
||||||
|
*/
|
||||||
struct PCollInfo
|
struct PCollInfo
|
||||||
{
|
{
|
||||||
QString fCollName;
|
QString fCollName; ///< collection name
|
||||||
QStringList fVarName;
|
QStringList fVarName; ///< variable names of the given collection
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief The PShowVarNameDialog class. Class used to create a show variable
|
||||||
|
* name dialog.
|
||||||
|
*/
|
||||||
class PShowVarNameDialog : public QDialog
|
class PShowVarNameDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -53,6 +60,9 @@ class PShowVarNameDialog : public QDialog
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief The PVarDialog class
|
||||||
|
*/
|
||||||
class PVarDialog : public QDialog
|
class PVarDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::PmuppParam
|
* @brief PmuppParam::PmuppParam. Ctor
|
||||||
*/
|
*/
|
||||||
PmuppParam::PmuppParam() {
|
PmuppParam::PmuppParam() {
|
||||||
ResetParam();
|
ResetParam();
|
||||||
@ -62,10 +62,10 @@ PmuppParam::PmuppParam() {
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::PmuppParam
|
* @brief PmuppParam::PmuppParam. Ctor
|
||||||
* @param name
|
* @param name parameter name
|
||||||
* @param param
|
* @param param parameter value
|
||||||
* @param posErr
|
* @param posErr parameter error
|
||||||
*/
|
*/
|
||||||
PmuppParam::PmuppParam(QString name, double param, double posErr)
|
PmuppParam::PmuppParam(QString name, double param, double posErr)
|
||||||
{
|
{
|
||||||
@ -74,11 +74,11 @@ PmuppParam::PmuppParam(QString name, double param, double posErr)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::PmuppParam
|
* @brief PmuppParam::PmuppParam. Ctor
|
||||||
* @param name
|
* @param name parameter name
|
||||||
* @param param
|
* @param param parameter value
|
||||||
* @param posErr
|
* @param posErr positive parameter error
|
||||||
* @param negErr
|
* @param negErr negative parameter error
|
||||||
*/
|
*/
|
||||||
PmuppParam::PmuppParam(QString name, double param, double posErr, double negErr)
|
PmuppParam::PmuppParam(QString name, double param, double posErr, double negErr)
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ PmuppParam::PmuppParam(QString name, double param, double posErr, double negErr)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::ResetParam
|
* @brief PmuppParam::ResetParam. Reset the parameter values
|
||||||
*/
|
*/
|
||||||
void PmuppParam::ResetParam()
|
void PmuppParam::ResetParam()
|
||||||
{
|
{
|
||||||
@ -99,10 +99,10 @@ void PmuppParam::ResetParam()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::SetParam
|
* @brief PmuppParam::SetParam. Set a parameter
|
||||||
* @param name
|
* @param name parameter name
|
||||||
* @param param
|
* @param param parameter value
|
||||||
* @param posErr
|
* @param posErr parameter error
|
||||||
*/
|
*/
|
||||||
void PmuppParam::SetParam(QString name, double param, double posErr)
|
void PmuppParam::SetParam(QString name, double param, double posErr)
|
||||||
{
|
{
|
||||||
@ -113,11 +113,11 @@ void PmuppParam::SetParam(QString name, double param, double posErr)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppParam::SetParam
|
* @brief PmuppParam::SetParam. Set a parameter
|
||||||
* @param name
|
* @param name parameter name
|
||||||
* @param param
|
* @param param parameter value
|
||||||
* @param posErr
|
* @param posErr positive parameter value
|
||||||
* @param negErr
|
* @param negErr negative parameter value
|
||||||
*/
|
*/
|
||||||
void PmuppParam::SetParam(QString name, double param, double posErr, double negErr)
|
void PmuppParam::SetParam(QString name, double param, double posErr, double negErr)
|
||||||
{
|
{
|
||||||
@ -129,9 +129,9 @@ void PmuppParam::SetParam(QString name, double param, double posErr, double negE
|
|||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
/**
|
/**
|
||||||
* @brief PmuppRun::GetParam
|
* @brief PmuppRun::GetParam. Get a parameter from a run
|
||||||
* @param idx
|
* @param idx index of the parameter
|
||||||
* @return
|
* @return the parameter value
|
||||||
*/
|
*/
|
||||||
PmuppParam PmuppRun::GetParam(unsigned int idx)
|
PmuppParam PmuppRun::GetParam(unsigned int idx)
|
||||||
{
|
{
|
||||||
@ -145,9 +145,9 @@ PmuppParam PmuppRun::GetParam(unsigned int idx)
|
|||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
/**
|
/**
|
||||||
* @brief PmuppCollection::GetRun
|
* @brief PmuppCollection::GetRun. Returns a run from a collection.
|
||||||
* @param idx
|
* @param idx of the run in a collection
|
||||||
* @return
|
* @return a run from a collection
|
||||||
*/
|
*/
|
||||||
PmuppRun PmuppCollection::GetRun(unsigned int idx)
|
PmuppRun PmuppCollection::GetRun(unsigned int idx)
|
||||||
{
|
{
|
||||||
@ -161,8 +161,9 @@ PmuppRun PmuppCollection::GetRun(unsigned int idx)
|
|||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::NewCollection
|
* @brief PParamDataHandler::NewCollection. Adds an empty new collection with
|
||||||
* @param name
|
* name 'name'.
|
||||||
|
* @param name of the new collection
|
||||||
*/
|
*/
|
||||||
void PParamDataHandler::NewCollection(const QString name)
|
void PParamDataHandler::NewCollection(const QString name)
|
||||||
{
|
{
|
||||||
@ -174,15 +175,20 @@ void PParamDataHandler::NewCollection(const QString name)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::analyzeFileList
|
* @brief PParamDataHandler::analyzeFileList. In case the input is given by
|
||||||
* @param fln
|
* msr-files, the structure of the file names needs to be analyzed that
|
||||||
* @param collectionName
|
* msr2data can be called.
|
||||||
* @param arg
|
*
|
||||||
* @param workDir
|
* @param fln list of msr-files to be analyzed.
|
||||||
* @param errorMsg
|
* @param collectionName output collection name (db-/dat-file).
|
||||||
* @return
|
* @param arg argument list which is needed to feed msr2data
|
||||||
|
* @param workDir working directory
|
||||||
|
* @param errorMsg error message in case something went wrong.
|
||||||
|
*
|
||||||
|
* @return true if successful, false otherwise
|
||||||
*/
|
*/
|
||||||
bool PParamDataHandler::analyzeFileList(const QStringList &fln, QString &collectionName, QStringList &arg, QString &workDir, QString &errorMsg)
|
bool PParamDataHandler::analyzeFileList(const QStringList &fln, QString &collectionName,
|
||||||
|
QStringList &arg, QString &workDir, QString &errorMsg)
|
||||||
{
|
{
|
||||||
// 1) check all the msr-files have the same structure: <runNo><extension>.msr with <extension> the same
|
// 1) check all the msr-files have the same structure: <runNo><extension>.msr with <extension> the same
|
||||||
// for all msr-files present.
|
// for all msr-files present.
|
||||||
@ -253,10 +259,11 @@ bool PParamDataHandler::analyzeFileList(const QStringList &fln, QString &collect
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::ReadParamFile
|
* @brief PParamDataHandler::ReadParamFile. Reads a msr-file.
|
||||||
* @param fln
|
* @param fln file name of the msr-file to be read
|
||||||
* @param errorMsg
|
* @param errorMsg error message in case reading fails.
|
||||||
* @return
|
*
|
||||||
|
* @return true on success, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg)
|
bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg)
|
||||||
{
|
{
|
||||||
@ -385,11 +392,12 @@ bool PParamDataHandler::ReadParamFile(const QStringList fln, QString &errorMsg)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::ReadDbFile
|
* @brief PParamDataHandler::ReadDbFile. Reads a db-file.
|
||||||
* @param fln
|
* @param fln file name of the db-file
|
||||||
* @param valid
|
* @param valid true on success, otherwise false
|
||||||
* @param errorMsg
|
* @param errorMsg error messages in case read fails
|
||||||
* @return
|
*
|
||||||
|
* @return the collection object containing the db-file on success.
|
||||||
*/
|
*/
|
||||||
PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QString &errorMsg)
|
PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QString &errorMsg)
|
||||||
{
|
{
|
||||||
@ -541,11 +549,12 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::ReadColumnParamFile
|
* @brief PParamDataHandler::ReadColumnParamFile. Reads a dat-file
|
||||||
* @param fln
|
* @param fln file name of the dat-file to be read
|
||||||
* @param valid
|
* @param valid true on success, false otherwise.
|
||||||
* @param errorMsg
|
* @param errorMsg error message in case read fails.
|
||||||
* @return
|
*
|
||||||
|
* @return the collection object containing the dat-file on success.
|
||||||
*/
|
*/
|
||||||
PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &valid, QString &errorMsg)
|
PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &valid, QString &errorMsg)
|
||||||
{
|
{
|
||||||
@ -677,10 +686,12 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetCollection
|
* @brief PParamDataHandler::GetCollection. Get a single collection from all
|
||||||
* @param idx
|
* the loaded collections
|
||||||
* @param valid
|
* @param idx of the collection
|
||||||
* @return
|
* @param valid true if collection is found
|
||||||
|
*
|
||||||
|
* @return requested collection on success.
|
||||||
*/
|
*/
|
||||||
PmuppCollection PParamDataHandler::GetCollection(const int idx, bool &valid)
|
PmuppCollection PParamDataHandler::GetCollection(const int idx, bool &valid)
|
||||||
{
|
{
|
||||||
@ -697,14 +708,16 @@ PmuppCollection PParamDataHandler::GetCollection(const int idx, bool &valid)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetCollection
|
* @brief PParamDataHandler::GetCollection. Get a pointer of the requested
|
||||||
* @param idx
|
* collection.
|
||||||
* @return
|
* @param idx of the collection
|
||||||
|
*
|
||||||
|
* @return requested pointer to the collection on success.
|
||||||
*/
|
*/
|
||||||
PmuppCollection *PParamDataHandler::GetCollection(const int idx)
|
PmuppCollection *PParamDataHandler::GetCollection(const int idx)
|
||||||
{
|
{
|
||||||
if ((idx<0) || (idx>=fCollection.size())) {
|
if ((idx<0) || (idx>=fCollection.size())) {
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &fCollection[idx];
|
return &fCollection[idx];
|
||||||
@ -712,10 +725,11 @@ PmuppCollection *PParamDataHandler::GetCollection(const int idx)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetCollection
|
* @brief PParamDataHandler::GetCollection. Get collection by name.
|
||||||
* @param name
|
* @param name of the requested collection
|
||||||
* @param valid
|
* @param valid true if found
|
||||||
* @return
|
*
|
||||||
|
* @return requested collection on success.
|
||||||
*/
|
*/
|
||||||
PmuppCollection PParamDataHandler::GetCollection(const QString name, bool &valid)
|
PmuppCollection PParamDataHandler::GetCollection(const QString name, bool &valid)
|
||||||
{
|
{
|
||||||
@ -740,9 +754,10 @@ PmuppCollection PParamDataHandler::GetCollection(const QString name, bool &valid
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetCollection
|
* @brief PParamDataHandler::GetCollection. Get collection pointer by name.
|
||||||
* @param name
|
* @param name of the requested collection
|
||||||
* @return
|
*
|
||||||
|
* @return pointer of the requested collection on success, nullptr otherwise
|
||||||
*/
|
*/
|
||||||
PmuppCollection *PParamDataHandler::GetCollection(const QString name)
|
PmuppCollection *PParamDataHandler::GetCollection(const QString name)
|
||||||
{
|
{
|
||||||
@ -755,7 +770,7 @@ PmuppCollection *PParamDataHandler::GetCollection(const QString name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (idx==-1) { // not found
|
if (idx==-1) { // not found
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &fCollection[idx];
|
return &fCollection[idx];
|
||||||
@ -763,9 +778,11 @@ PmuppCollection *PParamDataHandler::GetCollection(const QString name)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetCollectionIndex
|
* @brief PParamDataHandler::GetCollectionIndex. Get the collection index of
|
||||||
* @param name
|
* a given collection name.
|
||||||
* @return
|
* @param name of the requested collection
|
||||||
|
*
|
||||||
|
* @return index of the requested collection on success, otherwise -1.
|
||||||
*/
|
*/
|
||||||
int PParamDataHandler::GetCollectionIndex(const QString name)
|
int PParamDataHandler::GetCollectionIndex(const QString name)
|
||||||
{
|
{
|
||||||
@ -799,10 +816,13 @@ QString PParamDataHandler::GetCollectionName(const int idx)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetValues
|
* @brief PParamDataHandler::GetValues. Get the data values of a parameter of
|
||||||
* @param collName
|
* a requested collection.
|
||||||
* @param paramName
|
* @param collName name of the collection
|
||||||
* @return
|
* @param paramName parameter name
|
||||||
|
*
|
||||||
|
* @return data values of the requested parameter name of the collection collName.
|
||||||
|
* Empty data vector otherwise.
|
||||||
*/
|
*/
|
||||||
QVector<double> PParamDataHandler::GetValues(QString collName, QString paramName)
|
QVector<double> PParamDataHandler::GetValues(QString collName, QString paramName)
|
||||||
{
|
{
|
||||||
@ -842,10 +862,13 @@ QVector<double> PParamDataHandler::GetValues(QString collName, QString paramName
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetPosErr
|
* @brief PParamDataHandler::GetPosErr. Get the positive data error values of
|
||||||
* @param collName
|
* a parameter of a requested collection.
|
||||||
* @param paramName
|
* @param collName name of the requested collection
|
||||||
* @return
|
* @param paramName parameter name
|
||||||
|
*
|
||||||
|
* @return positive error values of the requested parameter name of the
|
||||||
|
* collection collName. Empty positive error vector otherwise.
|
||||||
*/
|
*/
|
||||||
QVector<double> PParamDataHandler::GetPosErr(QString collName, QString paramName)
|
QVector<double> PParamDataHandler::GetPosErr(QString collName, QString paramName)
|
||||||
{
|
{
|
||||||
@ -885,10 +908,13 @@ QVector<double> PParamDataHandler::GetPosErr(QString collName, QString paramName
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::GetNegErr
|
* @brief PParamDataHandler::GetNegErr. Get the negative data error values of
|
||||||
* @param collName
|
* a parameter of a requested collection.
|
||||||
* @param paramName
|
* @param collName name of the requested collection
|
||||||
* @return
|
* @param paramName parameter name
|
||||||
|
*
|
||||||
|
* @return negative error values of the requested parameter name of the
|
||||||
|
* collection collName. Empty negative error vector otherwise.
|
||||||
*/
|
*/
|
||||||
QVector<double> PParamDataHandler::GetNegErr(QString collName, QString paramName)
|
QVector<double> PParamDataHandler::GetNegErr(QString collName, QString paramName)
|
||||||
{
|
{
|
||||||
@ -928,8 +954,9 @@ QVector<double> PParamDataHandler::GetNegErr(QString collName, QString paramName
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::RemoveCollection
|
* @brief PParamDataHandler::RemoveCollection. Remove a collection from the
|
||||||
* @param name
|
* data handler.
|
||||||
|
* @param name of the collection to be removed.
|
||||||
*/
|
*/
|
||||||
void PParamDataHandler::RemoveCollection(QString name)
|
void PParamDataHandler::RemoveCollection(QString name)
|
||||||
{
|
{
|
||||||
@ -943,9 +970,10 @@ void PParamDataHandler::RemoveCollection(QString name)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::ReplaceCollection
|
* @brief PParamDataHandler::ReplaceCollection. Replaces a collection at index
|
||||||
* @param coll
|
* position idx.
|
||||||
* @param idx
|
* @param coll collection
|
||||||
|
* @param idx index of the collection to be replaced
|
||||||
*/
|
*/
|
||||||
void PParamDataHandler::ReplaceCollection(PmuppCollection coll, int idx)
|
void PParamDataHandler::ReplaceCollection(PmuppCollection coll, int idx)
|
||||||
{
|
{
|
||||||
@ -957,7 +985,7 @@ void PParamDataHandler::ReplaceCollection(PmuppCollection coll, int idx)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PParamDataHandler::Dump
|
* @brief PParamDataHandler::Dump. Dumps the collection onto stdout
|
||||||
*/
|
*/
|
||||||
void PParamDataHandler::Dump()
|
void PParamDataHandler::Dump()
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,11 @@
|
|||||||
|
|
||||||
#define MUPP_UNDEF 1.0e99
|
#define MUPP_UNDEF 1.0e99
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>The PmuppParam class. It handles a single parameter: name, value,
|
||||||
|
* positive- and negative error.
|
||||||
|
*/
|
||||||
class PmuppParam {
|
class PmuppParam {
|
||||||
public:
|
public:
|
||||||
PmuppParam();
|
PmuppParam();
|
||||||
@ -58,12 +63,16 @@ class PmuppParam {
|
|||||||
double GetNegErr() { return fNegErr; }
|
double GetNegErr() { return fNegErr; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fName;
|
QString fName; ///< parameter name
|
||||||
double fValue;
|
double fValue; ///< parameter value
|
||||||
double fPosErr;
|
double fPosErr; ///< positive error of the parameter
|
||||||
double fNegErr;
|
double fNegErr; ///< negative error of the parameter
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>The PmuppRun class. Contains all the parameters of a single run.
|
||||||
|
*/
|
||||||
class PmuppRun {
|
class PmuppRun {
|
||||||
public:
|
public:
|
||||||
PmuppRun() { fNumber = -1; fName=""; fParam.clear(); }
|
PmuppRun() { fNumber = -1; fName=""; fParam.clear(); }
|
||||||
@ -81,10 +90,15 @@ class PmuppRun {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int fNumber; ///< run number
|
int fNumber; ///< run number
|
||||||
QString fName;
|
QString fName; ///< name of the run
|
||||||
QVector<PmuppParam> fParam;
|
QVector<PmuppParam> fParam; ///< parameters of the run
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>The PmuppCollection class. Is collecting a number of runs. Typically
|
||||||
|
* something like a full temperature scan, an energy scan, etc.
|
||||||
|
*/
|
||||||
class PmuppCollection {
|
class PmuppCollection {
|
||||||
public:
|
public:
|
||||||
PmuppCollection() { fPathName=""; fName = ""; fRun.clear(); }
|
PmuppCollection() { fPathName=""; fName = ""; fRun.clear(); }
|
||||||
@ -99,11 +113,16 @@ class PmuppCollection {
|
|||||||
PmuppRun GetRun(unsigned int idx);
|
PmuppRun GetRun(unsigned int idx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fPathName;
|
QString fPathName; ///< path-name of the collection
|
||||||
QString fName;
|
QString fName; ///< name of the collection
|
||||||
QVector<PmuppRun> fRun;
|
QVector<PmuppRun> fRun; ///< all the runs in the collection
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>The PParamDataHandler class. This class handles all the collections
|
||||||
|
* loaded.
|
||||||
|
*/
|
||||||
class PParamDataHandler : public QObject {
|
class PParamDataHandler : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -137,10 +156,11 @@ class PParamDataHandler : public QObject {
|
|||||||
void newData();
|
void newData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess *fProc;
|
QProcess *fProc; ///< this will be needed if msr2data needs to be called
|
||||||
QVector<PmuppCollection> fCollection;
|
QVector<PmuppCollection> fCollection; ///< all the collections handeled
|
||||||
|
|
||||||
bool analyzeFileList(const QStringList &fln, QString &collectionName, QStringList &arg, QString &workDir, QString &errorMsg);
|
bool analyzeFileList(const QStringList &fln, QString &collectionName,
|
||||||
|
QStringList &arg, QString &workDir, QString &errorMsg);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void readFromStdOut();
|
void readFromStdOut();
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
// implementation of PmuppColor class
|
// implementation of PmuppColor class
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppColor::PmuppColor
|
* @brief PmuppColor::PmuppColor. Ctor
|
||||||
*/
|
*/
|
||||||
PmuppColor::PmuppColor()
|
PmuppColor::PmuppColor()
|
||||||
{
|
{
|
||||||
@ -59,10 +59,10 @@ PmuppColor::PmuppColor()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppColor::setRGB
|
* @brief PmuppColor::setRGB. set RGB value
|
||||||
* @param r
|
* @param r red (0..255)
|
||||||
* @param g
|
* @param g green (0..255)
|
||||||
* @param b
|
* @param b blue (0..255)
|
||||||
*/
|
*/
|
||||||
void PmuppColor::setRGB(const int r, const int g, const int b)
|
void PmuppColor::setRGB(const int r, const int g, const int b)
|
||||||
{
|
{
|
||||||
@ -366,9 +366,12 @@ void PmuppAdmin::addRecentFile(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::getRecentFile
|
* @brief PmuppAdmin::getRecentFile. Get a file from the recent files with
|
||||||
|
* index idx.
|
||||||
* @param idx
|
* @param idx
|
||||||
* @return
|
*
|
||||||
|
* @return return the recent file with index idx if present, otherwise return
|
||||||
|
* an empty string.
|
||||||
*/
|
*/
|
||||||
QString PmuppAdmin::getRecentFile(int idx)
|
QString PmuppAdmin::getRecentFile(int idx)
|
||||||
{
|
{
|
||||||
@ -382,9 +385,10 @@ QString PmuppAdmin::getRecentFile(int idx)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::getMarker
|
* @brief PmuppAdmin::getMarker. Get the marker with index idx.
|
||||||
* @param idx
|
* @param idx marker index
|
||||||
* @return
|
*
|
||||||
|
* @return requested marker
|
||||||
*/
|
*/
|
||||||
PmuppMarker PmuppAdmin::getMarker(int idx) {
|
PmuppMarker PmuppAdmin::getMarker(int idx) {
|
||||||
PmuppMarker marker;
|
PmuppMarker marker;
|
||||||
@ -397,11 +401,11 @@ PmuppMarker PmuppAdmin::getMarker(int idx) {
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::getColor
|
* @brief PmuppAdmin::getColor. Get rgb color codes of name
|
||||||
* @param name
|
* @param name of the requeset color.
|
||||||
* @param r
|
* @param r red value (0..255)
|
||||||
* @param g
|
* @param g green value (0..255)
|
||||||
* @param b
|
* @param b blue value (0..255
|
||||||
*/
|
*/
|
||||||
void PmuppAdmin::getColor(QString name, int &r, int &g, int &b)
|
void PmuppAdmin::getColor(QString name, int &r, int &g, int &b)
|
||||||
{
|
{
|
||||||
@ -424,11 +428,11 @@ void PmuppAdmin::getColor(QString name, int &r, int &g, int &b)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::getColor
|
* @brief PmuppAdmin::getColor. Get color codes of color at index idx
|
||||||
* @param idx
|
* @param idx requested color index
|
||||||
* @param r
|
* @param r red value (0..255)
|
||||||
* @param g
|
* @param g green value (0..255)
|
||||||
* @param b
|
* @param b blue value (0..255)
|
||||||
*/
|
*/
|
||||||
void PmuppAdmin::getColor(int idx, int &r, int &g, int &b)
|
void PmuppAdmin::getColor(int idx, int &r, int &g, int &b)
|
||||||
{
|
{
|
||||||
@ -443,9 +447,9 @@ void PmuppAdmin::getColor(int idx, int &r, int &g, int &b)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::setMaker
|
* @brief PmuppAdmin::setMaker. Set a marker
|
||||||
* @param marker
|
* @param marker marker code
|
||||||
* @param size
|
* @param size marker size
|
||||||
*/
|
*/
|
||||||
void PmuppAdmin::setMarker(int marker, double size)
|
void PmuppAdmin::setMarker(int marker, double size)
|
||||||
{
|
{
|
||||||
@ -464,11 +468,11 @@ void PmuppAdmin::setMarker(int marker, double size)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::setColor
|
* @brief PmuppAdmin::setColor. Set a color
|
||||||
* @param r
|
* @param r red value (0..255)
|
||||||
* @param g
|
* @param g green value (0..255)
|
||||||
* @param b
|
* @param b blue value (0..255)
|
||||||
* @param name
|
* @param name color name
|
||||||
*/
|
*/
|
||||||
void PmuppAdmin::setColor(int r, int g, int b, QString name)
|
void PmuppAdmin::setColor(int r, int g, int b, QString name)
|
||||||
{
|
{
|
||||||
@ -558,7 +562,8 @@ void PmuppAdmin::saveRecentFiles()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppAdmin::createMuppStartupFile
|
* @brief PmuppAdmin::createMuppStartupFile. Create a default mupp_startup.xml
|
||||||
|
* file if not present.
|
||||||
*/
|
*/
|
||||||
void PmuppAdmin::createMuppStartupFile()
|
void PmuppAdmin::createMuppStartupFile()
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,8 @@ class PmuppAdmin;
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief The PmuppColor class
|
* @brief The PmuppColor class. Contains to colors read from the xml-startup
|
||||||
|
* which are used for the plotted data.
|
||||||
*/
|
*/
|
||||||
class PmuppColor {
|
class PmuppColor {
|
||||||
public:
|
public:
|
||||||
@ -64,7 +65,8 @@ class PmuppColor {
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief The PmuppMarker class
|
* @brief The PmuppMarker class. List of the markers used in the plotter. Read
|
||||||
|
* from the xml-startup.
|
||||||
*/
|
*/
|
||||||
class PmuppMarker {
|
class PmuppMarker {
|
||||||
public:
|
public:
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::init
|
* @brief PmuppXY::init the xy object
|
||||||
*/
|
*/
|
||||||
void PmuppXY::init()
|
void PmuppXY::init()
|
||||||
{
|
{
|
||||||
@ -71,11 +71,11 @@ void PmuppXY::init()
|
|||||||
fYlabel.clear();
|
fYlabel.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::setYlabel
|
* @brief PmuppXY::setYlabel. Set the y-label
|
||||||
* @param idx
|
* @param idx index of the y-label
|
||||||
* @param str
|
* @param str name of the y-label
|
||||||
*/
|
*/
|
||||||
void PmuppXY::setYlabel(int idx, QString str)
|
void PmuppXY::setYlabel(int idx, QString str)
|
||||||
{
|
{
|
||||||
@ -85,10 +85,10 @@ void PmuppXY::setYlabel(int idx, QString str)
|
|||||||
fYlabel[idx] = str;
|
fYlabel[idx] = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::removeYlabel
|
* @brief PmuppXY::removeYlabel. Remove the y-label at position idx.
|
||||||
* @param idx
|
* @param idx index of the y-label to be removed.
|
||||||
*/
|
*/
|
||||||
void PmuppXY::removeYlabel(int idx)
|
void PmuppXY::removeYlabel(int idx)
|
||||||
{
|
{
|
||||||
@ -98,10 +98,10 @@ void PmuppXY::removeYlabel(int idx)
|
|||||||
fYlabel.remove(idx);
|
fYlabel.remove(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::removeYlabel
|
* @brief PmuppXY::removeYlabel. Remove the y-label with name str.
|
||||||
* @param str
|
* @param str name of the y-label to be removed.
|
||||||
*/
|
*/
|
||||||
void PmuppXY::removeYlabel(QString str)
|
void PmuppXY::removeYlabel(QString str)
|
||||||
{
|
{
|
||||||
@ -113,11 +113,12 @@ void PmuppXY::removeYlabel(QString str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::getYlabel
|
* @brief PmuppXY::getYlabel. Get the y-label with index idx
|
||||||
* @param idx
|
* @param idx index of the requested y-label.
|
||||||
* @return
|
*
|
||||||
|
* @return requested y-label if found, empty string otherwise.
|
||||||
*/
|
*/
|
||||||
QString PmuppXY::getYlabel(int idx)
|
QString PmuppXY::getYlabel(int idx)
|
||||||
{
|
{
|
||||||
@ -127,10 +128,10 @@ QString PmuppXY::getYlabel(int idx)
|
|||||||
return fYlabel[idx];
|
return fYlabel[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::getXlabelIdx
|
* @brief PmuppXY::getXlabelIdx. Get the x-label index.
|
||||||
* @return
|
* @return x-label index if found, otherwise -1.
|
||||||
*/
|
*/
|
||||||
int PmuppXY::getXlabelIdx()
|
int PmuppXY::getXlabelIdx()
|
||||||
{
|
{
|
||||||
@ -157,11 +158,11 @@ int PmuppXY::getXlabelIdx()
|
|||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppXY::getYlabelIdx
|
* @brief PmuppXY::getYlabelIdx. Get y-label index of index idx.
|
||||||
* @param idx
|
* @param idx index of the y-label.
|
||||||
* @return
|
* @return y-label index on success, -1 otherwise.
|
||||||
*/
|
*/
|
||||||
int PmuppXY::getYlabelIdx(int idx)
|
int PmuppXY::getYlabelIdx(int idx)
|
||||||
{
|
{
|
||||||
@ -191,7 +192,7 @@ int PmuppXY::getYlabelIdx(int idx)
|
|||||||
return iidx;
|
return iidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Constructor
|
* <p>Constructor
|
||||||
*
|
*
|
||||||
@ -399,18 +400,19 @@ PmuppGui::PmuppGui( QStringList fln, QWidget *parent, Qt::WindowFlags f )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::~PmuppGui
|
* @brief PmuppGui::~PmuppGui. Dtor
|
||||||
*/
|
*/
|
||||||
PmuppGui::~PmuppGui()
|
PmuppGui::~PmuppGui()
|
||||||
{
|
{
|
||||||
// all relevant clean up job are done in ::aboutToQuit()
|
// all relevant clean up job are done in ::aboutToQuit()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::aboutToQuit
|
* @brief PmuppGui::aboutToQuit. Called when the GUI is going to close. Cleans
|
||||||
|
* up everything.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::aboutToQuit()
|
void PmuppGui::aboutToQuit()
|
||||||
{
|
{
|
||||||
@ -466,9 +468,9 @@ void PmuppGui::aboutToQuit()
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::setupFileActions
|
* @brief PmuppGui::setupFileActions. Setup the file action menus.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::setupFileActions()
|
void PmuppGui::setupFileActions()
|
||||||
{
|
{
|
||||||
@ -514,9 +516,9 @@ void PmuppGui::setupFileActions()
|
|||||||
menu->addAction(a);
|
menu->addAction(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::setupToolActions
|
* @brief PmuppGui::setupToolActions. Setup the tools action menu.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::setupToolActions()
|
void PmuppGui::setupToolActions()
|
||||||
{
|
{
|
||||||
@ -570,9 +572,9 @@ void PmuppGui::setupToolActions()
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::setupHelpActions
|
* @brief PmuppGui::setupHelpActions. Setup the help actions menu.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::setupHelpActions()
|
void PmuppGui::setupHelpActions()
|
||||||
{
|
{
|
||||||
@ -603,17 +605,17 @@ void PmuppGui::setupHelpActions()
|
|||||||
menu->addAction(a);
|
menu->addAction(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::fileOpen
|
* @brief PmuppGui::fileOpen. Open muSR parameter files.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::fileOpen()
|
void PmuppGui::fileOpen()
|
||||||
{
|
{
|
||||||
QStringList list = QFileDialog::getOpenFileNames(
|
QStringList list = QFileDialog::getOpenFileNames(
|
||||||
this,
|
this,
|
||||||
"muSR Parameter Files",
|
"muSR Parameter Files",
|
||||||
"./",
|
"./",
|
||||||
"db-files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; dat-Files (*.dat);; All (*)");
|
"db-files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; dat-Files (*.dat);; All (*)");
|
||||||
|
|
||||||
if (list.count() == 0)
|
if (list.count() == 0)
|
||||||
return;
|
return;
|
||||||
@ -651,9 +653,9 @@ void PmuppGui::fileOpen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::fileOpenRecent
|
* @brief PmuppGui::fileOpenRecent. Opens a selected recent file.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::fileOpenRecent()
|
void PmuppGui::fileOpenRecent()
|
||||||
{
|
{
|
||||||
@ -670,18 +672,18 @@ void PmuppGui::fileOpenRecent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::fileExit
|
* @brief PmuppGui::fileExit. Exit mupp
|
||||||
*/
|
*/
|
||||||
void PmuppGui::fileExit()
|
void PmuppGui::fileExit()
|
||||||
{
|
{
|
||||||
aboutToQuit();
|
aboutToQuit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::toolDump
|
* @brief PmuppGui::toolDump. Dumps collection for debug purposes.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::toolDumpCollections()
|
void PmuppGui::toolDumpCollections()
|
||||||
{
|
{
|
||||||
@ -692,7 +694,10 @@ void PmuppGui::toolDumpCollections()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::toolDumpXY. Dump XY objects for debug purposes.
|
||||||
|
*/
|
||||||
void PmuppGui::toolDumpXY()
|
void PmuppGui::toolDumpXY()
|
||||||
{
|
{
|
||||||
if (fXY.size() > 0) {
|
if (fXY.size() > 0) {
|
||||||
@ -708,15 +713,19 @@ void PmuppGui::toolDumpXY()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::normalize. SLOT called when menu Tools/Normalize is selected.
|
||||||
|
* Keeps the normalizer flag
|
||||||
|
*/
|
||||||
void PmuppGui::normalize()
|
void PmuppGui::normalize()
|
||||||
{
|
{
|
||||||
fNormalize = fNormalizeAction->isChecked();
|
fNormalize = fNormalizeAction->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::helpCmds
|
* @brief PmuppGui::helpCmds. help command information popup.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::helpCmds()
|
void PmuppGui::helpCmds()
|
||||||
{
|
{
|
||||||
@ -739,29 +748,30 @@ void PmuppGui::helpCmds()
|
|||||||
"<b>flush:</b> flush the history buffer.");
|
"<b>flush:</b> flush the history buffer.");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::helpAbout
|
* @brief PmuppGui::helpAbout. Help about message box.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::helpAbout()
|
void PmuppGui::helpAbout()
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, "about", QString("mupp: created by Andreas Suter.\nVersion: %1\nBranch: %2\nHash: %3").arg(MUPP_VERSION).arg(GIT_BRANCH).arg(GIT_COMMIT_HASH));
|
QMessageBox::information(this, "about", QString("mupp: created by Andreas Suter.\nVersion: %1\nBranch: %2\nHash: %3").arg(MUPP_VERSION).arg(GIT_BRANCH).arg(GIT_COMMIT_HASH));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::helpAboutQt
|
* @brief PmuppGui::helpAboutQt. Qt about message box.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::helpAboutQt()
|
void PmuppGui::helpAboutQt()
|
||||||
{
|
{
|
||||||
QMessageBox::aboutQt(this);
|
QMessageBox::aboutQt(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::eventFilter
|
* @brief PmuppGui::eventFilter. Event filter for the history buffer.
|
||||||
* @param o
|
* @param o object pointer
|
||||||
* @param e
|
* @param e event pointer
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool PmuppGui::eventFilter(QObject *o, QEvent *e)
|
bool PmuppGui::eventFilter(QObject *o, QEvent *e)
|
||||||
@ -805,14 +815,15 @@ bool PmuppGui::eventFilter(QObject *o, QEvent *e)
|
|||||||
return QMainWindow::eventFilter(o, e);
|
return QMainWindow::eventFilter(o, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::getTheme
|
* @brief PmuppGui::getTheme. Tries to get the theme of the system.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::getTheme()
|
void PmuppGui::getTheme()
|
||||||
{
|
{
|
||||||
fDarkTheme = false; // true if theme is dark
|
fDarkTheme = false; // true if theme is dark
|
||||||
fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons are dark, however the toolbar icons are plain!
|
fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons
|
||||||
|
// are dark, however the toolbar icons are plain!
|
||||||
|
|
||||||
QString str = QIcon::themeName();
|
QString str = QIcon::themeName();
|
||||||
|
|
||||||
@ -834,7 +845,7 @@ void PmuppGui::getTheme()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>fill the recent file list in the menu.
|
* <p>fill the recent file list in the menu.
|
||||||
*/
|
*/
|
||||||
@ -846,9 +857,10 @@ void PmuppGui::fillRecentFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::readCmdHistory
|
* @brief PmuppGui::readCmdHistory. Read the command history from file
|
||||||
|
* mupp_history.txt under $HOME/.musrfit/mupp
|
||||||
*/
|
*/
|
||||||
void PmuppGui::readCmdHistory()
|
void PmuppGui::readCmdHistory()
|
||||||
{
|
{
|
||||||
@ -880,7 +892,10 @@ void PmuppGui::readCmdHistory()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::writeCmdHistory. Write the command history buffer to file.
|
||||||
|
*/
|
||||||
void PmuppGui::writeCmdHistory()
|
void PmuppGui::writeCmdHistory()
|
||||||
{
|
{
|
||||||
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
|
||||||
@ -916,9 +931,9 @@ void PmuppGui::writeCmdHistory()
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::refresh
|
* @brief PmuppGui::refresh. Refresh the collections, i.e. re-read it from file.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::refresh()
|
void PmuppGui::refresh()
|
||||||
{
|
{
|
||||||
@ -979,9 +994,9 @@ void PmuppGui::refresh()
|
|||||||
updateXYListGui();
|
updateXYListGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::remove
|
* @brief PmuppGui::remove. Remove collection from data handler and GUI.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::remove()
|
void PmuppGui::remove()
|
||||||
{
|
{
|
||||||
@ -1024,9 +1039,10 @@ void PmuppGui::remove()
|
|||||||
updateXYListGui();
|
updateXYListGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::addX
|
* @brief PmuppGui::addX add param to x-axis
|
||||||
|
* @param param name of the parameter
|
||||||
*/
|
*/
|
||||||
void PmuppGui::addX(QString param)
|
void PmuppGui::addX(QString param)
|
||||||
{
|
{
|
||||||
@ -1066,9 +1082,10 @@ void PmuppGui::addX(QString param)
|
|||||||
fXY.push_back(xyItem);
|
fXY.push_back(xyItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::addY
|
* @brief PmuppGui::addY add param to y-labels
|
||||||
|
* @param param name of the parameter
|
||||||
*/
|
*/
|
||||||
void PmuppGui::addY(QString param)
|
void PmuppGui::addY(QString param)
|
||||||
{
|
{
|
||||||
@ -1122,9 +1139,10 @@ void PmuppGui::addY(QString param)
|
|||||||
fXY[idx].addYlabel(yLabel);
|
fXY[idx].addYlabel(yLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::removeX
|
* @brief PmuppGui::removeX. remove from the x-axis
|
||||||
|
* @param param x-axis parameter name to be removed
|
||||||
*/
|
*/
|
||||||
void PmuppGui::removeX(QString param)
|
void PmuppGui::removeX(QString param)
|
||||||
{
|
{
|
||||||
@ -1149,9 +1167,10 @@ void PmuppGui::removeX(QString param)
|
|||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::removeY
|
* @brief PmuppGui::removeY. remove from the y-axis
|
||||||
|
* @param param y-axis paramter name to be removed.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::removeY(QString param)
|
void PmuppGui::removeY(QString param)
|
||||||
{
|
{
|
||||||
@ -1175,9 +1194,10 @@ void PmuppGui::removeY(QString param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::addDitto
|
* @brief PmuppGui::addDitto. Add x-/y-axis settings present for selected
|
||||||
|
* collection.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::addDitto()
|
void PmuppGui::addDitto()
|
||||||
{
|
{
|
||||||
@ -1233,7 +1253,11 @@ void PmuppGui::addDitto()
|
|||||||
fColList->clearSelection();
|
fColList->clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::addVar. Add a variable. A variable is an expression of
|
||||||
|
* variables present in the collection.
|
||||||
|
*/
|
||||||
void PmuppGui::addVar()
|
void PmuppGui::addVar()
|
||||||
{
|
{
|
||||||
// create collection list
|
// create collection list
|
||||||
@ -1258,10 +1282,15 @@ void PmuppGui::addVar()
|
|||||||
connect(fVarDlg, SIGNAL(add_request(QString,QVector<int>)), this, SLOT(add(QString,QVector<int>)));
|
connect(fVarDlg, SIGNAL(add_request(QString,QVector<int>)), this, SLOT(add(QString,QVector<int>)));
|
||||||
}
|
}
|
||||||
fVarDlg->show();
|
fVarDlg->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::check a variable string syntactically and sementically for
|
||||||
|
* validity.
|
||||||
|
* @param varStr var string to be parsed.
|
||||||
|
* @param idx vector of indices telling which collections have been selected.
|
||||||
|
*/
|
||||||
void PmuppGui::check(QString varStr, QVector<int> idx)
|
void PmuppGui::check(QString varStr, QVector<int> idx)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@ -1297,18 +1326,23 @@ void PmuppGui::check(QString varStr, QVector<int> idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PmuppGui::add a variable to the GUI for given collections.
|
||||||
|
* @param varStr variable string to be parsed.
|
||||||
|
* @param idx vector of indices telling which collections have been selected.
|
||||||
|
*/
|
||||||
void PmuppGui::add(QString varStr, QVector<int> idx)
|
void PmuppGui::add(QString varStr, QVector<int> idx)
|
||||||
{
|
{
|
||||||
|
// STILL TO BE IMPLEMENTED
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::findValue
|
* @brief PmuppGui::findValue check if run is found x-/y-axis
|
||||||
* @param run
|
* @param run which is searched
|
||||||
* @param tag
|
* @param tag x-/y-axis selector
|
||||||
* @return
|
* @return true if found
|
||||||
*/
|
*/
|
||||||
bool PmuppGui::findValue(PmuppRun &run, EAxis tag)
|
bool PmuppGui::findValue(PmuppRun &run, EAxis tag)
|
||||||
{
|
{
|
||||||
@ -1339,10 +1373,10 @@ bool PmuppGui::findValue(PmuppRun &run, EAxis tag)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::allXYEqual
|
* @brief PmuppGui::allXYEqual. Check that all x-/y-labels present are equal.
|
||||||
* @return
|
* @return true if this is the case.
|
||||||
*/
|
*/
|
||||||
bool PmuppGui::allXYEqual()
|
bool PmuppGui::allXYEqual()
|
||||||
{
|
{
|
||||||
@ -1384,11 +1418,12 @@ bool PmuppGui::allXYEqual()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::indexAlreadyPresent
|
* @brief PmuppGui::indexAlreadyPresent. Check if x-label as given by idx is
|
||||||
* @param idx
|
* already present.
|
||||||
* @return
|
* @param idx which gets the x-label.
|
||||||
|
* @return true, if found.
|
||||||
*/
|
*/
|
||||||
bool PmuppGui::indexAlreadyPresent(const int idx)
|
bool PmuppGui::indexAlreadyPresent(const int idx)
|
||||||
{
|
{
|
||||||
@ -1402,11 +1437,11 @@ bool PmuppGui::indexAlreadyPresent(const int idx)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::replaceIndex
|
* @brief PmuppGui::replaceIndex replace xy-object at position idx.
|
||||||
* @param data
|
* @param data xy-object to be replaced
|
||||||
* @param idx
|
* @param idx index position where data needs to be replaced.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::replaceIndex(PmuppXY &data, const int idx)
|
void PmuppGui::replaceIndex(PmuppXY &data, const int idx)
|
||||||
{
|
{
|
||||||
@ -1430,11 +1465,11 @@ void PmuppGui::replaceIndex(PmuppXY &data, const int idx)
|
|||||||
data.setCollectionTag(idx);
|
data.setCollectionTag(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::getXlabelIndex
|
* @brief PmuppGui::getXlabelIndex. Get x-label index for a given search label.
|
||||||
* @param label
|
* @param label for which the index is searched for.
|
||||||
* @return
|
* @return idx of the searched label on success, -1 otherwise.
|
||||||
*/
|
*/
|
||||||
int PmuppGui::getXlabelIndex(QString label)
|
int PmuppGui::getXlabelIndex(QString label)
|
||||||
{
|
{
|
||||||
@ -1450,10 +1485,10 @@ int PmuppGui::getXlabelIndex(QString label)
|
|||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::dropOnViewX
|
* @brief PmuppGui::dropOnViewX. Drag and drop for x-axis.
|
||||||
* @param item
|
* @param item to be dropped.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::dropOnViewX(QListWidgetItem *item)
|
void PmuppGui::dropOnViewX(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
@ -1486,10 +1521,10 @@ void PmuppGui::dropOnViewX(QListWidgetItem *item)
|
|||||||
fXY.push_back(xyItem);
|
fXY.push_back(xyItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::dropOnViewY
|
* @brief PmuppGui::dropOnViewY. Drag and drop for y-axis.
|
||||||
* @param item
|
* @param item to be dropped.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::dropOnViewY(QListWidgetItem *item)
|
void PmuppGui::dropOnViewY(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
@ -1530,9 +1565,9 @@ void PmuppGui::dropOnViewY(QListWidgetItem *item)
|
|||||||
fXY[idx].addYlabel(yLabel);
|
fXY[idx].addYlabel(yLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::refreshY
|
* @brief PmuppGui::refreshY. Refresh the y-axis objects.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::refreshY()
|
void PmuppGui::refreshY()
|
||||||
{
|
{
|
||||||
@ -1553,9 +1588,9 @@ void PmuppGui::refreshY()
|
|||||||
fViewY->addItem(fXY[idx].getYlabel(i));
|
fViewY->addItem(fXY[idx].getYlabel(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::createMacro
|
* @brief PmuppGui::createMacro. create a root macro based on the current settings.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::createMacro()
|
void PmuppGui::createMacro()
|
||||||
{
|
{
|
||||||
@ -1737,9 +1772,10 @@ void PmuppGui::createMacro()
|
|||||||
fMacroName = QString("");
|
fMacroName = QString("");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::plot
|
* @brief PmuppGui::plot. plot all the requested x-/y-axis settings. It first
|
||||||
|
* prepares all necessary data sets, afterwards is calling mupp_plotter.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::plot()
|
void PmuppGui::plot()
|
||||||
{
|
{
|
||||||
@ -1912,9 +1948,9 @@ void PmuppGui::plot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::startMuppPlot
|
* @brief PmuppGui::startMuppPlot start the mupp_plotter
|
||||||
*/
|
*/
|
||||||
void PmuppGui::startMuppPlot()
|
void PmuppGui::startMuppPlot()
|
||||||
{
|
{
|
||||||
@ -1951,9 +1987,9 @@ void PmuppGui::startMuppPlot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::handleCmds
|
* @brief PmuppGui::handleCmds. Handles the commands form the command line.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::handleCmds()
|
void PmuppGui::handleCmds()
|
||||||
{
|
{
|
||||||
@ -2067,9 +2103,9 @@ void PmuppGui::handleCmds()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::handleNewData
|
* @brief PmuppGui::handleNewData. Handle new data from the fParamDataHandler.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::handleNewData()
|
void PmuppGui::handleNewData()
|
||||||
{
|
{
|
||||||
@ -2077,9 +2113,9 @@ void PmuppGui::handleNewData()
|
|||||||
updateCollectionList();
|
updateCollectionList();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::updateCollectionList
|
* @brief PmuppGui::updateCollectionList. update collection list.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::updateCollectionList()
|
void PmuppGui::updateCollectionList()
|
||||||
{
|
{
|
||||||
@ -2094,10 +2130,11 @@ void PmuppGui::updateCollectionList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::updateParamList
|
* @brief PmuppGui::updateParamList. Update parameter list of the selected
|
||||||
* @param currentRow
|
* collection defined by currentRow.
|
||||||
|
* @param currentRow is the index of the selected collection.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::updateParamList(int currentRow)
|
void PmuppGui::updateParamList(int currentRow)
|
||||||
{
|
{
|
||||||
@ -2122,9 +2159,9 @@ void PmuppGui::updateParamList(int currentRow)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::updateXYList
|
* @brief PmuppGui::updateXYList. Update xy-objects.
|
||||||
* @param idx collection index which has been removed
|
* @param idx collection index which has been removed
|
||||||
*/
|
*/
|
||||||
void PmuppGui::updateXYList(int idx)
|
void PmuppGui::updateXYList(int idx)
|
||||||
@ -2165,9 +2202,10 @@ void PmuppGui::updateXYList(int idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::updateXYListGui
|
* @brief PmuppGui::updateXYListGui. Update x-axis settings. This is needed
|
||||||
|
* after a remove or refresh.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::updateXYListGui()
|
void PmuppGui::updateXYListGui()
|
||||||
{
|
{
|
||||||
@ -2180,11 +2218,11 @@ void PmuppGui::updateXYListGui()
|
|||||||
fViewX->setCurrentRow(0);
|
fViewX->setCurrentRow(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::isNewCollection
|
* @brief PmuppGui::isNewCollection. Check if coll is a new collection.
|
||||||
* @param coll
|
* @param coll collection which needs to be searched for.
|
||||||
* @return
|
* @return true if present, flase otherwise.
|
||||||
*/
|
*/
|
||||||
bool PmuppGui::isNewCollection(PmuppCollection &coll)
|
bool PmuppGui::isNewCollection(PmuppCollection &coll)
|
||||||
{
|
{
|
||||||
@ -2194,10 +2232,10 @@ bool PmuppGui::isNewCollection(PmuppCollection &coll)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::editCollName
|
* @brief PmuppGui::editCollName allow to edit the collection name.
|
||||||
* @param item
|
* @param item from the listWidget.
|
||||||
*/
|
*/
|
||||||
void PmuppGui::editCollName(QListWidgetItem *item)
|
void PmuppGui::editCollName(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
@ -2212,12 +2250,12 @@ void PmuppGui::editCollName(QListWidgetItem *item)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::getMinMax
|
* @brief PmuppGui::getMinMax. Get minimum and maximum from data set.
|
||||||
* @param data
|
* @param data data set
|
||||||
* @param min
|
* @param min minimum of data
|
||||||
* @param max
|
* @param max maximum of data
|
||||||
*/
|
*/
|
||||||
void PmuppGui::getMinMax(QVector<double> &data, double &min, double &max)
|
void PmuppGui::getMinMax(QVector<double> &data, double &min, double &max)
|
||||||
{
|
{
|
||||||
@ -2229,11 +2267,12 @@ void PmuppGui::getMinMax(QVector<double> &data, double &min, double &max)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::substituteDefaultLabels
|
* @brief PmuppGui::substituteDefaultLabels. Substitutes default labels, like
|
||||||
* @param label
|
* sigma -> #sigma to make the plot nicer.
|
||||||
* @return
|
* @param label to be checked to prettify.
|
||||||
|
* @return prettified label string.
|
||||||
*/
|
*/
|
||||||
QString PmuppGui::substituteDefaultLabels(QString label)
|
QString PmuppGui::substituteDefaultLabels(QString label)
|
||||||
{
|
{
|
||||||
@ -2279,10 +2318,11 @@ QString PmuppGui::substituteDefaultLabels(QString label)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::selectCollection
|
* @brief PmuppGui::selectCollection. Called from the command line. It allows to
|
||||||
* @param cmd
|
* select a collection.
|
||||||
|
* @param cmd string to select a collection
|
||||||
*/
|
*/
|
||||||
void PmuppGui::selectCollection(QString cmd)
|
void PmuppGui::selectCollection(QString cmd)
|
||||||
{
|
{
|
||||||
@ -2317,10 +2357,11 @@ void PmuppGui::selectCollection(QString cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppGui::getFirstAvailableMuppInstance
|
* @brief PmuppGui::getFirstAvailableMuppInstance. Get the first free mupp
|
||||||
* @return
|
* instance of the mupp <-> mupp_plotter ICP message queue
|
||||||
|
* @return the first free instance.
|
||||||
*/
|
*/
|
||||||
uint PmuppGui::getFirstAvailableMuppInstance()
|
uint PmuppGui::getFirstAvailableMuppInstance()
|
||||||
{
|
{
|
||||||
|
@ -52,6 +52,9 @@
|
|||||||
#include "mupp.h"
|
#include "mupp.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief The PmuppXY class.
|
||||||
|
*/
|
||||||
class PmuppXY
|
class PmuppXY
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -94,6 +97,8 @@ private:
|
|||||||
// | |----------------------------------------------------------------| |
|
// | |----------------------------------------------------------------| |
|
||||||
// | |
|
// | |
|
||||||
// | |----------------------------------------------------------------| |
|
// | |----------------------------------------------------------------| |
|
||||||
|
// | | History | |
|
||||||
|
// | |----------------------------------------------------------------| |
|
||||||
// | | Cmd | |
|
// | | Cmd | |
|
||||||
// | |----------------------------------------------------------------| |
|
// | |----------------------------------------------------------------| |
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
@ -180,11 +185,11 @@ private:
|
|||||||
QLineEdit *fCmdLine;
|
QLineEdit *fCmdLine;
|
||||||
QPushButton *fExitButton;
|
QPushButton *fExitButton;
|
||||||
|
|
||||||
QVector<QString> fCmdHistory;
|
QVector<QString> fCmdHistory; ///< command history buffer
|
||||||
|
|
||||||
PVarDialog *fVarDlg;
|
PVarDialog *fVarDlg; ///< variable dialog
|
||||||
|
|
||||||
QProcess *fMuppPlot;
|
QProcess *fMuppPlot; ///< mupp plotter
|
||||||
|
|
||||||
void setupFileActions();
|
void setupFileActions();
|
||||||
void setupToolActions();
|
void setupToolActions();
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::PmuppScript
|
* @brief PmuppScript::PmuppScript. Ctor
|
||||||
* @param script
|
* @param script source
|
||||||
*/
|
*/
|
||||||
PmuppScript::PmuppScript(QStringList script) :
|
PmuppScript::PmuppScript(QStringList script) :
|
||||||
fScript(script)
|
fScript(script)
|
||||||
@ -59,7 +59,7 @@ PmuppScript::PmuppScript(QStringList script) :
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::~PmuppScript
|
* @brief PmuppScript::~PmuppScript. Dtor
|
||||||
*/
|
*/
|
||||||
PmuppScript::~PmuppScript()
|
PmuppScript::~PmuppScript()
|
||||||
{
|
{
|
||||||
@ -75,8 +75,8 @@ PmuppScript::~PmuppScript()
|
|||||||
}
|
}
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::executeScript
|
* @brief PmuppScript::executeScript. Handles the script commands.
|
||||||
* @return
|
* @return 0 on success.
|
||||||
*/
|
*/
|
||||||
int PmuppScript::executeScript()
|
int PmuppScript::executeScript()
|
||||||
{
|
{
|
||||||
@ -132,8 +132,9 @@ int PmuppScript::executeScript()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::setLoadPath
|
* @brief PmuppScript::setLoadPath. Sets the load path (where to look for input
|
||||||
* @param cmd
|
* data.
|
||||||
|
* @param cmd set load path command string.
|
||||||
*/
|
*/
|
||||||
void PmuppScript::setLoadPath(const QString cmd)
|
void PmuppScript::setLoadPath(const QString cmd)
|
||||||
{
|
{
|
||||||
@ -165,8 +166,9 @@ void PmuppScript::setLoadPath(const QString cmd)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::setSavePath
|
* @brief PmuppScript::setSavePath. Sets the save path (where to save the output
|
||||||
* @param cmd
|
* files.
|
||||||
|
* @param cmd save path command string.
|
||||||
*/
|
*/
|
||||||
void PmuppScript::setSavePath(const QString cmd)
|
void PmuppScript::setSavePath(const QString cmd)
|
||||||
{
|
{
|
||||||
@ -198,9 +200,9 @@ void PmuppScript::setSavePath(const QString cmd)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::loadCollection
|
* @brief PmuppScript::loadCollection. Load collection command
|
||||||
* @param str
|
* @param str load collection command string
|
||||||
* @return
|
* @return 0 on success.
|
||||||
*/
|
*/
|
||||||
int PmuppScript::loadCollection(const QString str)
|
int PmuppScript::loadCollection(const QString str)
|
||||||
{
|
{
|
||||||
@ -220,9 +222,9 @@ int PmuppScript::loadCollection(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::select
|
* @brief PmuppScript::select. Select collection command.
|
||||||
* @param str
|
* @param str selection command string
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::select(const QString str)
|
int PmuppScript::select(const QString str)
|
||||||
{
|
{
|
||||||
@ -259,8 +261,8 @@ int PmuppScript::select(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::selectAll
|
* @brief PmuppScript::selectAll. Select all collections
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::selectAll()
|
int PmuppScript::selectAll()
|
||||||
{
|
{
|
||||||
@ -277,9 +279,9 @@ int PmuppScript::selectAll()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::addX
|
* @brief PmuppScript::addX. Add label to x-axis
|
||||||
* @param str
|
* @param str label string
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::addX(const QString str)
|
int PmuppScript::addX(const QString str)
|
||||||
{
|
{
|
||||||
@ -374,9 +376,9 @@ int PmuppScript::addX(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::addY
|
* @brief PmuppScript::addY. Add label to y-axis.
|
||||||
* @param str
|
* @param str label string
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::addY(const QString str)
|
int PmuppScript::addY(const QString str)
|
||||||
{
|
{
|
||||||
@ -490,9 +492,9 @@ int PmuppScript::addY(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::plot
|
* @brief PmuppScript::plot. Create root macro and feed it to root in the bash mode.
|
||||||
* @param str
|
* @param str plot script command string
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::plot(const QString str)
|
int PmuppScript::plot(const QString str)
|
||||||
{
|
{
|
||||||
@ -543,10 +545,11 @@ int PmuppScript::plot(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::macro
|
* @brief PmuppScript::macro. Create a root macro
|
||||||
* @param str
|
* @param str macro string command string
|
||||||
* @param plotFln
|
* @param plotFln plot file name. Depending on the extension (*.png, *.pdf, ...)
|
||||||
* @return
|
* the given a file will be created.
|
||||||
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::macro(const QString str, const QString plotFln)
|
int PmuppScript::macro(const QString str, const QString plotFln)
|
||||||
{
|
{
|
||||||
@ -773,9 +776,9 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::var_cmd
|
* @brief PmuppScript::var_cmd. Variable definition command
|
||||||
* @param str
|
* @param str variable definition command string
|
||||||
* @return
|
* @return 0 on success
|
||||||
*/
|
*/
|
||||||
int PmuppScript::var_cmd(const QString str)
|
int PmuppScript::var_cmd(const QString str)
|
||||||
{
|
{
|
||||||
@ -831,9 +834,9 @@ int PmuppScript::var_cmd(const QString str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::foundLabel
|
* @brief PmuppScript::foundLabel find label in collection coll.
|
||||||
* @param coll
|
* @param coll collection object
|
||||||
* @return
|
* @return true if found
|
||||||
*/
|
*/
|
||||||
bool PmuppScript::foundLabel(PmuppCollection *coll, const QString label)
|
bool PmuppScript::foundLabel(PmuppCollection *coll, const QString label)
|
||||||
{
|
{
|
||||||
@ -850,9 +853,10 @@ bool PmuppScript::foundLabel(PmuppCollection *coll, const QString label)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::foundVariable
|
* @brief PmuppScript::foundVariable. Check if a variable is found in the
|
||||||
* @param var
|
* variable handler.
|
||||||
* @return
|
* @param var variable name
|
||||||
|
* @return true if found
|
||||||
*/
|
*/
|
||||||
bool PmuppScript::foundVariable(const QString var)
|
bool PmuppScript::foundVariable(const QString var)
|
||||||
{
|
{
|
||||||
@ -869,9 +873,10 @@ bool PmuppScript::foundVariable(const QString var)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::getVarIndex
|
* @brief PmuppScript::getVarIndex. Get index of the variable object given by
|
||||||
* @param var
|
* its name.
|
||||||
* @return
|
* @param var variable name searched for
|
||||||
|
* @return idx of found, -1 otherwise
|
||||||
*/
|
*/
|
||||||
int PmuppScript::getVarIndex(const QString var)
|
int PmuppScript::getVarIndex(const QString var)
|
||||||
{
|
{
|
||||||
@ -888,9 +893,10 @@ int PmuppScript::getVarIndex(const QString var)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::minMax
|
* @brief PmuppScript::minMax get minimum and maximum of the data set.
|
||||||
* @param min
|
* @param dvec data set vector
|
||||||
* @param max
|
* @param min resulting minimum
|
||||||
|
* @param max resulting maximum
|
||||||
*/
|
*/
|
||||||
void PmuppScript::minMax(QVector<double> dvec, double &min, double &max)
|
void PmuppScript::minMax(QVector<double> dvec, double &min, double &max)
|
||||||
{
|
{
|
||||||
@ -906,9 +912,9 @@ void PmuppScript::minMax(QVector<double> dvec, double &min, double &max)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::getNicerLabel
|
* @brief PmuppScript::getNicerLabel. Prettify the labels.
|
||||||
* @param label
|
* @param label to be prettified
|
||||||
* @return
|
* @return prettified label
|
||||||
*/
|
*/
|
||||||
QString PmuppScript::getNicerLabel(const QString label)
|
QString PmuppScript::getNicerLabel(const QString label)
|
||||||
{
|
{
|
||||||
@ -956,9 +962,9 @@ QString PmuppScript::getNicerLabel(const QString label)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief PmuppScript::getCollectionIndex
|
* @brief PmuppScript::getCollectionIndex. Get the index of a collection.
|
||||||
* @param var_name
|
* @param var_name name of the collection
|
||||||
* @return
|
* @return idx on success, -1 otherwise
|
||||||
*/
|
*/
|
||||||
int PmuppScript::getCollectionIndex(const QString var_name)
|
int PmuppScript::getCollectionIndex(const QString var_name)
|
||||||
{
|
{
|
||||||
|
@ -37,12 +37,18 @@
|
|||||||
#include "Pmupp.h"
|
#include "Pmupp.h"
|
||||||
#include "PVarHandler.h"
|
#include "PVarHandler.h"
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int collIdx;
|
int collIdx; ///< collection index
|
||||||
QString xLabel;
|
QString xLabel; ///< x-axis label
|
||||||
QVector<QString> yLabel;
|
QVector<QString> yLabel; ///< y-axis label(s)
|
||||||
} PmuppPlotEntry;
|
} PmuppPlotEntry;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief The PmuppScript class. mupp script class which is used as a scripting
|
||||||
|
* interface for mupp.
|
||||||
|
*/
|
||||||
class PmuppScript : public QObject
|
class PmuppScript : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -73,20 +79,20 @@ class PmuppScript : public QObject
|
|||||||
void finished();
|
void finished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PmuppAdmin *fAdmin;
|
PmuppAdmin *fAdmin; ///< admin object
|
||||||
|
|
||||||
QStringList fScript;
|
QStringList fScript; ///< script source
|
||||||
PParamDataHandler *fParamDataHandler;
|
PParamDataHandler *fParamDataHandler; ///< parameter data handler
|
||||||
int fSelected; ///< -2=nothing selected, -1=all selected, >=0 is the index if the selected collection
|
int fSelected; ///< -2=nothing selected, -1=all selected, >=0 is the index if the selected collection
|
||||||
|
|
||||||
PmuppPlotEntry fPlotEntry;
|
PmuppPlotEntry fPlotEntry; ///< plot entry object
|
||||||
QVector<PmuppPlotEntry> fPlotInfo;
|
QVector<PmuppPlotEntry> fPlotInfo; ///< vector of all plot entry objects
|
||||||
|
|
||||||
bool fNorm;
|
bool fNorm; ///< normalization flag, true -> normalize y-data before plotting.
|
||||||
QString fLoadPath;
|
QString fLoadPath; ///< load path specifying where to look for data.
|
||||||
QString fSavePath;
|
QString fSavePath; ///< save path specifying where to save data.
|
||||||
|
|
||||||
QVector<PVarHandler> fVarHandler;
|
QVector<PVarHandler> fVarHandler; ///< variable handler vector
|
||||||
|
|
||||||
bool foundLabel(PmuppCollection *coll, const QString label);
|
bool foundLabel(PmuppCollection *coll, const QString label);
|
||||||
bool foundVariable(const QString var);
|
bool foundVariable(const QString var);
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief mupp_script_syntax
|
* <p>mupp script help.
|
||||||
*/
|
*/
|
||||||
void mupp_script_syntax()
|
void mupp_script_syntax()
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ void mupp_script_syntax()
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief mupp_syntax
|
* <p>mupp syntax help.
|
||||||
*/
|
*/
|
||||||
void mupp_syntax()
|
void mupp_syntax()
|
||||||
{
|
{
|
||||||
@ -103,10 +103,12 @@ void mupp_syntax()
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief mupp_scrript_read
|
* <p>Reads a mupp script and feeds its content to list.
|
||||||
* @param fln
|
*
|
||||||
* @param list
|
* @param fln mupp script file name
|
||||||
* @return
|
* @param list content of the mupp script
|
||||||
|
*
|
||||||
|
* @return 0 if success, otherwise -1
|
||||||
*/
|
*/
|
||||||
int mupp_script_read(const char *fln, QStringList &list)
|
int mupp_script_read(const char *fln, QStringList &list)
|
||||||
{
|
{
|
||||||
@ -149,9 +151,11 @@ int mupp_script_read(const char *fln, QStringList &list)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief mupp_bash_variable_exists
|
* <p>check if a bash environment variable exists.
|
||||||
* @param str
|
*
|
||||||
* @return
|
* @param str name of bash variable to be checked.
|
||||||
|
*
|
||||||
|
* @return true if the bash variable exists, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool mupp_bash_variable_exists(const QString str)
|
bool mupp_bash_variable_exists(const QString str)
|
||||||
{
|
{
|
||||||
@ -168,9 +172,11 @@ bool mupp_bash_variable_exists(const QString str)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief mupp_script_syntax_check
|
* <p>checks the mupp script syntax.
|
||||||
* @param list
|
*
|
||||||
* @return
|
* @param list mupp script content.
|
||||||
|
*
|
||||||
|
* @return 0 on success, negative numbers otherwise.
|
||||||
*/
|
*/
|
||||||
int mupp_script_syntax_check(QStringList &list)
|
int mupp_script_syntax_check(QStringList &list)
|
||||||
{
|
{
|
||||||
@ -428,11 +434,14 @@ int mupp_script_syntax_check(QStringList &list)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief createApplication
|
* <p>Depending on whether a script or gui application is wished, select
|
||||||
|
* the proper Qt application class.
|
||||||
|
*
|
||||||
* @param argc
|
* @param argc
|
||||||
* @param argv
|
* @param argv
|
||||||
* @param gui
|
* @param gui if true, the gui is wanted, otherwise the script is called.
|
||||||
* @return
|
*
|
||||||
|
* @return the request qt application
|
||||||
*/
|
*/
|
||||||
QCoreApplication* createApplication(int &argc, char *argv[], bool gui)
|
QCoreApplication* createApplication(int &argc, char *argv[], bool gui)
|
||||||
{
|
{
|
||||||
@ -444,10 +453,15 @@ QCoreApplication* createApplication(int &argc, char *argv[], bool gui)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief main
|
* <p>Main mupp application. mupp stands for muon parameter plotter. It allows
|
||||||
|
* to plot the parameters of db- or dat-files. The typical use case is e.g.
|
||||||
|
* plotting parameters of muSR fits as function of temperature, pressure,
|
||||||
|
* energy, etc.
|
||||||
|
*
|
||||||
* @param argc
|
* @param argc
|
||||||
* @param argv
|
* @param argv
|
||||||
* @return
|
*
|
||||||
|
* @return return value of the Qt application
|
||||||
*/
|
*/
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user