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

Private GIT Repository
finished testbench generation
[blast.git] / GroupScene.cpp
index 70c88e25f1e8c96a4fcec0ec45d1d4e9dcd743c0..a50cb5ae97980f6b5aa003d80d99aa7e14dab51c 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()) {