27 #include <QToolButton>
30 #include <PyEditor_Editor.h>
41 using namespace YACS::HMI;
42 using namespace YACS::ENGINE;
45 EditionPyFunc::EditionPyFunc(
Subject* subject,
63 QGridLayout *glt =
new QGridLayout();
65 QLabel* laFuncName =
new QLabel(
"laFuncName",
this );
66 glt->addWidget(laFuncName, 0, 0, 1, 1);
67 laFuncName->setText(
"Function Name:");
71 QPushButton* gener_template =
new QPushButton(
"Template",
this);
72 connect(gener_template,SIGNAL(clicked()),
this, SLOT(
onTemplate()));
73 glt->addWidget(gener_template, 0, 2, 1, 1);
79 gener_template->setEnabled (
false);
84 connect(
_liFuncName, SIGNAL(textChanged(
const QString&)),
94 bool funcNameEdited =
false;
95 string funcName =
_liFuncName->text().toStdString();
103 funcNameEdited =
true;
107 funcNameEdited =
false;
136 std::list<InputPort*>::iterator ipos = iplist.begin();
137 for (; ipos != iplist.end(); ipos++)
139 text = text + (*ipos)->getName() +
",";
141 text = text +
"):\n";
142 text = text +
" return ";
145 std::list<OutputPort*>::iterator opos = oplist.begin();
146 for (; opos != oplist.end(); opos++)
148 text = text + (*opos)->getName() +
",";
150 text[text.length()-1]=
' ';
152 _sci->append(text.c_str());