BlockView pin multiconnect - display pin as error if >1 bus connected, #9
This commit is contained in:
@@ -1875,16 +1875,21 @@ void BlockView::reconnectAll() {
|
|||||||
for (int c = 0; c < conns.size(); ++c) {
|
for (int c = 0; c < conns.size(); ++c) {
|
||||||
QPointF cp = b->pol[conns[c]];
|
QPointF cp = b->pol[conns[c]];
|
||||||
for (int j = 0; j < pins.size(); ++j) {
|
for (int j = 0; j < pins.size(); ++j) {
|
||||||
if (!pins[j]->isVisible()) continue;
|
BlockItemPin * pin = pins[j];
|
||||||
QPointF pp = pins[j]->scenePos();
|
if (!pin->isVisible()) continue;
|
||||||
|
QPointF pp = pin->scenePos();
|
||||||
if ((cp - pp).manhattanLength() <= (grid_step / 2.)) {
|
if ((cp - pp).manhattanLength() <= (grid_step / 2.)) {
|
||||||
// qDebug() << "found";
|
// qDebug() << "found";
|
||||||
if (b->busType() == pins[j]->busType()) {
|
if (b->busType() == pin->busType()) {
|
||||||
b->connections_[conns[c]] = pins[j];
|
b->connections_[conns[c]] = pin;
|
||||||
if (!pins[j]->buses_.contains(b)) pins[j]->buses_ << b;
|
if (!pin->buses_.contains(b)) pin->buses_ << b;
|
||||||
pins[j]->setState(BlockItemPin::Connected);
|
if (m_pin_mc) {
|
||||||
|
pin->setState(BlockItemPin::Connected);
|
||||||
|
} else {
|
||||||
|
pin->setState(pin->buses_.size() == 1 ? BlockItemPin::Connected : BlockItemPin::Reject);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
pins[j]->setState(BlockItemPin::Reject);
|
pin->setState(BlockItemPin::Reject);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user