mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
Fix problem when really old elements are added to a new project. These elements do not have an uuid for each terminal. So when exporting, save an unique ID into the terminal. So the conductors know to which terminal they must be connected
This commit is contained in:
@@ -1864,6 +1864,28 @@ void Diagram::changeZValue(QET::DepthOption option)
|
||||
delete undo;
|
||||
}
|
||||
|
||||
int Diagram::uniqueTerminalID() const
|
||||
{
|
||||
for (int i=1; i < 10000; i++) {
|
||||
bool found = false;
|
||||
for (auto element: elements()) {
|
||||
for (auto terminal: element->terminals()) {
|
||||
if (terminal->ID() == i) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Diagram::loadElmtFolioSeq
|
||||
This class loads all folio sequential variables related
|
||||
|
||||
Reference in New Issue
Block a user