mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Electric potential search: folio report are take into account
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2689 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1335,6 +1335,14 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(QList <Terminal *> *t_li
|
||||
if (!t_list -> contains(terminal1)) {
|
||||
t_list -> append(terminal1);
|
||||
QList <Conductor *> other_conductors_list_t1 = terminal1 -> conductors();
|
||||
|
||||
//get terminal share the same potential of terminal1
|
||||
Terminal *t1_bis = relatedPotentialTerminal(terminal1);
|
||||
if (t1_bis && !t_list->contains(t1_bis)) {
|
||||
t_list -> append(t1_bis);
|
||||
other_conductors_list_t1 += t1_bis->conductors();
|
||||
}
|
||||
|
||||
other_conductors_list_t1.removeAll(this);
|
||||
//recherche les conducteurs connecté au conducteur déjà trouvé
|
||||
foreach (Conductor *c, other_conductors_list_t1) {
|
||||
@@ -1342,10 +1350,19 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(QList <Terminal *> *t_li
|
||||
}
|
||||
other_conductors += other_conductors_list_t1.toSet();
|
||||
}
|
||||
|
||||
//renvoie tous les conducteurs du terminal 2
|
||||
if (!t_list -> contains(terminal2)) {
|
||||
t_list -> append(terminal2);
|
||||
QList <Conductor *> other_conductors_list_t2 = terminal2 -> conductors();
|
||||
|
||||
//get terminal share the same potential of terminal1
|
||||
Terminal *t2_bis = relatedPotentialTerminal(terminal2);
|
||||
if (t2_bis && !t_list->contains(t2_bis)) {
|
||||
t_list -> append(t2_bis);
|
||||
other_conductors_list_t2 += t2_bis->conductors();
|
||||
}
|
||||
|
||||
other_conductors_list_t2.removeAll(this);
|
||||
//recherche les conducteurs connecté au conducteur déjà trouvé
|
||||
foreach (Conductor *c, other_conductors_list_t2) {
|
||||
@@ -1359,6 +1376,21 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(QList <Terminal *> *t_li
|
||||
return(other_conductors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conductor::relatedPotentialTerminal
|
||||
* find another terminal in the same electric potential of terminal @t
|
||||
*/
|
||||
Terminal * Conductor::relatedPotentialTerminal (Terminal *t) {
|
||||
//terminal must have a folio report parent.
|
||||
if (t->parentElement()->linkType() & Element::Report) {
|
||||
QList <Element *> elmt_list = t->parentElement()->linkedElements();
|
||||
if (!elmt_list.isEmpty()) {
|
||||
return (elmt_list.first()->terminals().first());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return l'editeur de schemas parent ou 0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user