aboutsummaryrefslogtreecommitdiffstats
path: root/gui/basewindow.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-12-20 15:25:10 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2019-12-20 15:25:10 +0100
commitd399346de0f258a4871ce6e5162481586175f76d (patch)
tree3265f14b3ee0a397091347799635a42188474b16 /gui/basewindow.cc
parenta05954249a46f87a218aad7db6db28f2a02444ec (diff)
downloadnextpnr-d399346de0f258a4871ce6e5162481586175f76d.tar.gz
nextpnr-d399346de0f258a4871ce6e5162481586175f76d.tar.bz2
nextpnr-d399346de0f258a4871ce6e5162481586175f76d.zip
Add options to enable/disable displayed elements
Diffstat (limited to 'gui/basewindow.cc')
-rw-r--r--gui/basewindow.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index 550a4b93..7290f73c 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -225,6 +225,38 @@ void BaseMainWindow::createMenusAndBars()
actionZoomOutbound->setIcon(QIcon(":/icons/resources/shape_square.png"));
connect(actionZoomOutbound, &QAction::triggered, fpgaView, &FPGAViewWidget::zoomOutbound);
+ actionDisplayBel = new QAction("Enable/Disable Bels", this);
+ actionDisplayBel->setIcon(QIcon(":/icons/resources/bel.png"));
+ actionDisplayBel->setCheckable(true);
+ actionDisplayBel->setChecked(true);
+ connect(actionDisplayBel, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals);
+
+ actionDisplayWire = new QAction("Enable/Disable Wires", this);
+ actionDisplayWire->setIcon(QIcon(":/icons/resources/wire.png"));
+ actionDisplayWire->setCheckable(true);
+ actionDisplayWire->setChecked(true);
+ connect(actionDisplayWire, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals);
+
+ actionDisplayPip = new QAction("Enable/Disable Pips", this);
+ actionDisplayPip->setIcon(QIcon(":/icons/resources/pip.png"));
+ actionDisplayPip->setCheckable(true);
+#ifdef ARCH_ECP5
+ actionDisplayPip->setChecked(false);
+#else
+ actionDisplayPip->setChecked(true);
+#endif
+ connect(actionDisplayPip, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals);
+
+ actionDisplayGroups = new QAction("Enable/Disable Groups", this);
+ actionDisplayGroups->setIcon(QIcon(":/icons/resources/group.png"));
+ actionDisplayGroups->setCheckable(true);
+ actionDisplayGroups->setChecked(true);
+ connect(actionDisplayGroups, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals);
+
+ // set initial state
+ fpgaView->enableDisableDecals(actionDisplayBel->isChecked(), actionDisplayWire->isChecked(),
+ actionDisplayPip->isChecked(), actionDisplayGroups->isChecked());
+
// Add main menu
menuBar = new QMenuBar();
menuBar->setGeometry(QRect(0, 0, 1024, 27));
@@ -281,6 +313,11 @@ void BaseMainWindow::createMenusAndBars()
deviceViewToolBar->addAction(actionZoomOut);
deviceViewToolBar->addAction(actionZoomSelected);
deviceViewToolBar->addAction(actionZoomOutbound);
+ deviceViewToolBar->addSeparator();
+ deviceViewToolBar->addAction(actionDisplayBel);
+ deviceViewToolBar->addAction(actionDisplayWire);
+ deviceViewToolBar->addAction(actionDisplayPip);
+ deviceViewToolBar->addAction(actionDisplayGroups);
// Add status bar with progress bar
statusBar = new QStatusBar();
@@ -293,6 +330,13 @@ void BaseMainWindow::createMenusAndBars()
setStatusBar(statusBar);
}
+void BaseMainWindow::enableDisableDecals()
+{
+ fpgaView->enableDisableDecals(actionDisplayBel->isChecked(), actionDisplayWire->isChecked(),
+ actionDisplayPip->isChecked(), actionDisplayGroups->isChecked());
+ ctx->refreshUi();
+}
+
void BaseMainWindow::open_json()
{
QString fileName = QFileDialog::getOpenFileName(this, QString("Open JSON"), QString(), QString("*.json"));