Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes net labels, issues #3340 and #2308. #3845

Merged
merged 1 commit into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes nett labels, issues #3340 and #2308.
  • Loading branch information
failiz committed Jun 16, 2021
commit 8342f254eb4e3391e3576e1def90564ef5b5f0ad
10 changes: 6 additions & 4 deletions src/items/symbolpaletteitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ SymbolPaletteItem::~SymbolPaletteItem() {
void SymbolPaletteItem::removeMeFromBus(double v) {
foreach (ConnectorItem * connectorItem, cachedConnectorItems()) {
if (m_isNetLabel) {
LocalNetLabels.remove(getLabel(), connectorItem);
LocalNetLabels.remove(m_label, connectorItem);
}
else {
double nv = useVoltage(connectorItem);
Expand Down Expand Up @@ -243,10 +243,11 @@ void SymbolPaletteItem::setProp(const QString & prop, const QString & value) {
}

void SymbolPaletteItem::setLabel(const QString & label) {
removeMeFromBus(0);

m_modelPart->setLocalProp("label", label);
removeMeFromBus(0); //Remove this specific item (bb, sch or pcb) from the previous net label
m_label = label; // Update the label for this specific item (bb, sch or pcb)
m_modelPart->setLocalProp("label", label); //This line modifies the property label in the bb, sch and pcb items

//Add the conectors of the item to the new net label
foreach (ConnectorItem * connectorItem, cachedConnectorItems()) {
LocalNetLabels.insert(label, connectorItem);
}
Expand Down Expand Up @@ -521,6 +522,7 @@ NetLabel::NetLabel( ModelPart * modelPart, ViewLayer::ViewID viewID, const ViewG
}
modelPart->setLocalProp("label", label);
}
m_label = label;
setInstanceTitle(label, true);

// direction is now obsolete, new netlabels use flip
Expand Down
1 change: 1 addition & 0 deletions src/items/symbolpaletteitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public slots:
QPointer<ConnectorItem> m_connector1;
bool m_voltageReference;
bool m_isNetLabel;
QString m_label;
};


Expand Down