gui: allow selecting pips
This commit is contained in:
parent
e1dfbc0241
commit
96608c8d07
@ -2,6 +2,7 @@
|
|||||||
* nextpnr -- Next Generation Place and Route
|
* nextpnr -- Next Generation Place and Route
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* 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)));
|
SLOT(onSelectedArchItem(std::vector<DecalXY>, bool)));
|
||||||
connect(fpgaView, SIGNAL(clickedBel(BelId, bool)), designview, SLOT(onClickedBel(BelId, 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(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,
|
connect(designview, SIGNAL(highlight(std::vector<DecalXY>, int)), fpgaView,
|
||||||
SLOT(onHighlightGroupChanged(std::vector<DecalXY>, int)));
|
SLOT(onHighlightGroupChanged(std::vector<DecalXY>, int)));
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* nextpnr -- Next Generation Place and Route
|
* nextpnr -- Next Generation Place and Route
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* 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);
|
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()
|
void DesignWidget::onItemSelectionChanged()
|
||||||
{
|
{
|
||||||
if (treeWidget->selectedItems().size() == 0)
|
if (treeWidget->selectedItems().size() == 0)
|
||||||
|
@ -77,6 +77,7 @@ class DesignWidget : public QWidget
|
|||||||
void updateTree();
|
void updateTree();
|
||||||
void onClickedBel(BelId bel, bool keep);
|
void onClickedBel(BelId bel, bool keep);
|
||||||
void onClickedWire(WireId wire, bool keep);
|
void onClickedWire(WireId wire, bool keep);
|
||||||
|
void onClickedPip(PipId pip, bool keep);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Context *ctx;
|
Context *ctx;
|
||||||
|
@ -592,6 +592,8 @@ void FPGAViewWidget::mousePressEvent(QMouseEvent *event)
|
|||||||
clickedBel(closest.element.bel, ctrl);
|
clickedBel(closest.element.bel, ctrl);
|
||||||
} else if (closest.type == ElementType::WIRE) {
|
} else if (closest.type == ElementType::WIRE) {
|
||||||
clickedWire(closest.element.wire, ctrl);
|
clickedWire(closest.element.wire, ctrl);
|
||||||
|
} else if (closest.type == ElementType::PIP) {
|
||||||
|
clickedPip(closest.element.pip, ctrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void clickedBel(BelId bel, bool add);
|
void clickedBel(BelId bel, bool add);
|
||||||
void clickedWire(WireId wire, bool add);
|
void clickedWire(WireId wire, bool add);
|
||||||
|
void clickedPip(PipId pip, bool add);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const float zoomNear_ = 0.1f; // do not zoom closer than this
|
const float zoomNear_ = 0.1f; // do not zoom closer than this
|
||||||
|
Loading…
Reference in New Issue
Block a user