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

Private GIT Repository
changed ref/impls xsd and xml
[blast.git] / ReferenceBlock.cpp
index 7e697eb1baabb7bb5cf997543abf403a6ae35611..b6dee80ce813a88016e75e0cc823a856239a263c 100644 (file)
@@ -16,14 +16,9 @@ void ReferenceBlock::addCategory(int id) {
  categories.append(id);
 }
 
-void ReferenceBlock::setBriefDescription(const QString& str) {
+void ReferenceBlock::setDescription(const QString& str) {
   if(str != NULL)
-    descriptionBrief = str;
-}
-
-void ReferenceBlock::setDetailedDescription(const QString& str) {
-  if(str != NULL)
-    descriptionDetail = str;
+    description = str;
 }
 
 void ReferenceBlock::addImplementation(BlockImplementation *impl) {
@@ -120,28 +115,16 @@ void ReferenceBlock::loadInformations(QDomElement &elt) throw(Exception) {
   // getting description
   cout << "Block info : get description" << endl;  
   QDomElement eltDesc = eltCat.nextSiblingElement("description");
-  // getting brief  
-  QDomElement eltBrief = eltDesc.firstChildElement("brief");
-  QDomNode nodeBriefTxt = eltBrief.firstChild();
-  if (nodeBriefTxt.isNull()) {
-    descriptionBrief = "no brief description";
-  }
-  else {
-    QDomText txtBrief = nodeBriefTxt.toText();
-    descriptionBrief = txtBrief.data().trimmed();
-    cout << "block brief desc : " << qPrintable(descriptionBrief) << endl;
-  }
-  // getting detailed  
-  QDomElement eltDetail = eltBrief.nextSiblingElement("detailed");
-  QDomNode nodeDetailTxt = eltDetail.firstChild();
-  if (nodeDetailTxt.isNull()) {
-    descriptionDetail = "no detailed description";
+  // getting text
+  QDomNode nodeTxt = eltDesc.firstChild();
+  if (nodeTxt.isNull()) {
+    description = "no description";
   }
   else {
-    QDomText txtDetail = nodeDetailTxt.toText();
-    descriptionDetail = txtDetail.data().trimmed();
-    cout << "block detail desc : " << qPrintable(descriptionDetail) << endl;
-  }
+    QDomText txtBrief = nodeTxt.toText();
+    description = txtBrief.data().trimmed();
+    cout << "block desc : " << qPrintable(description) << endl;
+  }  
 }
 
 void ReferenceBlock::loadParameters(QDomElement &elt) throw(Exception) {
@@ -436,8 +419,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
 
   toWrite << b.name;
   toWrite << b.xmlFile;
-  toWrite << b.descriptionBrief;
-  toWrite << b.descriptionDetail;
+  toWrite << b.description;
   toWrite << b.categories;
   toWrite << b.hashMd5;
   toWrite << b.params.size();
@@ -473,7 +455,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
       toWrite << iface->getDirection();
       toWrite << iface->getMultiplicity();
       toWrite << iface->getClockIfaceType();
-      toWrite << iface->getClockIface();
+      toWrite << iface->getClockIfaceString();
     }
   }
   // secondly write control ifaces
@@ -487,7 +469,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
       toWrite << iface->getDirection();    
       toWrite << iface->getMultiplicity();
       toWrite << iface->getClockIfaceType();
-      toWrite << iface->getClockIface();
+      toWrite << iface->getClockIfaceString();
     }
   }
   // secondly, write other ifaces
@@ -501,7 +483,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
       toWrite << iface->getDirection();    
       toWrite << iface->getMultiplicity();
       toWrite << iface->getClockIfaceType();
-      toWrite << iface->getClockIface();
+      toWrite << iface->getClockIfaceString();
     }
   }
   toWrite << b.outputs.size();
@@ -516,7 +498,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
       toWrite << iface->getDirection();    
       toWrite << iface->getMultiplicity();
       toWrite << iface->getClockIfaceType();
-      toWrite << iface->getClockIface();
+      toWrite << iface->getClockIfaceString();
     }
   }
   // secondly, write other ifaces
@@ -530,7 +512,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
       toWrite << iface->getDirection();    
       toWrite << iface->getMultiplicity();
       toWrite << iface->getClockIfaceType();
-      toWrite << iface->getClockIface();
+      toWrite << iface->getClockIfaceString();
     }
   }
   toWrite << b.bidirs.size();
@@ -543,7 +525,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) {
     toWrite << iface->getDirection();    
     toWrite << iface->getMultiplicity();
     toWrite << iface->getClockIfaceType();
-    toWrite << iface->getClockIface();
+    toWrite << iface->getClockIfaceString();
   }
 
   out << blockData;
@@ -565,8 +547,7 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) {
 
   in >> b.name;
   in >> b.xmlFile;
-  in >> b.descriptionBrief;
-  in >> b.descriptionDetail;
+  in >> b.description;
   in >> b.categories;
   in >> b.hashMd5;
   b.params.clear();