X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/8fb3c55ee009a11db5e1c08a4cfb286979412745..refs/heads/master:/FunctionalBlock.cpp?ds=inline diff --git a/FunctionalBlock.cpp b/FunctionalBlock.cpp index 0fb38c3..98e5e87 100644 --- a/FunctionalBlock.cpp +++ b/FunctionalBlock.cpp @@ -8,7 +8,7 @@ #include "ArithmeticEvaluator.h" -FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference, bool createIfaces) throw(Exception) : AbstractBlock() { +FunctionalBlock::FunctionalBlock(Graph *_graph, GroupBlock *_parent, ReferenceBlock *_reference, bool createIfaces) throw(Exception) : AbstractBlock(_graph) { //if (! _reference->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE)); //if (! _group->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE)); reference = _reference; @@ -30,10 +30,17 @@ FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference delta = -1; evaluator = NULL; + BlockParameter* p; + // create parameters from reference block + QList lstParam = reference->getParameters(); + for(int i=0;iclone(); + addParameter(p); + } + if (createIfaces) { populate(); } - } FunctionalBlock::~FunctionalBlock() { @@ -71,17 +78,9 @@ bool FunctionalBlock::isStimuliBlock() { } void FunctionalBlock::populate() { - int i; - BlockParameter* p; - AbstractInterface* inter; - - // create parameters from reference block - QList lstParam = reference->getParameters(); - for(i=0;iclone(); - addParameter(p); - } + int i; + AbstractInterface* inter; ConnectedInterface* toClk = NULL; ConnectedInterface* toRst = NULL; // create interfaces from reference block @@ -669,6 +668,7 @@ void FunctionalBlock::createInputPattern() throw(Exception) { cout << "call to " << qPrintable(fctName) << endl; #endif + cout << "creating input pattern" << endl; lengthIP = -1; foreach(AbstractInterface* iface, getControlInputs()) { @@ -1422,12 +1422,19 @@ void FunctionalBlock::generateComments(QTextStream& out, QDomElement &elt, QStri QDomElement eltModif = nodeModif.toElement(); } out << "-- Description : " << endl; - out << reference->getDescription() << endl; + QStringList lines = reference->getDescription().split("\n"); + foreach(QString line, lines) { + out << "-- " << line << endl; + } out << "--" << endl; QDomElement eltNote = eltLog.nextSiblingElement("notes"); QDomElement note = eltNote.firstChildElement(); QString noteTxt = note.text(); - out << "-- Notes :\n"<