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) {
|
||||
QPointF cp = b->pol[conns[c]];
|
||||
for (int j = 0; j < pins.size(); ++j) {
|
||||
if (!pins[j]->isVisible()) continue;
|
||||
QPointF pp = pins[j]->scenePos();
|
||||
BlockItemPin * pin = pins[j];
|
||||
if (!pin->isVisible()) continue;
|
||||
QPointF pp = pin->scenePos();
|
||||
if ((cp - pp).manhattanLength() <= (grid_step / 2.)) {
|
||||
// qDebug() << "found";
|
||||
if (b->busType() == pins[j]->busType()) {
|
||||
b->connections_[conns[c]] = pins[j];
|
||||
if (!pins[j]->buses_.contains(b)) pins[j]->buses_ << b;
|
||||
pins[j]->setState(BlockItemPin::Connected);
|
||||
if (b->busType() == pin->busType()) {
|
||||
b->connections_[conns[c]] = pin;
|
||||
if (!pin->buses_.contains(b)) pin->buses_ << b;
|
||||
if (m_pin_mc) {
|
||||
pin->setState(BlockItemPin::Connected);
|
||||
} else {
|
||||
pin->setState(pin->buses_.size() == 1 ? BlockItemPin::Connected : BlockItemPin::Reject);
|
||||
}
|
||||
} else
|
||||
pins[j]->setState(BlockItemPin::Reject);
|
||||
pin->setState(BlockItemPin::Reject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user