X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/a7299f808c1906872b76aa62fb6d8276096c4ff5..e40a5399ec7887c2606f18575c809b0d05b09278:/FunctionalBlock.cpp?ds=sidebyside diff --git a/FunctionalBlock.cpp b/FunctionalBlock.cpp index 1fe7569..ab9611d 100644 --- a/FunctionalBlock.cpp +++ b/FunctionalBlock.cpp @@ -8,7 +8,7 @@ #include "ArithmeticEvaluator.h" -FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference) throw(Exception) : AbstractBlock() { +FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference, bool createIfaces) throw(Exception) : AbstractBlock() { //if (! _reference->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE)); //if (! _group->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE)); reference = _reference; @@ -30,6 +30,10 @@ FunctionalBlock::FunctionalBlock(GroupBlock *_parent, ReferenceBlock *_reference delta = -1; evaluator = NULL; + if (createIfaces) { + populate(); + } + } FunctionalBlock::~FunctionalBlock() { @@ -96,7 +100,7 @@ void FunctionalBlock::populate() { addInterface(inter); /* WARNING FOR THE FUTURE : in case of there are several clock interfaces ofr that block - it would be a godd idea to make the user choose which one + it would be a good idea to make the user choose which one must be connected to defautl clk. Presently, the first encountered is chosen */ @@ -122,18 +126,6 @@ void FunctionalBlock::populate() { } } } - - // connect clk and rst to group clk/rst or to clkrstgen - if ((name != "clkrstgen") && (parent != NULL)) { - try { - connectClkReset(); - } - catch(Exception e) { - AbstractBlock* source = (AbstractBlock *)(e.getSource()); - cerr << qPrintable(source->getName()) << ":" << qPrintable(e.getMessage()) << endl; - throw(e); - } - } } QString FunctionalBlock::getReferenceXmlFile() {