X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/cf93fd850a8b6e9a6f40faed9f796a0e2fb0cedb..18fecf25efe710631fabecbb9f689c2997fdfe18:/BoxItem.cpp diff --git a/BoxItem.cpp b/BoxItem.cpp index 53d56ec..4471c86 100644 --- a/BoxItem.cpp +++ b/BoxItem.cpp @@ -514,6 +514,9 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) { QAction* showWishboneIface = NULL; QAction* showParameters = NULL; QAction* showPatterns = NULL; + QAction* showModifier = NULL; + QAction* removeModifier = NULL; + QAction* generateVHDL = NULL; InterfaceItem* ifaceItem = getInterfaceItemFromCursor(event->pos().x(), event->pos().y()); // menu for interface @@ -560,9 +563,25 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) { } } } - if ((iface->getAssociatedIface() != NULL) && (iface->getDirection() == AbstractInterface::Output)) { - showPatterns = menu.addAction("Show patterns"); + if (iface->getAssociatedIface() != NULL) { + if (iface->getDirection() == AbstractInterface::Output) { + showPatterns = menu.addAction("Show output pattern"); + } + else if (iface->getDirection() == AbstractInterface::Input) { + showPatterns = menu.addAction("Show input pattern"); + } + } + + if (iface->getAssociatedIface() != NULL) { + ConnectedInterface* assoIface = AI_TO_CON(iface->getAssociatedIface()); + if (assoIface->getInputModifier() != NULL) { + removeModifier = menu.addAction("Remove input modifier"); + } + if (assoIface->getInputModifier() != NULL) { + showModifier = menu.addAction("Show input modifier parameters"); + } } + } // menu for blocks (group or func) else { @@ -588,6 +607,7 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) { showWishboneIface->setChecked(wishboneVisible); } removeAction = menu.addAction("Remove"); + generateVHDL = menu.addAction("Generate VHDL"); } QAction* selectedAction = NULL; @@ -643,6 +663,16 @@ void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) { else if(selectedAction == showPatterns) { dispatcher->showPatterns(ifaceItem); } + else if(selectedAction == removeModifier) { + dispatcher->removeModifier(ifaceItem); + } + else if(selectedAction == showModifier) { + dispatcher->showModifier(ifaceItem); + } + else if(selectedAction == generateVHDL) { + dispatcher->generateBlockVHDL(this); + } + } void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) { @@ -703,6 +733,7 @@ void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) { */ functionalBlock->setName(name); setRefBlock(functionalBlock); + params->blockToItem.insert(functionalBlock,this); setPos(posX,posY); setDimension(dimX,dimY);