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

Private GIT Repository
clkconvert OP compute done
[blast.git] / GroupScene.cpp
index 70c88e25f1e8c96a4fcec0ec45d1d4e9dcd743c0..13b6e112b05834328d1fd1c7c7508a12b15fdd86 100644 (file)
@@ -9,6 +9,7 @@
 #include "ConnectionItem.h"
 #include "InterfaceItem.h"
 #include "AbstractBlock.h"
+#include "Graph.h"
 
 GroupScene::GroupScene(GroupScene *_parentScene, GroupWidget *_window, Dispatcher* _dispatcher, Parameters* _params, bool _topScene, QObject *parent) : QGraphicsScene(parent) {
   dispatcher = _dispatcher;
@@ -156,6 +157,15 @@ void GroupScene::removeBoxItem(BoxItem* item) {
   groupItem->updateShape();
 }
 
+BoxItem* GroupScene::searchBoxItemByName(QString name) {
+  foreach(BoxItem* item, boxItems) {
+    if (item->getRefBlock()->getName() == name) {
+      return item;
+    }
+  }
+  return NULL;
+}
+
 StimuliItem *GroupScene::createStimuliItem(AbstractBlock *block) {
 
   StimuliItem* item = new StimuliItem(block,dispatcher,params);
@@ -268,6 +278,16 @@ void GroupScene::save(QXmlStreamWriter &writer) {
   else {
     writer.writeAttribute("upper_scene",QString::number(parentScene->getId()));
   }
+  if (isTopScene()) {
+    QString clkList = "";
+    QList<double> lst = params->getGraph()->getClocks();
+    foreach(double d, lst) {
+      clkList += QString::number(d)+",";
+    }
+    clkList.chop(1);
+    writer.writeAttribute("clkList",clkList);
+
+  }
   groupItem->save(writer);
 
   if (isTopScene()) {