X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/56f7c4239666506c59af42885f0bf0141d21a614..c85843afb9bd492b46d6fe87a8287157097483f5:/ReferenceBlock.cpp?ds=sidebyside diff --git a/ReferenceBlock.cpp b/ReferenceBlock.cpp index 037c644..5137d73 100644 --- a/ReferenceBlock.cpp +++ b/ReferenceBlock.cpp @@ -94,7 +94,7 @@ void ReferenceBlock::loadInformations(QDomElement &elt) throw(Exception) { } else { QDomText txtName = nodeNameTxt.toText(); - name = txtName.data().trimmed(); + name = normalizeName(txtName.data().trimmed()); cout<< "block name : " << qPrintable(name) << endl; } @@ -104,11 +104,16 @@ void ReferenceBlock::loadInformations(QDomElement &elt) throw(Exception) { QString idsStr = eltCat.attribute("ids","none"); if (idsStr == "none") throw (Exception(BLOCKFILE_CORRUPTED)); - QStringList listCat = idsStr.split(","); - foreach(QString str, listCat) - { - int idCat = str.toInt(&ok); - categories.append(idCat); + if (idsStr.isEmpty()) { + categories.append(99); + } + else { + QStringList listCat = idsStr.split(","); + foreach(QString str, listCat) + { + int idCat = str.toInt(&ok); + categories.append(idCat); + } } // getting description @@ -417,6 +422,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i)); if (iface->getPurpose() == AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -428,6 +434,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i)); if (iface->getPurpose() != AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -440,6 +447,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i)); if (iface->getPurpose() == AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -451,6 +459,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i)); if (iface->getPurpose() != AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -461,6 +470,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { for(int i=0; igetName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -535,6 +545,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -561,6 +574,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -587,6 +603,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -609,3 +628,10 @@ void ReferenceBlock::computeOutputPattern(int nbExec) throw(Exception) { // does strictly nothing throw(Exception(INVALID_REFBLOCK_USE)); } + +void ReferenceBlock::computeAdmittanceDelays() throw(Exception) { + // does strictly nothing + throw(Exception(INVALID_REFBLOCK_USE)); +} + +