X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/cfe8322b50c9ef08ffbc3e52b0849bca4cd1d0bf..8d3e09e430e829b9d847847334cbfe37790baca3:/BlockImplementation.cpp?ds=inline diff --git a/BlockImplementation.cpp b/BlockImplementation.cpp index 571b72b..af06ef3 100644 --- a/BlockImplementation.cpp +++ b/BlockImplementation.cpp @@ -20,6 +20,30 @@ BlockImplementation::BlockImplementation(const QString& _xmlFile, const QString referenceMd5 = _referenceMd5; } +void BlockImplementation::assignPatterns(FunctionalBlock *_block) throw(Exception) { + + block = _block; + + QFile implFile(xmlFile); + + // reading in into QDomDocument + QDomDocument document("implFile"); + + if (!implFile.open(QIODevice::ReadOnly)) { + throw(Exception(IMPLFILE_NOACCESS)); + } + if (!document.setContent(&implFile)) { + implFile.close(); + throw(Exception(IMPLFILE_NOACCESS)); + } + implFile.close(); + QDomElement impl = document.documentElement(); + QDomNodeList patternNode = impl.elementsByTagName("patterns"); + if (patternNode.isEmpty()) return; + QDomElement patternElt = patternNode.at(0).toElement(); + +} + void BlockImplementation::generateVHDL(FunctionalBlock* _block, const QString &path) throw(Exception) { block = _block;