From 9259da0e93e1ba2b5acd2f68d1132e0d9727919b Mon Sep 17 00:00:00 2001 From: "dmy@lab" Date: Thu, 15 Jan 2015 17:31:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E6=8F=90=E4=BA=A4=E7=9A=84bug=202.=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=86from=E5=92=8Cto=E4=B8=AD=E7=9A=84to=E4=B8=8D=E6=98=AFn?= =?UTF-8?q?ode=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dmy@lab --- testHasttable/topologyrecorder.cpp | 47 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/testHasttable/topologyrecorder.cpp b/testHasttable/topologyrecorder.cpp index 972079e..345fce3 100644 --- a/testHasttable/topologyrecorder.cpp +++ b/testHasttable/topologyrecorder.cpp @@ -99,8 +99,8 @@ bool TopologyRecorder::startWithNode(const QString& node) if(ce.startsWith("AC")) { QString acID=ce; - fromTo.first=node; - fromTo.second=acID; +// fromTo.first=node; +// fromTo.second=acID; ACLineSegment *AC=static_cast(ht[acID]); if(!AC) { @@ -121,8 +121,8 @@ bool TopologyRecorder::startWithNode(const QString& node) { // std::cout<getName().toStdString()<(ht[swID]); if(!SW) { @@ -155,8 +155,8 @@ bool TopologyRecorder::startWithNode(const QString& node) // std::cout<<"Dissw not belong "<isEquipmentNeeded(equipmentContainer)) { this->tfs.push_back(tfID); - fromTo.first=node; - fromTo.second=tfID; +// fromTo.first=node; +// fromTo.second=tfID; foundEle=tf; } else @@ -237,14 +237,24 @@ bool TopologyRecorder::startWithNode(const QString& node) if(foundEle) { Branch *branch=NULL; + QString nextTerminal; + nextTerminal=(terminalA==anotherTerminal)?terminalB:terminalA; + Terminal *nextTerminalP=static_cast(ht[nextTerminal]); + if(!nextTerminalP) + { + continue; + } + //有可能会访问到重复的元件,所以这里判断一下,如果是已经访问过的就不添加了。 + if(this->hasAdded.contains(foundEle->getID())) + { + continue; + } + this->hasAdded[foundEle->getID()]=0; + QString nextNode=nextTerminalP->getConnectivityNode(); + fromTo.first=node; + fromTo.second=nextNode; switch(typ) { - //有可能会访问到重复的元件,所以这里判断一下,如果是已经访问过的就不添加了。 - if(this->hasAdded.contains(foundEle->getID())) - { - continue; - } - this->hasAdded[foundEle->getID()]=0; case TopologyRecorder::Type::AC: branch=new Line(fromTo,static_cast(foundEle),this); this->cimExporter.add(fromTo,static_cast(branch)); @@ -264,14 +274,7 @@ bool TopologyRecorder::startWithNode(const QString& node) default: break; } - QString nextTerminal; - nextTerminal=(terminalA==anotherTerminal)?terminalB:terminalA; - Terminal *nextTerminalP=static_cast(ht[nextTerminal]); - if(!nextTerminalP) - { - continue; - } - QString nextNode=nextTerminalP->getConnectivityNode(); + this->startWithNode(nextNode); } else