diff options
-rw-r--r-- | gui/basewindow.cc | 2 | ||||
-rw-r--r-- | gui/designwidget.cc | 8 | ||||
-rw-r--r-- | gui/designwidget.h | 1 | ||||
-rw-r--r-- | gui/fpgaviewwidget.cc | 2 | ||||
-rw-r--r-- | gui/fpgaviewwidget.h | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 96799e85..6e997011 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -2,6 +2,7 @@ * nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
+ * Copyright (C) 2018 Serge Bazanski <q3k@symbioticeda.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -84,6 +85,7 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent SLOT(onSelectedArchItem(std::vector<DecalXY>, bool)));
connect(fpgaView, SIGNAL(clickedBel(BelId, bool)), designview, SLOT(onClickedBel(BelId, bool)));
connect(fpgaView, SIGNAL(clickedWire(WireId, bool)), designview, SLOT(onClickedWire(WireId, bool)));
+ connect(fpgaView, SIGNAL(clickedPip(PipId, bool)), designview, SLOT(onClickedPip(PipId, bool)));
connect(designview, SIGNAL(highlight(std::vector<DecalXY>, int)), fpgaView,
SLOT(onHighlightGroupChanged(std::vector<DecalXY>, int)));
diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 674c74c7..d55c84e9 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -2,6 +2,7 @@ * nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
+ * Copyright (C) 2018 Serge Bazanski <q3k@symbioticeda.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -521,6 +522,13 @@ void DesignWidget::onClickedWire(WireId wire, bool keep) Q_EMIT selected(getDecals(ElementType::WIRE, ctx->getWireName(wire)), keep);
}
+void DesignWidget::onClickedPip(PipId pip, bool keep)
+{
+ QTreeWidgetItem *item = nameToItem[getElementIndex(ElementType::PIP)].value(ctx->getPipName(pip).c_str(ctx));
+ treeWidget->setCurrentItem(item);
+ Q_EMIT selected(getDecals(ElementType::PIP, ctx->getPipName(pip)), keep);
+}
+
void DesignWidget::onItemSelectionChanged()
{
if (treeWidget->selectedItems().size() == 0)
diff --git a/gui/designwidget.h b/gui/designwidget.h index a11ed062..60291cf3 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -77,6 +77,7 @@ class DesignWidget : public QWidget void updateTree();
void onClickedBel(BelId bel, bool keep);
void onClickedWire(WireId wire, bool keep);
+ void onClickedPip(PipId pip, bool keep);
private:
Context *ctx;
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index d51250bf..31271965 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -592,6 +592,8 @@ void FPGAViewWidget::mousePressEvent(QMouseEvent *event) clickedBel(closest.element.bel, ctrl); } else if (closest.type == ElementType::WIRE) { clickedWire(closest.element.wire, ctrl); + } else if (closest.type == ElementType::PIP) { + clickedPip(closest.element.pip, ctrl); } } } diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 335ee51b..690b12b8 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -121,6 +121,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions Q_SIGNALS: void clickedBel(BelId bel, bool add); void clickedWire(WireId wire, bool add); + void clickedPip(PipId pip, bool add); private: const float zoomNear_ = 0.1f; // do not zoom closer than this |