]> AND Private Git Repository - blast.git/blobdiff - ReferenceBlock.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
after merge
[blast.git] / ReferenceBlock.cpp
index 037c64459ff8185ee0f05be5f09fd7c404019c55..5137d73f576c7af050a3d82ccd6269c88d9f31cf 100644 (file)
@@ -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; i<b.bidirs.size(); i++){
     ReferenceInterface *iface = (ReferenceInterface *)(b.bidirs.at(i));
     toWrite << iface->getName();
+    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));
+}
+
+