#include "ArithmeticEvaluator.h"\r
\r
\r
-FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference, bool createIfaces) throw(Exception) : AbstractBlock() {\r
+FunctionalBlock::FunctionalBlock(Graph *_graph, GroupBlock *_parent, ReferenceBlock *_reference, bool createIfaces) throw(Exception) : AbstractBlock(_graph) {\r
//if (! _reference->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE));\r
//if (! _group->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE));\r
reference = _reference;\r
delta = -1;\r
evaluator = NULL;\r
\r
+ BlockParameter* p;\r
+ // create parameters from reference block\r
+ QList<BlockParameter*> lstParam = reference->getParameters();\r
+ for(int i=0;i<lstParam.size();i++) {\r
+ p = lstParam.at(i)->clone();\r
+ addParameter(p);\r
+ }\r
+\r
if (createIfaces) {\r
populate();\r
}\r
-\r
}\r
\r
FunctionalBlock::~FunctionalBlock() {\r
}\r
\r
void FunctionalBlock::populate() {\r
- int i;\r
- BlockParameter* p;\r
- AbstractInterface* inter;\r
-\r
- // create parameters from reference block\r
- QList<BlockParameter*> lstParam = reference->getParameters();\r
- for(i=0;i<lstParam.size();i++) {\r
- p = lstParam.at(i)->clone();\r
- addParameter(p);\r
- }\r
+ int i; \r
\r
+ AbstractInterface* inter;\r
ConnectedInterface* toClk = NULL;\r
ConnectedInterface* toRst = NULL;\r
// create interfaces from reference block\r
cout << "call to " << qPrintable(fctName) << endl;\r
#endif\r
\r
+ cout << "creating input pattern" << endl;\r
lengthIP = -1;\r
foreach(AbstractInterface* iface, getControlInputs()) {\r
\r
QDomElement eltModif = nodeModif.toElement();\r
}\r
out << "-- Description : " << endl;\r
- out << reference->getDescription() << endl;\r
+ QStringList lines = reference->getDescription().split("\n");\r
+ foreach(QString line, lines) {\r
+ out << "-- " << line << endl;\r
+ }\r
out << "--" << endl;\r
QDomElement eltNote = eltLog.nextSiblingElement("notes");\r
QDomElement note = eltNote.firstChildElement();\r
QString noteTxt = note.text();\r
- out << "-- Notes :\n"<<noteTxt<<endl;\r
+ out << "-- Notes :" << endl;\r
+ lines = noteTxt.split("\n");\r
+ foreach(QString line, lines) {\r
+ out << "-- " << line << endl;\r
+ }\r
out << "--" << endl;\r
for(int i = 0; i < 50; i++) {\r
out << "--";\r