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

Private GIT Repository
nearly finished GroupBlock VHDL gen
[blast.git] / SourceItem.cpp
index 27db2a33eea2686df69e493cf2d4d2068b3831ee..52cf8875798085325f8c4c69eddec5381c4e3c92 100644 (file)
@@ -598,15 +598,14 @@ void SourceItem::load(QDomElement funcElement) throw(Exception) {
     throw(Exception(PROJECTFILE_CORRUPTED));
   }
   if (referenceMd5 != referenceXml) {
-    throw(Exception(PROJECTFILE_CORRUPTED));
+    reference = referenceXml;
   }
   else {
     reference = referenceMd5;
   }
-  
-  GroupBlock* parentGroupBlock = AB_TO_GRP(((GroupItem *)parentItem())->getRefBlock());
-  FunctionalBlock* functionalBlock = params->getGraph()->createFunctionalBlock(parentGroupBlock, reference);
-  /* NB: addFunctionalBlock creates all interfaces from the reference, which is annoying when
+    
+  FunctionalBlock* functionalBlock = params->getGraph()->createSourceBlock(reference);
+  /* NB: createSourceBlock creates all interfaces from the reference, which is annoying when
     reading bif_iface tags. Thus interface are all removed.
   */
   functionalBlock->setName(name);
@@ -617,7 +616,7 @@ void SourceItem::load(QDomElement funcElement) throw(Exception) {
   setId(id);
 
 
-  QDomNodeList blockParamNodes = funcElement.elementsByTagName("bif_parameter");
+  QDomNodeList blockParamNodes = funcElement.elementsByTagName("source_parameter");
   // setting parameters value
   for(int i=0; i<blockParamNodes.length(); i++){
     QDomElement currentBlockParamNode = blockParamNodes.at(i).toElement();
@@ -631,12 +630,12 @@ void SourceItem::load(QDomElement funcElement) throw(Exception) {
     BlockParameter *blockParam = NULL;
     blockParam = functionalBlock->getParameterFromName(name);
     if (blockParam == NULL) throw(Exception(PROJECTFILE_CORRUPTED));
-    blockParam->setValue(value);
+    blockParam->setValue(value);    
   }  
 
   // recreate all (non-control) interfaces because of some may have a multiplicity>1 with several examplars
   functionalBlock->removeAllInterfaces();
-  QDomNodeList interfaceNodes = funcElement.elementsByTagName("bif_iface");
+  QDomNodeList interfaceNodes = funcElement.elementsByTagName("source_iface");
   // setting interfaces (user name, and for multiplicity>1 may be create some new ones)
   for(int i=0; i<interfaceNodes.length(); i++) {