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

Private GIT Repository
added patterns and started OP computation
[blast.git] / Parameters.cpp
index 4fd583d614d70201cb92fff7132b4c06c7fb381c..c12fead572453807169c5e905bab6592a6c2e07b 100644 (file)
@@ -43,6 +43,8 @@ Parameters::Parameters() {
   isRstClkShown = false;\r
 \r
   projectPath = QDir::currentPath();\r
+  \r
+  validityExtension = "_enb";\r
 }\r
 \r
 Parameters::~Parameters() {\r
@@ -79,15 +81,6 @@ ReferenceBlock* Parameters::getReferenceBlock(int idCategory, int idBlock) {
 }\r
 \r
 \r
-FunctionalBlock* Parameters::duplicateFunctionalBlock(FunctionalBlock *block) {\r
-\r
-  ReferenceBlock* ref = block->getReference();\r
-  GroupBlock* group = AB_TO_GRP(block->getParent());\r
-\r
-  // adding to the graph\r
-  FunctionalBlock* newBlock = graph->addFunctionalBlock(group,ref);\r
-  return newBlock;\r
-}\r
 \r
 void Parameters::validateXmlFile(const QString& xmlFileName, const QString& xsdFileName, XmlFileType fileType) throw(Exception) {\r
   // opening configFile\r
@@ -269,7 +262,7 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
         throw(err);\r
       }\r
       // add the block to the GroupScene\r
-      currentScene->addBlockItem(funcItem);\r
+      currentScene->addBoxItem(funcItem);\r
     }\r
   }\r
   cout << "functional blocks loaded and created succefully!" << endl;\r
@@ -315,7 +308,7 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
       BoxItem* upperItem = NULL;\r
       if(insideGroup == NULL) cout << "group null" << endl;\r
       // now search within the scene which BoxItem has a childItem that is = to insideGroup\r
-      QList<BoxItem *> lst = currentScene->getBlockItems();\r
+      QList<BoxItem *> lst = currentScene->getBoxItems();\r
       foreach(BoxItem* item, lst) {\r
         if (item->getChildGroupItem() == insideGroup) {\r
           upperItem = item;\r
@@ -349,10 +342,10 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
         double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);\r
         if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
 \r
-        ConnectedInterface *refInter = insideGroup->searchInterfaceByName(refName)->refInter;\r
+        ConnectedInterface *refInter = insideGroup->searchInterfaceItemByName(refName)->refInter;\r
         InterfaceItem *ifaceItem = new InterfaceItem(position, orientation, refInter, upperItem, this);\r
         ifaceItem->setId(id);\r
-        upperItem->addInterface(ifaceItem);\r
+        upperItem->addInterfaceItem(ifaceItem);\r
       }\r
     }\r
   }\r
@@ -374,7 +367,7 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
     InterfaceItem *iface2 = searchInterfaceItemById(to,topScene);\r
 \r
     if(iface1 != NULL && iface2 != NULL){\r
-      dispatcher->connect(iface1,iface2);\r
+      dispatcher->createConnection(iface1,iface2);\r
     } else {\r
       cout << "interfaces not found, connect canceled!" << endl;\r
     }\r
@@ -529,7 +522,7 @@ void Parameters::loadReferencesFromXml() throw(Exception) {
 \r
       blockXML.close();\r
       try {\r
-        validateXmlFile(fileName,"block.xsd",Reference);\r
+        validateXmlFile(fileName,"reference.xsd",Reference);\r
       }\r
       catch(Exception err) {\r
         throw(err);\r
@@ -665,14 +658,14 @@ void Parameters::loadImplementationsFromXml() throw(Exception) {
       implXML.close();\r
       cout << "OK" << endl;\r
       cout << "reading " << qPrintable(fileName) << " content ...";\r
-      /*\r
+\r
       try {\r
-        validateXmlFile(fileName,"block.xsd",Implementation);\r
+        validateXmlFile(fileName,"implementation.xsd",Implementation);\r
       }\r
       catch(Exception e) {\r
         throw(e);\r
       }\r
-      */\r
+\r
       // reading in into QDomDocument\r
       QDomDocument document ("FileXML");\r
       if (!implXML.open(QIODevice::ReadOnly)) {\r
@@ -844,9 +837,9 @@ QList<AbstractBlock *> Parameters::getBlocksToConfigure() {
 \r
 \r
 void Parameters::updateToolbar() {\r
-  int nb = currentScene->getBlockItems().length();\r
+  int nb = currentScene->getBoxItems().length();\r
   for(int i = 0; i<nb; i++){\r
-    if(currentScene->getBlockItems().at(i)->isSelected()){\r
+    if(currentScene->getBoxItems().at(i)->isSelected()){\r
       currentScene->getGroupWidget()->enableGroupButton(true);\r
       return;\r
     }\r
@@ -996,7 +989,7 @@ GroupItem* Parameters::searchGroupItemById(int id, GroupScene *scene) {
 \r
 BoxItem* Parameters::searchBlockItemById(int id, GroupScene *scene) {\r
 \r
-  foreach(BoxItem *item, scene->getBlockItems()){\r
+  foreach(BoxItem *item, scene->getBoxItems()){\r
     if(item->getId() == id){\r
       return item;\r
     }\r
@@ -1017,7 +1010,7 @@ InterfaceItem* Parameters::searchInterfaceItemById(int id, GroupScene* scene) {
       return item;\r
     }\r
   }\r
-  foreach(BoxItem *block, scene->getBlockItems()){\r
+  foreach(BoxItem *block, scene->getBoxItems()){\r
     foreach(InterfaceItem *item, block->getInterfaces()){\r
       if(item->getId() == id){\r
         return item;\r