some more work towards a theory block handler
This commit is contained in:
parent
c34679e350
commit
eef0dac3a9
@ -29,8 +29,6 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
|
|
||||||
#include "PAdmin.h"
|
#include "PAdmin.h"
|
||||||
@ -46,6 +44,7 @@
|
|||||||
PAdminXMLParser::PAdminXMLParser(PAdmin *admin) : fAdmin(admin)
|
PAdminXMLParser::PAdminXMLParser(PAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
fFunc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -84,6 +83,28 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
|||||||
fKeyWord = eMsrDefaultFilePath;
|
fKeyWord = eMsrDefaultFilePath;
|
||||||
} else if (qName == "help_main") {
|
} else if (qName == "help_main") {
|
||||||
fKeyWord = eHelpMain;
|
fKeyWord = eHelpMain;
|
||||||
|
} else if (qName == "func_pixmap_path") {
|
||||||
|
fKeyWord = eTheoFuncPixmapPath;
|
||||||
|
} else if (qName == "func") {
|
||||||
|
fKeyWord = eFunc;
|
||||||
|
fFunc = true;
|
||||||
|
// init theory item
|
||||||
|
fTheoryItem.name = "";
|
||||||
|
fTheoryItem.comment = "";
|
||||||
|
fTheoryItem.label = "";
|
||||||
|
fTheoryItem.pixmapName = "";
|
||||||
|
fTheoryItem.pixmap = 0;
|
||||||
|
fTheoryItem.params = -1;
|
||||||
|
} else if (qName == "name") {
|
||||||
|
fKeyWord = eFuncName;
|
||||||
|
} else if (qName == "comment") {
|
||||||
|
fKeyWord = eFuncComment;
|
||||||
|
} else if (qName == "label") {
|
||||||
|
fKeyWord = eFuncLabel;
|
||||||
|
} else if (qName == "pixmap") {
|
||||||
|
fKeyWord = eFuncPixmap;
|
||||||
|
} else if (qName == "params") {
|
||||||
|
fKeyWord = eFuncParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -94,10 +115,15 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
|||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'.
|
* put the filtering tag to 'empty'.
|
||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::endElement( const QString&, const QString&, const QString& )
|
bool PAdminXMLParser::endElement( const QString&, const QString&, const QString &qName )
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
if (qName == "func") {
|
||||||
|
fFunc = false;
|
||||||
|
fAdmin->addTheoryItem(fTheoryItem);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,10 +168,38 @@ bool PAdminXMLParser::characters(const QString& str)
|
|||||||
help.replace("<", "<");
|
help.replace("<", "<");
|
||||||
fAdmin->setHelpMain(help);
|
fAdmin->setHelpMain(help);
|
||||||
break;
|
break;
|
||||||
|
case eTheoFuncPixmapPath:
|
||||||
|
fAdmin->setTheoFuncPixmapPath(QString(str.ascii()).stripWhiteSpace());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fFunc) {
|
||||||
|
bool ok;
|
||||||
|
switch (fKeyWord) {
|
||||||
|
case eFuncName:
|
||||||
|
fTheoryItem.name = QString(str.latin1()).stripWhiteSpace();
|
||||||
|
break;
|
||||||
|
case eFuncComment:
|
||||||
|
fTheoryItem.comment = QString(str.latin1()).stripWhiteSpace();
|
||||||
|
break;
|
||||||
|
case eFuncLabel:
|
||||||
|
fTheoryItem.label = QString(str.latin1()).stripWhiteSpace();
|
||||||
|
break;
|
||||||
|
case eFuncPixmap:
|
||||||
|
fTheoryItem.pixmapName = QString(str.latin1()).stripWhiteSpace();
|
||||||
|
break;
|
||||||
|
case eFuncParams:
|
||||||
|
fTheoryItem.params = str.toInt(&ok);
|
||||||
|
if (!ok)
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,6 +224,7 @@ PAdmin::PAdmin()
|
|||||||
{
|
{
|
||||||
fExecPath = QString("");
|
fExecPath = QString("");
|
||||||
fDefaultSavePath = QString("");
|
fDefaultSavePath = QString("");
|
||||||
|
fTheoFuncPixmapPath = QString("");
|
||||||
|
|
||||||
fBeamline = QString("");
|
fBeamline = QString("");
|
||||||
fInstitute = QString("");
|
fInstitute = QString("");
|
||||||
@ -192,6 +247,20 @@ PAdmin::PAdmin()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// implementation of PAdmin class
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
PTheory* PAdmin::getTheoryItem(const unsigned int idx)
|
||||||
|
{
|
||||||
|
if (idx > fTheory.size())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return &fTheory[idx];
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// END
|
// END
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
@ -33,11 +33,22 @@
|
|||||||
#define _PADMIN_H_
|
#define _PADMIN_H_
|
||||||
|
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
#include <qptrlist.h>
|
#include <qvaluevector.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
#include <qxml.h>
|
#include <qxml.h>
|
||||||
|
|
||||||
class PAdmin;
|
class PAdmin;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
typedef struct {
|
||||||
|
QString name;
|
||||||
|
QString comment;
|
||||||
|
QString label;
|
||||||
|
QString pixmapName;
|
||||||
|
QPixmap pixmap;
|
||||||
|
int params;
|
||||||
|
} PTheory;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class PAdminXMLParser : public QXmlDefaultHandler
|
class PAdminXMLParser : public QXmlDefaultHandler
|
||||||
{
|
{
|
||||||
@ -47,8 +58,8 @@ class PAdminXMLParser : public QXmlDefaultHandler
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
enum EAdminKeyWords {eEmpty, eExecPath, eDefaultSavePath, eBeamline, eInstitute, eFileFormat,
|
enum EAdminKeyWords {eEmpty, eExecPath, eDefaultSavePath, eBeamline, eInstitute, eFileFormat,
|
||||||
eLifetimeCorrection, eMsrDefaultFilePath,
|
eLifetimeCorrection, eMsrDefaultFilePath, eHelpMain, eTheoFuncPixmapPath,
|
||||||
eHelpMain};
|
eFunc, eFuncName, eFuncComment, eFuncLabel, eFuncPixmap, eFuncParams};
|
||||||
|
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement( const QString&, const QString&, const QString& ,
|
bool startElement( const QString&, const QString&, const QString& ,
|
||||||
@ -59,6 +70,8 @@ class PAdminXMLParser : public QXmlDefaultHandler
|
|||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
EAdminKeyWords fKeyWord;
|
EAdminKeyWords fKeyWord;
|
||||||
|
bool fFunc;
|
||||||
|
PTheory fTheoryItem;
|
||||||
PAdmin *fAdmin;
|
PAdmin *fAdmin;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,6 +90,9 @@ class PAdmin
|
|||||||
bool getLifetimeCorrectionFlag() { return fLifetimeCorrection; }
|
bool getLifetimeCorrectionFlag() { return fLifetimeCorrection; }
|
||||||
QString getMsrDefaultFilePath() { return fMsrDefaultFilePath; }
|
QString getMsrDefaultFilePath() { return fMsrDefaultFilePath; }
|
||||||
QString getHelpMain() { return fHelpMain; }
|
QString getHelpMain() { return fHelpMain; }
|
||||||
|
QString getTheoFuncPixmapPath() { return fTheoFuncPixmapPath; }
|
||||||
|
unsigned int getTheoryCounts() { return fTheory.size(); }
|
||||||
|
PTheory* getTheoryItem(const unsigned int idx);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setExecPath(const QString str) { fExecPath = str; }
|
void setExecPath(const QString str) { fExecPath = str; }
|
||||||
@ -87,12 +103,15 @@ class PAdmin
|
|||||||
void setLifetimeCorrectionFlag(const bool flag) { fLifetimeCorrection = flag; }
|
void setLifetimeCorrectionFlag(const bool flag) { fLifetimeCorrection = flag; }
|
||||||
void setMsrDefaultFilePath(const QString str) { fMsrDefaultFilePath = str; }
|
void setMsrDefaultFilePath(const QString str) { fMsrDefaultFilePath = str; }
|
||||||
void setHelpMain(const QString str) { fHelpMain = str; }
|
void setHelpMain(const QString str) { fHelpMain = str; }
|
||||||
|
void setTheoFuncPixmapPath (const QString str) { fTheoFuncPixmapPath = str; }
|
||||||
|
void addTheoryItem(const PTheory theo) { fTheory.push_back(theo); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class PAdminXMLParser;
|
friend class PAdminXMLParser;
|
||||||
|
|
||||||
QString fExecPath;
|
QString fExecPath;
|
||||||
QString fDefaultSavePath;
|
QString fDefaultSavePath;
|
||||||
|
QString fTheoFuncPixmapPath;
|
||||||
|
|
||||||
QString fBeamline;
|
QString fBeamline;
|
||||||
QString fInstitute;
|
QString fInstitute;
|
||||||
@ -102,6 +121,8 @@ class PAdmin
|
|||||||
QString fMsrDefaultFilePath;
|
QString fMsrDefaultFilePath;
|
||||||
|
|
||||||
QString fHelpMain;
|
QString fHelpMain;
|
||||||
|
|
||||||
|
QValueVector<PTheory> fTheory;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PADMIN_H_
|
#endif // _PADMIN_H_
|
||||||
|
76
src/musrgui/PGetTheoryBlockDialog.cpp
Normal file
76
src/musrgui/PGetTheoryBlockDialog.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
|
||||||
|
PGetTheoryBlockDialog.cpp
|
||||||
|
|
||||||
|
Author: Andreas Suter
|
||||||
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2009 by Andreas Suter *
|
||||||
|
* andreas.suter@psi.ch *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <qmessagebox.h>
|
||||||
|
#include <qtextedit.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
|
||||||
|
#include "PGetTheoryBlockDialog.h"
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
PGetTheoryBlockDialog::PGetTheoryBlockDialog(PAdmin *admin,
|
||||||
|
QWidget * parent, const char *name,
|
||||||
|
bool modal, WFlags f) :
|
||||||
|
PGetTheoryBlockDialogBase(parent, name, modal, f),
|
||||||
|
fAdmin(admin)
|
||||||
|
{
|
||||||
|
// feed theory function combo box
|
||||||
|
QString pixmapPath = fAdmin->getTheoFuncPixmapPath();
|
||||||
|
PTheory *theoItem;
|
||||||
|
for (unsigned int i=0; i<fAdmin->getTheoryCounts(); i++) {
|
||||||
|
theoItem = fAdmin->getTheoryItem(i);
|
||||||
|
if (theoItem->pixmapName.length() > 0) {
|
||||||
|
QPixmap pixmap( QImage(pixmapPath+"/"+theoItem->pixmapName, "PNG") );
|
||||||
|
fTheoryFunction_comboBox->insertItem(pixmap, theoItem->label);
|
||||||
|
} else {
|
||||||
|
fTheoryFunction_comboBox->insertItem(theoItem->label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
void PGetTheoryBlockDialog::helpContents()
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, "helpContents",
|
||||||
|
fAdmin->getHelpMain(), QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// END
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
54
src/musrgui/PGetTheoryBlockDialog.h
Normal file
54
src/musrgui/PGetTheoryBlockDialog.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
|
||||||
|
PGetTheoryBlockDialog.h
|
||||||
|
|
||||||
|
Author: Andreas Suter
|
||||||
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2009 by Andreas Suter *
|
||||||
|
* andreas.suter@psi.ch *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _PGETTHEORYBLOCKDIALOG_H_
|
||||||
|
#define _PGETTHEORYBLOCKDIALOG_H_
|
||||||
|
|
||||||
|
#include "PAdmin.h"
|
||||||
|
#include "forms/PGetTheoryBlockDialogBase.h"
|
||||||
|
|
||||||
|
class PGetTheoryBlockDialog : public PGetTheoryBlockDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PGetTheoryBlockDialog(PAdmin *admin = 0,
|
||||||
|
QWidget * parent = 0, const char * name = 0, bool modal = FALSE,
|
||||||
|
WFlags f = 0);
|
||||||
|
|
||||||
|
QString getTheoryBlock() { return fTheoryBlock_textEdit->text(); }
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void helpContents();
|
||||||
|
|
||||||
|
private:
|
||||||
|
PAdmin *fAdmin;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _PGETTHEORYBLOCKDIALOG_H_
|
@ -36,9 +36,11 @@
|
|||||||
#include <qcombobox.h>
|
#include <qcombobox.h>
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
|
|
||||||
|
#include "PAdmin.h"
|
||||||
#include "PSubTextEdit.h"
|
#include "PSubTextEdit.h"
|
||||||
#include "forms/PGetTitleDialog.h"
|
#include "forms/PGetTitleDialog.h"
|
||||||
#include "PGetParameterDialog.h"
|
#include "PGetParameterDialog.h"
|
||||||
|
#include "PGetTheoryBlockDialog.h"
|
||||||
#include "PGetFunctionsBlockDialog.h"
|
#include "PGetFunctionsBlockDialog.h"
|
||||||
#include "PGetAsymmetryRunBlockDialog.h"
|
#include "PGetAsymmetryRunBlockDialog.h"
|
||||||
#include "PGetSingleHistoRunBlockDialog.h"
|
#include "PGetSingleHistoRunBlockDialog.h"
|
||||||
@ -50,11 +52,10 @@
|
|||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
PSubTextEdit::PSubTextEdit(const bool lifetimeCorrectionFlag, const QString help,
|
PSubTextEdit::PSubTextEdit(PAdmin *admin,
|
||||||
QWidget *parent, const char *name) :
|
QWidget *parent, const char *name) :
|
||||||
QTextEdit(parent, name),
|
QTextEdit(parent, name),
|
||||||
fLifetimeCorrectionFlag(lifetimeCorrectionFlag),
|
fAdmin(admin)
|
||||||
fHelp(help)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,6 +150,11 @@ void PSubTextEdit::insertParameterBlock()
|
|||||||
*/
|
*/
|
||||||
void PSubTextEdit::insertTheoryBlock()
|
void PSubTextEdit::insertTheoryBlock()
|
||||||
{
|
{
|
||||||
|
PGetTheoryBlockDialog *dlg = new PGetTheoryBlockDialog(fAdmin);
|
||||||
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
|
insert(dlg->getTheoryBlock());
|
||||||
|
insert("\n\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -157,7 +163,7 @@ void PSubTextEdit::insertTheoryBlock()
|
|||||||
*/
|
*/
|
||||||
void PSubTextEdit::insertFunctionBlock()
|
void PSubTextEdit::insertFunctionBlock()
|
||||||
{
|
{
|
||||||
PGetFunctionsBlockDialog *dlg = new PGetFunctionsBlockDialog(fHelp);
|
PGetFunctionsBlockDialog *dlg = new PGetFunctionsBlockDialog(fAdmin->getHelpMain());
|
||||||
if (dlg->exec() == QDialog::Accepted) {
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
insert(dlg->getFunctionsBlock());
|
insert(dlg->getFunctionsBlock());
|
||||||
insert("\n\n");
|
insert("\n\n");
|
||||||
@ -170,7 +176,7 @@ void PSubTextEdit::insertFunctionBlock()
|
|||||||
*/
|
*/
|
||||||
void PSubTextEdit::insertAsymRunBlock()
|
void PSubTextEdit::insertAsymRunBlock()
|
||||||
{
|
{
|
||||||
PGetAsymmetryRunBlockDialog *dlg = new PGetAsymmetryRunBlockDialog(fHelp);
|
PGetAsymmetryRunBlockDialog *dlg = new PGetAsymmetryRunBlockDialog(fAdmin->getHelpMain());
|
||||||
if (dlg->exec() == QDialog::Accepted) {
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
QString str, workStr;
|
QString str, workStr;
|
||||||
bool valid = true, present = true;
|
bool valid = true, present = true;
|
||||||
@ -270,7 +276,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
*/
|
*/
|
||||||
void PSubTextEdit::insertSingleHistRunBlock()
|
void PSubTextEdit::insertSingleHistRunBlock()
|
||||||
{
|
{
|
||||||
PGetSingleHistoRunBlockDialog *dlg = new PGetSingleHistoRunBlockDialog(fHelp);
|
PGetSingleHistoRunBlockDialog *dlg = new PGetSingleHistoRunBlockDialog(fAdmin->getHelpMain());
|
||||||
if (dlg->exec() == QDialog::Accepted) {
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
QString str, workStr;
|
QString str, workStr;
|
||||||
bool valid = true, present = true;
|
bool valid = true, present = true;
|
||||||
@ -370,7 +376,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
*/
|
*/
|
||||||
void PSubTextEdit::insertNonMusrRunBlock()
|
void PSubTextEdit::insertNonMusrRunBlock()
|
||||||
{
|
{
|
||||||
PGetNonMusrRunBlockDialog *dlg = new PGetNonMusrRunBlockDialog(fHelp);
|
PGetNonMusrRunBlockDialog *dlg = new PGetNonMusrRunBlockDialog(fAdmin->getHelpMain());
|
||||||
if (dlg->exec() == QDialog::Accepted) {
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
QString str, workStr;
|
QString str, workStr;
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
|
@ -34,12 +34,14 @@
|
|||||||
|
|
||||||
#include <qtextedit.h>
|
#include <qtextedit.h>
|
||||||
|
|
||||||
|
#include "PAdmin.h"
|
||||||
|
|
||||||
class PSubTextEdit : public QTextEdit
|
class PSubTextEdit : public QTextEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PSubTextEdit(const bool lifetimeCorrectionFlag = true, const QString help ="", QWidget *parent = 0, const char *name = 0);
|
PSubTextEdit(PAdmin *admin = 0, QWidget *parent = 0, const char *name = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QPopupMenu *createPopupMenu( const QPoint &pos);
|
virtual QPopupMenu *createPopupMenu( const QPoint &pos);
|
||||||
@ -58,8 +60,7 @@ class PSubTextEdit : public QTextEdit
|
|||||||
void insertStatisticBlock();
|
void insertStatisticBlock();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool fLifetimeCorrectionFlag;
|
PAdmin *fAdmin;
|
||||||
QString fHelp;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ void PTextEdit::load( const QString &f )
|
|||||||
{
|
{
|
||||||
if ( !QFile::exists( f ) )
|
if ( !QFile::exists( f ) )
|
||||||
return;
|
return;
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin->getLifetimeCorrectionFlag(), fAdmin->getHelpMain() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin );
|
||||||
edit->setTextFormat( PlainText );
|
edit->setTextFormat( PlainText );
|
||||||
edit->setFamily("Courier");
|
edit->setFamily("Courier");
|
||||||
edit->setPointSize(11); // 11pt
|
edit->setPointSize(11); // 11pt
|
||||||
@ -410,7 +410,7 @@ bool PTextEdit::validRunList(const QString runList)
|
|||||||
*/
|
*/
|
||||||
void PTextEdit::fileNew()
|
void PTextEdit::fileNew()
|
||||||
{
|
{
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin->getLifetimeCorrectionFlag(), fAdmin->getHelpMain() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin );
|
||||||
edit->setTextFormat( PlainText );
|
edit->setTextFormat( PlainText );
|
||||||
edit->setFamily("Courier");
|
edit->setFamily("Courier");
|
||||||
edit->setPointSize(11); // 11pt
|
edit->setPointSize(11); // 11pt
|
||||||
|
@ -230,7 +230,7 @@ simplExpo 7</string>
|
|||||||
</widget>
|
</widget>
|
||||||
<images>
|
<images>
|
||||||
<image name="image0">
|
<image name="image0">
|
||||||
<data format="PNG" length="411">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000016249444154388d95544dae86200c9c1a169e471217707e5890d4f3b830e95b687d15e51349889982fd19a6252e0c6c001cb06e2b4637629abde0584b61aacf7bf0b06eebc5e88d5360b74fc18b9ed7f75bd82908210a01e0c204e33c8628029c99e8fd373ca853009023c3a530290d1a619abdf464aa7818dd682b3f232f8569ddd6cb594fa6578eab9f2f0f5105ede57888214ace692f3d33d591951602be719c72a2d18dc839512b93737de0989e74dcc2d3eca557d7371db7b0364daf3a865eceded41142949b8e7b38b32b86288fe7371d77bcb66d1ace4ceadcce9669f6a2f79dcdf0edbb1426752200c874ec8da6c37e6e2e0cfbadb798cd99c18571b11546ca090ed807cf85db23b2da6388a27ab7034a39d54a08403afc383c7514dab8a5e3a530a5431d4b667200e0c37f16e968efa70adede40a7e414bc3875663b4833d44a6adc548f59832dd3ce865fb8a9fbdaf1178e7f656ea724a59cba75fce5fb0774073f42f0dd40cc0000000049454e44ae426082</data>
|
<data format="PNG" length="407">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000015e49444154388dad54318ec4200c1ca31429f38ed06d09ef8792ce7907653aae088e0c1b6ed9d321213490d8e361307162e004b002f9ccd8d60dfbcb16d47124a6fe7c069b7ce666d3aaa0c0b5bf3b5be4bcff7e848913239f19cef94200383169c604a0fc81b991a0a801f299af20359864d85fb6cc30156cb675d395df998fc494cfdc9c6966126c84cdd3cf4d795dd2598d8d77bec418aed223539f596421608aa9601362a06ddd1063a011937b7ca1313df97884f7972db3ee78f3f1088b0567dd616635fbe40ee77c69349ed54c0fef7c793cff0f8dadb3452efea9b72c9ae1a7f550cfbd0020f562df64aafbf7e4c4d06b3f8b9a1c199c18cd5e628418b00057e369b4ad9965df3b7f970dddfd563495108050e32c787a5118e3918f8fc414aa3b8ec8b400d7450889509ff753059fee40bae4ee6c592498be7d612895f478e87b358c2e53f786dff0d0f77de06f34fe8db9ee92146298f6f137eb0f98104228d12bbd020000000049454e44ae426082</data>
|
||||||
</image>
|
</image>
|
||||||
</images>
|
</images>
|
||||||
<connections>
|
<connections>
|
||||||
@ -246,6 +246,15 @@ simplExpo 7</string>
|
|||||||
<receiver>PGetTheoryBlockDialogBase</receiver>
|
<receiver>PGetTheoryBlockDialogBase</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonHelp</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>PGetTheoryBlockDialogBase</receiver>
|
||||||
|
<slot>helpContents()</slot>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
|
<slots>
|
||||||
|
<slot access="private">helpContents()</slot>
|
||||||
|
</slots>
|
||||||
<layoutdefaults spacing="6" margin="11"/>
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
</UI>
|
</UI>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.3 KiB |
@ -3,7 +3,7 @@
|
|||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\begin{displaymath}
|
\begin{displaymath}
|
||||||
\alpha j_0\left(2\pi\nu t + \phi\pi/180\right) \exp(-\lambda_{\rm T} t) + (1-\alpha) exp(-\lambda_{\rm L} t)
|
\alpha j_0\left(2\pi\nu t + \phi\pi/180\right) e^{-\lambda_{\rm T} t} + (1-\alpha) e^{-\lambda_{\rm L} t}
|
||||||
\end{displaymath}
|
\end{displaymath}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 928 B |
@ -3,7 +3,7 @@
|
|||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\begin{displaymath}
|
\begin{displaymath}
|
||||||
\alpha \cos\left(2\pi\nu t + \phi\pi/180\right) \exp(-\lambda_{\rm T} t) + (1-\alpha) exp(-\lambda_{\rm L} t)
|
\alpha \cos\left(2\pi\nu t + \phi\pi/180\right) e^{-\lambda_{\rm T} t} + (1-\alpha) e^{-\lambda_{\rm L} t}
|
||||||
\end{displaymath}
|
\end{displaymath}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
BIN
src/musrgui/latex_images/statExpKT.png
Normal file
BIN
src/musrgui/latex_images/statExpKT.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 740 B |
9
src/musrgui/latex_images/statExpKT.tex
Normal file
9
src/musrgui/latex_images/statExpKT.tex
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
\documentclass[12pt]{article}
|
||||||
|
\pagestyle{empty}
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\begin{displaymath}
|
||||||
|
1/3 \left[ 1 + 2\, \left\{ 1 - \lambda t \right\}\right]\, e^{-\lambda t}
|
||||||
|
\end{displaymath}
|
||||||
|
|
||||||
|
\end{document}
|
@ -20,6 +20,7 @@ HEADERS = PTextEdit.h \
|
|||||||
PPrefsDialog.h \
|
PPrefsDialog.h \
|
||||||
PGetDefaultDialog.h \
|
PGetDefaultDialog.h \
|
||||||
PGetParameterDialog.h \
|
PGetParameterDialog.h \
|
||||||
|
PGetTheoryBlockDialog.h \
|
||||||
PGetFunctionsBlockDialog.h \
|
PGetFunctionsBlockDialog.h \
|
||||||
PGetAsymmetryRunBlockDialog.h \
|
PGetAsymmetryRunBlockDialog.h \
|
||||||
PGetSingleHistoRunBlockDialog.h \
|
PGetSingleHistoRunBlockDialog.h \
|
||||||
@ -35,6 +36,7 @@ SOURCES = PTextEdit.cpp \
|
|||||||
PPrefsDialog.cpp \
|
PPrefsDialog.cpp \
|
||||||
PGetDefaultDialog.cpp \
|
PGetDefaultDialog.cpp \
|
||||||
PGetParameterDialog.cpp \
|
PGetParameterDialog.cpp \
|
||||||
|
PGetTheoryBlockDialog.cpp \
|
||||||
PGetFunctionsBlockDialog.cpp \
|
PGetFunctionsBlockDialog.cpp \
|
||||||
PGetAsymmetryRunBlockDialog.cpp \
|
PGetAsymmetryRunBlockDialog.cpp \
|
||||||
PGetSingleHistoRunBlockDialog.cpp \
|
PGetSingleHistoRunBlockDialog.cpp \
|
||||||
@ -49,6 +51,7 @@ FORMS = forms/PGetDefaultDialogBase.ui \
|
|||||||
forms/PPrefsDialogBase.ui \
|
forms/PPrefsDialogBase.ui \
|
||||||
forms/PGetTitleDialog.ui \
|
forms/PGetTitleDialog.ui \
|
||||||
forms/PGetParameterDialogBase.ui \
|
forms/PGetParameterDialogBase.ui \
|
||||||
|
forms/PGetTheoryBlockDialogBase.ui \
|
||||||
forms/PGetFunctionsBlockDialogBase.ui \
|
forms/PGetFunctionsBlockDialogBase.ui \
|
||||||
forms/PGetAsymmetryRunBlockDialogBase.ui \
|
forms/PGetAsymmetryRunBlockDialogBase.ui \
|
||||||
forms/PGetSingleHistoRunBlockDialogBase.ui \
|
forms/PGetSingleHistoRunBlockDialogBase.ui \
|
||||||
|
@ -21,53 +21,54 @@
|
|||||||
Starting with >= Qt4.2 this will be linked automatically but until then ...; sorry ;-)
|
Starting with >= Qt4.2 this will be linked automatically but until then ...; sorry ;-)
|
||||||
</help_main>
|
</help_main>
|
||||||
</help_section>
|
</help_section>
|
||||||
|
<func_pixmap_path>/home/nemu/analysis/musrfit/src/musrgui/latex_images</func_pixmap_path>
|
||||||
<theory_functions>
|
<theory_functions>
|
||||||
<func>
|
<func>
|
||||||
<name>asymmetry</name>
|
<name>asymmetry</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<label> : Asymmetry</label>
|
<label> : Asymmetry</label>
|
||||||
<pixmap>latex_images/asymmetry.png</pixmap>
|
<pixmap>asymmetry.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>simplExpo</name>
|
<name>simplExpo</name>
|
||||||
<comment>(rate)</comment>
|
<comment>(rate)</comment>
|
||||||
<label> : simple Exp</label>
|
<label> : simple Exp</label>
|
||||||
<pixmap>latex_images/simpleExp.png</pixmap>
|
<pixmap>simpleExp.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>generExpo</name>
|
<name>generExpo</name>
|
||||||
<comment>(rate exponent)</comment>
|
<comment>(rate exponent)</comment>
|
||||||
<label> : general Exp</label>
|
<label> : general Exp</label>
|
||||||
<pixmap>latex_images/generalExp.png</pixmap>
|
<pixmap>generalExp.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>simplGss</name>
|
<name>simplGss</name>
|
||||||
<comment>(rate)</comment>
|
<comment>(rate)</comment>
|
||||||
<label> : simple Gauss</label>
|
<label> : simple Gauss</label>
|
||||||
<pixmap>latex_images/simpleGauss.png</pixmap>
|
<pixmap>simpleGauss.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>statGssKT</name>
|
<name>statGssKT</name>
|
||||||
<comment>(rate)</comment>
|
<comment>(rate)</comment>
|
||||||
<label> : static Gauss KT</label>
|
<label> : static Gauss KT</label>
|
||||||
<pixmap>latex_images/statGssKT.png</pixmap>
|
<pixmap>statGssKT.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>statGssKTLF</name>
|
<name>statGssKTLF</name>
|
||||||
<comment>(frequency damping)</comment>
|
<comment>(frequency damping)</comment>
|
||||||
<label> : static Gauss KT LF</label>
|
<label>static Gauss KT LF</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>dynGssKTLF</name>
|
<name>dynGssKTLF</name>
|
||||||
<comment>(frequency damping hopping-rate)</comment>
|
<comment>(frequency damping hopping-rate)</comment>
|
||||||
<label> : dynamic Gauss KT LF</label>
|
<label>dynamic Gauss KT LF</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>3</params>
|
<params>3</params>
|
||||||
</func>
|
</func>
|
||||||
@ -75,20 +76,20 @@
|
|||||||
<name>statExpKT</name>
|
<name>statExpKT</name>
|
||||||
<comment>(rate)</comment>
|
<comment>(rate)</comment>
|
||||||
<label> : static Lorentz KT</label>
|
<label> : static Lorentz KT</label>
|
||||||
<pixmap>latex_images/statExpKT.png</pixmap>
|
<pixmap>statExpKT.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>statExpKTLF</name>
|
<name>statExpKTLF</name>
|
||||||
<comment>(frequency damping)</comment>
|
<comment>(frequency damping)</comment>
|
||||||
<label> : static Gauss KT LF</label>
|
<label>static Gauss KT LF</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>dynExpKTLF</name>
|
<name>dynExpKTLF</name>
|
||||||
<comment>(frequency damping hopping-rate)</comment>
|
<comment>(frequency damping hopping-rate)</comment>
|
||||||
<label> : static Lorentz KT LF</label>
|
<label>static Lorentz KT LF</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>3</params>
|
<params>3</params>
|
||||||
</func>
|
</func>
|
||||||
@ -96,20 +97,20 @@
|
|||||||
<name>combiLGKT</name>
|
<name>combiLGKT</name>
|
||||||
<comment>(LorentzRate GaussRate)</comment>
|
<comment>(LorentzRate GaussRate)</comment>
|
||||||
<label> : combined Lorentz-Gauss KT</label>
|
<label> : combined Lorentz-Gauss KT</label>
|
||||||
<pixmap>latex_images/combiLGKT.png</pixmap>
|
<pixmap>combiLGKT.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>spinGlass</name>
|
<name>spinGlass</name>
|
||||||
<comment>(rate hopping-rate order)</comment>
|
<comment>(rate hopping-rate order)</comment>
|
||||||
<label> : zero field spin glass function</label>
|
<label>zero field spin glass function</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>3</params>
|
<params>3</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>rdAnisoHf</name>
|
<name>rdAnisoHf</name>
|
||||||
<comment>(frequency rate)</comment>
|
<comment>(frequency rate)</comment>
|
||||||
<label> : random anisotropic hyperfine function</label>
|
<label>random anisotropic hyperfine function</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
@ -117,41 +118,41 @@
|
|||||||
<name>abragam</name>
|
<name>abragam</name>
|
||||||
<comment>(rate hopping-rate)</comment>
|
<comment>(rate hopping-rate)</comment>
|
||||||
<label> : Abragam</label>
|
<label> : Abragam</label>
|
||||||
<pixmap>latex_images/abragam.png</pixmap>
|
<pixmap>abragam.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>internFld</name>
|
<name>internFld</name>
|
||||||
<comment>(phase frequency Trate Lrate)</comment>
|
<comment>(phase frequency Trate Lrate)</comment>
|
||||||
<label> : internal Lorentz field</label>
|
<label> : internal Lorentz field</label>
|
||||||
<pixmap>latex_images/internalField.png</pixmap>
|
<pixmap>internalField.png</pixmap>
|
||||||
<params>4</params>
|
<params>4</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>TFieldCos</name>
|
<name>TFieldCos</name>
|
||||||
<comment>(phase frequency)</comment>
|
<comment>(phase frequency)</comment>
|
||||||
<label> : TF cos</label>
|
<label> : TF cos</label>
|
||||||
<pixmap>latex_images/tfCos.png</pixmap>
|
<pixmap>tfCos.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>bessel</name>
|
<name>bessel</name>
|
||||||
<comment>(phase frequency)</comment>
|
<comment>(phase frequency)</comment>
|
||||||
<label> : spherical Bessel 0th order</label>
|
<label> : spherical Bessel 0th order</label>
|
||||||
<pixmap>latex_images/bessel.png</pixmap>
|
<pixmap>bessel.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>internBsl</name>
|
<name>internBsl</name>
|
||||||
<comment>(fraction phase frequency Trate Lrate)</comment>
|
<comment>(fraction phase frequency Trate Lrate)</comment>
|
||||||
<label> : static internal Bessel</label>
|
<label> : static internal Bessel</label>
|
||||||
<pixmap>latex_images/internalBessel.png</pixmap>
|
<pixmap>internalBessel.png</pixmap>
|
||||||
<params>5</params>
|
<params>5</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>skewedGss</name>
|
<name>skewedGss</name>
|
||||||
<comment>(phase frequency rate_m rate_p)</comment>
|
<comment>(phase frequency rate_m rate_p)</comment>
|
||||||
<label> : skewed Gaussian</label>
|
<label>skewed Gaussian</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>4</params>
|
<params>4</params>
|
||||||
</func>
|
</func>
|
||||||
@ -159,13 +160,13 @@
|
|||||||
<name>polynom</name>
|
<name>polynom</name>
|
||||||
<comment>(tshift p0 p1 ... pn)</comment>
|
<comment>(tshift p0 p1 ... pn)</comment>
|
||||||
<label> : polynom</label>
|
<label> : polynom</label>
|
||||||
<pixmap>latex_images/polynom.png</pixmap>
|
<pixmap>polynom.png</pixmap>
|
||||||
<params>4</params>
|
<params>4</params>
|
||||||
</func>
|
</func>
|
||||||
<func>
|
<func>
|
||||||
<name>userFcn</name>
|
<name>userFcn</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<label> : user function</label>
|
<label>user function</label>
|
||||||
<pixmap></pixmap>
|
<pixmap></pixmap>
|
||||||
<params>0</params>
|
<params>0</params>
|
||||||
</func>
|
</func>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user