From 34772634317972aa4f816b6010a273bd7f3d17f3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 18 Jul 2018 17:18:44 +0200 Subject: removed not used and buggy features --- gui/designwidget.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'gui/designwidget.cc') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 335ed929..5181cd23 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -230,7 +230,6 @@ void DesignWidget::newContext(Context *ctx) bel_root->setText(0, "Bels"); treeWidget->insertTopLevelItem(0, bel_root); if (ctx) { - Q_EMIT contextLoadStatus("Configuring bels..."); for (auto bel : ctx->getBels()) { auto id = ctx->getBelName(bel); QStringList items = QString(id.c_str(ctx)).split("/"); @@ -263,7 +262,6 @@ void DesignWidget::newContext(Context *ctx) wire_root->setText(0, "Wires"); treeWidget->insertTopLevelItem(0, wire_root); if (ctx) { - Q_EMIT contextLoadStatus("Configuring wires..."); for (auto wire : ctx->getWires()) { auto id = ctx->getWireName(wire); QStringList items = QString(id.c_str(ctx)).split("/"); @@ -295,7 +293,6 @@ void DesignWidget::newContext(Context *ctx) pip_root->setText(0, "Pips"); treeWidget->insertTopLevelItem(0, pip_root); if (ctx) { - Q_EMIT contextLoadStatus("Configuring pips..."); for (auto pip : ctx->getPips()) { auto id = ctx->getPipName(pip); QStringList items = QString(id.c_str(ctx)).split("/"); @@ -331,8 +328,6 @@ void DesignWidget::newContext(Context *ctx) cells_root = new QTreeWidgetItem(treeWidget); cells_root->setText(0, "Cells"); treeWidget->insertTopLevelItem(0, cells_root); - - Q_EMIT finishContextLoad(); } void DesignWidget::updateTree() -- cgit v1.2.3 From 19828bdf455d9e7d554cab639a2cd045c897b671 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 18 Jul 2018 17:33:04 +0200 Subject: added clear action for browsing history --- gui/designwidget.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gui/designwidget.cc') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 5181cd23..93f71355 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -125,11 +125,27 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net updateButtons(); }); + actionClear = new QAction("", this); + actionClear->setIcon(QIcon(":/icons/resources/cross.png")); + actionClear->setEnabled(true); + connect(actionClear, &QAction::triggered, this, [this] { + history_index = -1; + history.clear(); + QTreeWidgetItem *clickItem = treeWidget->selectedItems().at(0); + if (clickItem->parent()) { + ElementType type = static_cast(clickItem)->getType(); + if (type != ElementType::NONE) + addToHistory(treeWidget->selectedItems().at(0)); + } + updateButtons(); + }); + QToolBar *toolbar = new QToolBar(); toolbar->addAction(actionFirst); toolbar->addAction(actionPrev); toolbar->addAction(actionNext); toolbar->addAction(actionLast); + toolbar->addAction(actionClear); QWidget *topWidget = new QWidget(); QVBoxLayout *vbox1 = new QVBoxLayout(); -- cgit v1.2.3 From af8b2b83f67a295d87b9f0ae9f17c408f5fedddc Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 18 Jul 2018 18:06:47 +0200 Subject: cell and net now can be selected, fixed issue with highlight --- gui/designwidget.cc | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'gui/designwidget.cc') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 93f71355..898ff0c6 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -488,13 +488,12 @@ void DesignWidget::onItemSelectionChanged() addToHistory(clickItem); clearProperties(); - if (type == ElementType::BEL) { - IdString c = static_cast(clickItem)->getData(); - BelId bel = ctx->getBelByName(c); - decals.push_back(ctx->getBelDecal(bel)); - Q_EMIT selected(decals); + IdString c = static_cast(clickItem)->getData(); + Q_EMIT selected(getDecals(type, c)); + if (type == ElementType::BEL) { + BelId bel = ctx->getBelByName(c); QtProperty *topItem = addTopLevelProperty("Bel"); addProperty(topItem, QVariant::String, "Name", c.c_str(ctx)); @@ -505,12 +504,7 @@ void DesignWidget::onItemSelectionChanged() ElementType::CELL); } else if (type == ElementType::WIRE) { - IdString c = static_cast(clickItem)->getData(); WireId wire = ctx->getWireByName(c); - - decals.push_back(ctx->getWireDecal(wire)); - Q_EMIT selected(decals); - QtProperty *topItem = addTopLevelProperty("Wire"); addProperty(topItem, QVariant::String, "Name", c.c_str(ctx)); @@ -562,12 +556,7 @@ void DesignWidget::onItemSelectionChanged() } } } else if (type == ElementType::PIP) { - IdString c = static_cast(clickItem)->getData(); PipId pip = ctx->getPipByName(c); - - decals.push_back(ctx->getPipDecal(pip)); - Q_EMIT selected(decals); - QtProperty *topItem = addTopLevelProperty("Pip"); addProperty(topItem, QVariant::String, "Name", c.c_str(ctx)); @@ -587,7 +576,6 @@ void DesignWidget::onItemSelectionChanged() addProperty(delayItem, QVariant::Double, "Fall", delay.fallDelay()); addProperty(delayItem, QVariant::Double, "Average", delay.avgDelay()); } else if (type == ElementType::NET) { - IdString c = static_cast(clickItem)->getData(); NetInfo *net = ctx->nets.at(c).get(); QtProperty *topItem = addTopLevelProperty("Net"); @@ -636,7 +624,6 @@ void DesignWidget::onItemSelectionChanged() } } else if (type == ElementType::CELL) { - IdString c = static_cast(clickItem)->getData(); CellInfo *cell = ctx->cells.at(c).get(); QtProperty *topItem = addTopLevelProperty("Cell"); @@ -700,19 +687,28 @@ std::vector DesignWidget::getDecals(ElementType type, IdString value) WireId wire = ctx->getWireByName(value); if (wire != WireId()) { decals.push_back(ctx->getWireDecal(wire)); - Q_EMIT selected(decals); } } break; case ElementType::PIP: { PipId pip = ctx->getPipByName(value); if (pip != PipId()) { decals.push_back(ctx->getPipDecal(pip)); - Q_EMIT selected(decals); } } break; case ElementType::NET: { + NetInfo *net = ctx->nets.at(value).get(); + for (auto &item : net->wires) { + decals.push_back(ctx->getWireDecal(item.first)); + if (item.second.pip != PipId()) { + decals.push_back(ctx->getPipDecal(item.second.pip)); + } + } } break; case ElementType::CELL: { + CellInfo *cell = ctx->cells.at(value).get(); + if (cell->bel != BelId()) { + decals.push_back(ctx->getBelDecal(cell->bel)); + } } break; default: break; -- cgit v1.2.3 From 2df7e130fbc18c81840a841b16f4780fbcfda34a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 18 Jul 2018 18:37:54 +0200 Subject: Fix click on wire in net section --- gui/designwidget.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui/designwidget.cc') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 898ff0c6..4123bf30 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -612,7 +612,7 @@ void DesignWidget::onItemSelectionChanged() auto name = ctx->getWireName(item.first).c_str(ctx); QtProperty *wireItem = addSubGroup(wiresItem, name); - addProperty(wireItem, QVariant::String, "Name", name); + addProperty(wireItem, QVariant::String, "Wire", name, ElementType::WIRE); if (item.second.pip != PipId()) addProperty(wireItem, QVariant::String, "Pip", ctx->getPipName(item.second.pip).c_str(ctx), -- cgit v1.2.3 From 53034959f338c952f4cf905890e44aad2ba202ae Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Jul 2018 13:27:21 +0200 Subject: Start adding bitstream reading for ice40 --- gui/designwidget.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'gui/designwidget.cc') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 4123bf30..d28b843b 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -334,16 +334,7 @@ void DesignWidget::newContext(Context *ctx) for (auto pip : nameToItem[2].toStdMap()) { pip_root->addChild(pip.second); } - - // Add nets to tree - nets_root = new QTreeWidgetItem(treeWidget); - nets_root->setText(0, "Nets"); - treeWidget->insertTopLevelItem(0, nets_root); - - // Add cells to tree - cells_root = new QTreeWidgetItem(treeWidget); - cells_root->setText(0, "Cells"); - treeWidget->insertTopLevelItem(0, cells_root); + updateTree(); } void DesignWidget::updateTree() -- cgit v1.2.3