aboutsummaryrefslogtreecommitdiffstats
path: root/gui/fpgaviewwidget.cc
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2019-12-28 15:46:02 +0100
committerGitHub <noreply@github.com>2019-12-28 15:46:02 +0100
commit247e18cf027334d5201be00735aa607250e6253d (patch)
tree850d77245b0469a57ddf522e7fb68e3a805e3498 /gui/fpgaviewwidget.cc
parent0d43aff2682d91817ea4a1fb5dff6e169ae9a659 (diff)
parentfb5480cde349008ab74e6b7179ac1b1fc8ffef1f (diff)
downloadnextpnr-247e18cf027334d5201be00735aa607250e6253d.tar.gz
nextpnr-247e18cf027334d5201be00735aa607250e6253d.tar.bz2
nextpnr-247e18cf027334d5201be00735aa607250e6253d.zip
Merge pull request #344 from YosysHQ/mmicko/ecp5_gui
ECP5 display improvement
Diffstat (limited to 'gui/fpgaviewwidget.cc')
-rw-r--r--gui/fpgaviewwidget.cc61
1 files changed, 45 insertions, 16 deletions
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index f2929d6e..2e1bbf63 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -66,6 +66,11 @@ FPGAViewWidget::FPGAViewWidget(QWidget *parent)
renderRunner_->start();
renderRunner_->startTimer(1000 / 2); // render lines 2 times per second
setMouseTracking(true);
+
+ displayBel_ = false;
+ displayWire_ = false;
+ displayPip_ = false;
+ displayGroup_ = false;
}
FPGAViewWidget::~FPGAViewWidget() {}
@@ -333,6 +338,14 @@ void FPGAViewWidget::paintGL()
void FPGAViewWidget::pokeRenderer(void) { renderRunner_->poke(); }
+void FPGAViewWidget::enableDisableDecals(bool bels, bool wires, bool pips, bool groups)
+{
+ displayBel_ = bels;
+ displayWire_ = wires;
+ displayPip_ = pips;
+ displayGroup_ = groups;
+}
+
void FPGAViewWidget::renderLines(void)
{
if (ctx_ == nullptr)
@@ -379,17 +392,25 @@ void FPGAViewWidget::renderLines(void)
// Local copy of decals, taken as fast as possible to not block the P&R.
if (decalsChanged) {
- for (auto bel : ctx_->getBels()) {
- belDecals.push_back({ctx_->getBelDecal(bel), bel});
+ if (displayBel_) {
+ for (auto bel : ctx_->getBels()) {
+ belDecals.push_back({ctx_->getBelDecal(bel), bel});
+ }
}
- for (auto wire : ctx_->getWires()) {
- wireDecals.push_back({ctx_->getWireDecal(wire), wire});
+ if (displayWire_) {
+ for (auto wire : ctx_->getWires()) {
+ wireDecals.push_back({ctx_->getWireDecal(wire), wire});
+ }
}
- for (auto pip : ctx_->getPips()) {
- pipDecals.push_back({ctx_->getPipDecal(pip), pip});
+ if (displayPip_) {
+ for (auto pip : ctx_->getPips()) {
+ pipDecals.push_back({ctx_->getPipDecal(pip), pip});
+ }
}
- for (auto group : ctx_->getGroups()) {
- groupDecals.push_back({ctx_->getGroupDecal(group), group});
+ if (displayGroup_) {
+ for (auto group : ctx_->getGroups()) {
+ groupDecals.push_back({ctx_->getGroupDecal(group), group});
+ }
}
}
}
@@ -430,20 +451,28 @@ void FPGAViewWidget::renderLines(void)
data->bbGlobal.clear();
// Draw Bels.
- for (auto const &decal : belDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayBel_) {
+ for (auto const &decal : belDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Wires.
- for (auto const &decal : wireDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayWire_) {
+ for (auto const &decal : wireDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Pips.
- for (auto const &decal : pipDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayPip_) {
+ for (auto const &decal : pipDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Groups.
- for (auto const &decal : groupDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayGroup_) {
+ for (auto const &decal : groupDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Bounding box should be calculated by now.