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
|
||||
QString pixmapPath = fAdmin->getTheoFuncPixmapPath();
|
||||
QString label;
|
||||
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);
|
||||
label = " : " + theoItem->label;
|
||||
fTheoryFunction_comboBox->insertItem(pixmap, label);
|
||||
} else {
|
||||
fTheoryFunction_comboBox->insertItem(theoItem->label);
|
||||
}
|
||||
|
@ -35,6 +35,9 @@
|
||||
#include <qlineedit.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qiconset.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
|
||||
#include "PAdmin.h"
|
||||
#include "PSubTextEdit.h"
|
||||
@ -66,6 +69,7 @@ PSubTextEdit::PSubTextEdit(PAdmin *admin,
|
||||
QPopupMenu* PSubTextEdit::createPopupMenu(const QPoint &pos)
|
||||
{
|
||||
QPopupMenu *menu = new QPopupMenu( this );
|
||||
QPopupMenu *theoryFunctions = new QPopupMenu( menu );
|
||||
|
||||
QAction *a;
|
||||
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() ));
|
||||
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");
|
||||
connect(a, SIGNAL( activated() ), this, SLOT( insertTheoryBlock() ));
|
||||
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>
|
||||
|
@ -49,6 +49,7 @@ class PSubTextEdit : public QTextEdit
|
||||
private slots:
|
||||
void insertTitle();
|
||||
void insertParameterBlock();
|
||||
void insertTheoryFunction(int idx);
|
||||
void insertTheoryBlock();
|
||||
void insertFunctionBlock();
|
||||
void insertAsymRunBlock();
|
||||
|
@ -26,35 +26,35 @@
|
||||
<func>
|
||||
<name>asymmetry</name>
|
||||
<comment></comment>
|
||||
<label> : Asymmetry</label>
|
||||
<label>Asymmetry</label>
|
||||
<pixmap>asymmetry.png</pixmap>
|
||||
<params>1</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>simplExpo</name>
|
||||
<comment>(rate)</comment>
|
||||
<label> : simple Exp</label>
|
||||
<label>simple Exp</label>
|
||||
<pixmap>simpleExp.png</pixmap>
|
||||
<params>1</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>generExpo</name>
|
||||
<comment>(rate exponent)</comment>
|
||||
<label> : general Exp</label>
|
||||
<label>general Exp</label>
|
||||
<pixmap>generalExp.png</pixmap>
|
||||
<params>2</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>simplGss</name>
|
||||
<comment>(rate)</comment>
|
||||
<label> : simple Gauss</label>
|
||||
<label>simple Gauss</label>
|
||||
<pixmap>simpleGauss.png</pixmap>
|
||||
<params>1</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>statGssKT</name>
|
||||
<comment>(rate)</comment>
|
||||
<label> : static Gauss KT</label>
|
||||
<label>static Gauss KT</label>
|
||||
<pixmap>statGssKT.png</pixmap>
|
||||
<params>1</params>
|
||||
</func>
|
||||
@ -75,7 +75,7 @@
|
||||
<func>
|
||||
<name>statExpKT</name>
|
||||
<comment>(rate)</comment>
|
||||
<label> : static Lorentz KT</label>
|
||||
<label>static Lorentz KT</label>
|
||||
<pixmap>statExpKT.png</pixmap>
|
||||
<params>1</params>
|
||||
</func>
|
||||
@ -96,7 +96,7 @@
|
||||
<func>
|
||||
<name>combiLGKT</name>
|
||||
<comment>(LorentzRate GaussRate)</comment>
|
||||
<label> : combined Lorentz-Gauss KT</label>
|
||||
<label>combined Lorentz-Gauss KT</label>
|
||||
<pixmap>combiLGKT.png</pixmap>
|
||||
<params>2</params>
|
||||
</func>
|
||||
@ -117,35 +117,35 @@
|
||||
<func>
|
||||
<name>abragam</name>
|
||||
<comment>(rate hopping-rate)</comment>
|
||||
<label> : Abragam</label>
|
||||
<label>Abragam</label>
|
||||
<pixmap>abragam.png</pixmap>
|
||||
<params>2</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>internFld</name>
|
||||
<comment>(phase frequency Trate Lrate)</comment>
|
||||
<label> : internal Lorentz field</label>
|
||||
<label>internal Lorentz field</label>
|
||||
<pixmap>internalField.png</pixmap>
|
||||
<params>4</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>TFieldCos</name>
|
||||
<comment>(phase frequency)</comment>
|
||||
<label> : TF cos</label>
|
||||
<label>TF cos</label>
|
||||
<pixmap>tfCos.png</pixmap>
|
||||
<params>2</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>bessel</name>
|
||||
<comment>(phase frequency)</comment>
|
||||
<label> : spherical Bessel 0th order</label>
|
||||
<label>spherical Bessel 0th order</label>
|
||||
<pixmap>bessel.png</pixmap>
|
||||
<params>2</params>
|
||||
</func>
|
||||
<func>
|
||||
<name>internBsl</name>
|
||||
<comment>(fraction phase frequency Trate Lrate)</comment>
|
||||
<label> : static internal Bessel</label>
|
||||
<label>static internal Bessel</label>
|
||||
<pixmap>internalBessel.png</pixmap>
|
||||
<params>5</params>
|
||||
</func>
|
||||
@ -159,7 +159,7 @@
|
||||
<func>
|
||||
<name>polynom</name>
|
||||
<comment>(tshift p0 p1 ... pn)</comment>
|
||||
<label> : polynom</label>
|
||||
<label>polynom</label>
|
||||
<pixmap>polynom.png</pixmap>
|
||||
<params>4</params>
|
||||
</func>
|
||||
|
Loading…
x
Reference in New Issue
Block a user