added theory function insert option
This commit is contained in:
parent
229d7c7709
commit
f5df45e5b3
@ -49,12 +49,14 @@ PGetTheoryBlockDialog::PGetTheoryBlockDialog(PAdmin *admin,
|
|||||||
{
|
{
|
||||||
// feed theory function combo box
|
// feed theory function combo box
|
||||||
QString pixmapPath = fAdmin->getTheoFuncPixmapPath();
|
QString pixmapPath = fAdmin->getTheoFuncPixmapPath();
|
||||||
|
QString label;
|
||||||
PTheory *theoItem;
|
PTheory *theoItem;
|
||||||
for (unsigned int i=0; i<fAdmin->getTheoryCounts(); i++) {
|
for (unsigned int i=0; i<fAdmin->getTheoryCounts(); i++) {
|
||||||
theoItem = fAdmin->getTheoryItem(i);
|
theoItem = fAdmin->getTheoryItem(i);
|
||||||
if (theoItem->pixmapName.length() > 0) {
|
if (theoItem->pixmapName.length() > 0) {
|
||||||
QPixmap pixmap( QImage(pixmapPath+"/"+theoItem->pixmapName, "PNG") );
|
QPixmap pixmap( QImage(pixmapPath+"/"+theoItem->pixmapName, "PNG") );
|
||||||
fTheoryFunction_comboBox->insertItem(pixmap, theoItem->label);
|
label = " : " + theoItem->label;
|
||||||
|
fTheoryFunction_comboBox->insertItem(pixmap, label);
|
||||||
} else {
|
} else {
|
||||||
fTheoryFunction_comboBox->insertItem(theoItem->label);
|
fTheoryFunction_comboBox->insertItem(theoItem->label);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,9 @@
|
|||||||
#include <qlineedit.h>
|
#include <qlineedit.h>
|
||||||
#include <qcombobox.h>
|
#include <qcombobox.h>
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
|
#include <qiconset.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
|
||||||
#include "PAdmin.h"
|
#include "PAdmin.h"
|
||||||
#include "PSubTextEdit.h"
|
#include "PSubTextEdit.h"
|
||||||
@ -66,6 +69,7 @@ PSubTextEdit::PSubTextEdit(PAdmin *admin,
|
|||||||
QPopupMenu* PSubTextEdit::createPopupMenu(const QPoint &pos)
|
QPopupMenu* PSubTextEdit::createPopupMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
QPopupMenu *menu = new QPopupMenu( this );
|
QPopupMenu *menu = new QPopupMenu( this );
|
||||||
|
QPopupMenu *theoryFunctions = new QPopupMenu( menu );
|
||||||
|
|
||||||
QAction *a;
|
QAction *a;
|
||||||
a = new QAction(tr("insert Title"), 0, this, "insertTitle");
|
a = new QAction(tr("insert Title"), 0, this, "insertTitle");
|
||||||
@ -76,6 +80,14 @@ QPopupMenu* PSubTextEdit::createPopupMenu(const QPoint &pos)
|
|||||||
connect(a, SIGNAL( activated() ), this, SLOT( insertParameterBlock() ));
|
connect(a, SIGNAL( activated() ), this, SLOT( insertParameterBlock() ));
|
||||||
a->addTo( menu );
|
a->addTo( menu );
|
||||||
|
|
||||||
|
// feed the theoryFunctions popup menu
|
||||||
|
for (unsigned int i=0; i<fAdmin->getTheoryCounts(); i++) {
|
||||||
|
PTheory *theoryItem = fAdmin->getTheoryItem(i);
|
||||||
|
theoryFunctions->insertItem(theoryItem->label, 300+i);
|
||||||
|
}
|
||||||
|
menu->insertItem("insert Theory Function", theoryFunctions);
|
||||||
|
connect(theoryFunctions, SIGNAL( activated(int) ), this, SLOT( insertTheoryFunction(int) ));
|
||||||
|
|
||||||
a = new QAction(tr("insert Theory Block"), 0, this, "insertTheoryBlock");
|
a = new QAction(tr("insert Theory Block"), 0, this, "insertTheoryBlock");
|
||||||
connect(a, SIGNAL( activated() ), this, SLOT( insertTheoryBlock() ));
|
connect(a, SIGNAL( activated() ), this, SLOT( insertTheoryBlock() ));
|
||||||
a->addTo( menu );
|
a->addTo( menu );
|
||||||
@ -144,6 +156,45 @@ void PSubTextEdit::insertParameterBlock()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
void PSubTextEdit::insertTheoryFunction(int idx)
|
||||||
|
{
|
||||||
|
if (idx < 300)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int index = idx - 300;
|
||||||
|
|
||||||
|
if (index >= fAdmin->getTheoryCounts())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QString str = "????";
|
||||||
|
PTheory *theoItem = fAdmin->getTheoryItem(index);
|
||||||
|
if (theoItem == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// add theory function name
|
||||||
|
str = theoItem->name + " ";
|
||||||
|
if (theoItem->name == "userFcn") {
|
||||||
|
str += "libMyLibrary.so TMyFunction ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// add pseudo parameters
|
||||||
|
for (int i=0; i<theoItem->params; i++) {
|
||||||
|
str += QString("%1").arg(i+1) + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// add comment
|
||||||
|
str += theoItem->comment;
|
||||||
|
|
||||||
|
// add newline
|
||||||
|
str += "\n";
|
||||||
|
|
||||||
|
insert(str);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -49,6 +49,7 @@ class PSubTextEdit : public QTextEdit
|
|||||||
private slots:
|
private slots:
|
||||||
void insertTitle();
|
void insertTitle();
|
||||||
void insertParameterBlock();
|
void insertParameterBlock();
|
||||||
|
void insertTheoryFunction(int idx);
|
||||||
void insertTheoryBlock();
|
void insertTheoryBlock();
|
||||||
void insertFunctionBlock();
|
void insertFunctionBlock();
|
||||||
void insertAsymRunBlock();
|
void insertAsymRunBlock();
|
||||||
|
@ -26,35 +26,35 @@
|
|||||||
<func>
|
<func>
|
||||||
<name>asymmetry</name>
|
<name>asymmetry</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<label> : Asymmetry</label>
|
<label>Asymmetry</label>
|
||||||
<pixmap>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>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>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>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>statGssKT.png</pixmap>
|
<pixmap>statGssKT.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<func>
|
<func>
|
||||||
<name>statExpKT</name>
|
<name>statExpKT</name>
|
||||||
<comment>(rate)</comment>
|
<comment>(rate)</comment>
|
||||||
<label> : static Lorentz KT</label>
|
<label>static Lorentz KT</label>
|
||||||
<pixmap>statExpKT.png</pixmap>
|
<pixmap>statExpKT.png</pixmap>
|
||||||
<params>1</params>
|
<params>1</params>
|
||||||
</func>
|
</func>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
<func>
|
<func>
|
||||||
<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>combiLGKT.png</pixmap>
|
<pixmap>combiLGKT.png</pixmap>
|
||||||
<params>2</params>
|
<params>2</params>
|
||||||
</func>
|
</func>
|
||||||
@ -117,35 +117,35 @@
|
|||||||
<func>
|
<func>
|
||||||
<name>abragam</name>
|
<name>abragam</name>
|
||||||
<comment>(rate hopping-rate)</comment>
|
<comment>(rate hopping-rate)</comment>
|
||||||
<label> : Abragam</label>
|
<label>Abragam</label>
|
||||||
<pixmap>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>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>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>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>internalBessel.png</pixmap>
|
<pixmap>internalBessel.png</pixmap>
|
||||||
<params>5</params>
|
<params>5</params>
|
||||||
</func>
|
</func>
|
||||||
@ -159,7 +159,7 @@
|
|||||||
<func>
|
<func>
|
||||||
<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>polynom.png</pixmap>
|
<pixmap>polynom.png</pixmap>
|
||||||
<params>4</params>
|
<params>4</params>
|
||||||
</func>
|
</func>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user