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

Private GIT Repository
modifying pattern methods to throw exceptions
[blast.git] / BoxItem.cpp
index 568e946458a69a7b9604901f114479be7d0780fd..c473e6f70060a91d81ad889bde201e6552c1dc29 100644 (file)
@@ -504,6 +504,7 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
   QAction* showRstClkIface = NULL;
   QAction* showWishboneIface = NULL;
   QAction* showParameters = NULL;
   QAction* showRstClkIface = NULL;
   QAction* showWishboneIface = NULL;
   QAction* showParameters = NULL;
+  QAction* showPatterns = NULL;
 
   InterfaceItem* ifaceItem = getInterfaceItemFromCursor(event->pos().x(), event->pos().y());
   // menu for interface
 
   InterfaceItem* ifaceItem = getInterfaceItemFromCursor(event->pos().x(), event->pos().y());
   // menu for interface
@@ -550,6 +551,9 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
         }
       }      
     }
         }
       }      
     }
+    if ((iface->getAssociatedIface() != NULL) && (iface->getDirection() == AbstractInterface::Output)) {
+      showPatterns = menu.addAction("Show patterns");
+    }
   }
   // menu for blocks (group or func)
   else {
   }
   // menu for blocks (group or func)
   else {
@@ -624,13 +628,12 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
   else if(selectedAction == showWishboneIface) {
     dispatcher->showWishboneIface(this);
   }
   else if(selectedAction == showWishboneIface) {
     dispatcher->showWishboneIface(this);
   }
-  else if(selectedAction == showParameters) {
-    if (refBlock->isFunctionalBlock()) {
-      FunctionalBlock* fun = AB_TO_FUN(refBlock);
-      fun->createDelta();
-    }
+  else if(selectedAction == showParameters) {    
     new ParametersWindow(refBlock, params, NULL);
     new ParametersWindow(refBlock, params, NULL);
-  }    
+  }
+  else if(selectedAction == showPatterns) {    
+    dispatcher->showPatterns(ifaceItem);
+  }
 }
 
 void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) {
 }
 
 void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) {
@@ -826,7 +829,7 @@ void BoxItem::save(QXmlStreamWriter &writer) {
 
     writer.writeAttribute("id",QString::number(id));
     writer.writeAttribute("inside_group",QString::number(childGroupItem->getId()));
 
     writer.writeAttribute("id",QString::number(id));
     writer.writeAttribute("inside_group",QString::number(childGroupItem->getId()));
-    QString attrPos = QString::number(pos().x()).append(",").append(QString::number(pos().y()));
+    QString attrPos = QString::number((int)(pos().x())).append(",").append(QString::number((int)(pos().y())));
     writer.writeAttribute("position",attrPos);
     QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
     writer.writeAttribute("dimension",attrDim);
     writer.writeAttribute("position",attrPos);
     QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
     writer.writeAttribute("dimension",attrDim);