X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/5d4e709cb8d460b2efc083e6e7999f1c3a0eb602..56f7c4239666506c59af42885f0bf0141d21a614:/Parameters.cpp diff --git a/Parameters.cpp b/Parameters.cpp index 3cc8c14..322046d 100644 --- a/Parameters.cpp +++ b/Parameters.cpp @@ -9,6 +9,7 @@ #include "GroupScene.h" #include "GroupItem.h" #include "BoxItem.h" +#include "SourceItem.h" #include "InterfaceItem.h" #include "ConnectionItem.h" @@ -232,6 +233,7 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) { if (idUpperScene != -1) { groupWidget->setWindowTitle(groupBlock->getName()); groupWidget->show(); + cout << qPrintable(groupItem->getRefBlock()->getName()) << " has upper box item in " << qPrintable(groupItem->getParentItem()->getScene()->getGroupItem()->getRefBlock()->getName()) << endl; } } dispatcher->setSceneCounter(maxIdScene+1); @@ -249,7 +251,29 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) { GroupScene *currentScene = searchSceneById(idScene,topScene); if(currentScene == NULL) throw(Exception(PROJECTFILE_CORRUPTED)); - + /********************************************************** + 2.1 : getting sources if it is top scene + ***********************************************************/ + if (currentScene->isTopScene()) { + QDomNodeList sourceNodes = currentSceneNode.elementsByTagName("source_item"); + cout << "top scene has " << sourceNodes.length() << " sources" << endl; + for(int j=0; jload(currentSBNode); + } + catch(Exception err) { + throw(err); + } + cout << "source item has been read, add it to the scene" << endl; + // add the block to the GroupScene + currentScene->addSourceItem(sourceItem); + } + } + /********************************************************** + 2.2 : getting functional blocks + ***********************************************************/ QDomNodeList functionalBlockNodes = currentSceneNode.elementsByTagName("bi_functional"); for(int j=0; j lst = currentScene->getBoxItems(); foreach(BoxItem* item, lst) { @@ -1022,6 +1046,15 @@ InterfaceItem* Parameters::searchInterfaceItemById(int id, GroupScene* scene) { return item; } } + if (scene->isTopScene()) { + foreach(SourceItem *block, scene->getSourceItems()){ + foreach(InterfaceItem *item, block->getInterfaces()){ + if(item->getId() == id){ + return item; + } + } + } + } foreach(BoxItem *block, scene->getBoxItems()){ foreach(InterfaceItem *item, block->getInterfaces()){ if(item->getId() == id){