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

Private GIT Repository
clkconvert OP compute done
[blast.git] / Parameters.cpp
index ec0041f48c3432062533f54779382fae3fb4a5c6..23b798f1a47e54d16bb6a91fad8508b7ba31661b 100644 (file)
@@ -78,6 +78,7 @@ Graph* Parameters::initGraph(bool createTopGroupIfaces) {
 \r
 void Parameters::destroyGraph() {\r
   delete graph;\r
+  graph = new Graph();\r
 }\r
 \r
 ReferenceBlock* Parameters::getReferenceBlock(int idCategory, int idBlock) {\r
@@ -275,6 +276,14 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
     if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
 \r
     if (idUpperScene == -1) {\r
+      QString clkList = currentSceneNode.attribute("clklist","none");\r
+      if (clkList == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
+      QStringList clks = clkList.split(",");\r
+      for(int j=0;j<clks.size();j++) {\r
+        double freq = clks.at(j).toDouble(&ok);\r
+        if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+        graph->addClock(freq);\r
+      }\r
       topGroup = dispatcher->createTopScene(Dispatcher::Load);\r
       topScene->setId(idScene);\r
       groupItem = topScene->getGroupItem();      \r
@@ -460,12 +469,16 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
     int to = currentConnectionNode.attribute("to","none").toInt(&ok);\r
     if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
 \r
-\r
+    bool showConn = true;\r
+    QString visStr = currentConnectionNode.attribute("visible","none");\r
+    if (visStr == "false") {\r
+      showConn = false;\r
+    }\r
     InterfaceItem *iface1 = searchInterfaceItemById(from,topScene);\r
     InterfaceItem *iface2 = searchInterfaceItemById(to,topScene);\r
 \r
     if(iface1 != NULL && iface2 != NULL){\r
-      dispatcher->createConnection(Dispatcher::Load, iface1,iface2);\r
+      dispatcher->createConnection(Dispatcher::Load, iface1,iface2,showConn);\r
     } else {\r
       cout << "interfaces not found, connect canceled!" << endl;\r
     }\r
@@ -1173,7 +1186,9 @@ void Parameters::save(QString confFile) {
 \r
       writer.writeAttribute("from",QString::number(item->getFromInterfaceItem()->getId()));\r
       writer.writeAttribute("to", QString::number(item->getToInterfaceItem()->getId()));\r
-\r
+      if (!item->isVisible()) {\r
+        writer.writeAttribute("visible","false");\r
+      }\r
       writer.writeEndElement();\r
     }\r
 \r