1.修复了上一次提交的bug
2.修复了from和to中的to不是node的bug Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
parent
5cd6849e95
commit
9259da0e93
|
|
@ -99,8 +99,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
if(ce.startsWith("AC"))
|
if(ce.startsWith("AC"))
|
||||||
{
|
{
|
||||||
QString acID=ce;
|
QString acID=ce;
|
||||||
fromTo.first=node;
|
// fromTo.first=node;
|
||||||
fromTo.second=acID;
|
// fromTo.second=acID;
|
||||||
ACLineSegment *AC=static_cast<ACLineSegment *>(ht[acID]);
|
ACLineSegment *AC=static_cast<ACLineSegment *>(ht[acID]);
|
||||||
if(!AC)
|
if(!AC)
|
||||||
{
|
{
|
||||||
|
|
@ -121,8 +121,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
{
|
{
|
||||||
// std::cout<<bi->getName().toStdString()<<std::endl;
|
// std::cout<<bi->getName().toStdString()<<std::endl;
|
||||||
QString swID=ce;
|
QString swID=ce;
|
||||||
fromTo.first=node;
|
// fromTo.first=node;
|
||||||
fromTo.second=swID;
|
// fromTo.second=swID;
|
||||||
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
||||||
if(!SW)
|
if(!SW)
|
||||||
{
|
{
|
||||||
|
|
@ -155,8 +155,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
// std::cout<<"Dissw not belong "<<disConID.toStdString()<<std::endl;
|
// std::cout<<"Dissw not belong "<<disConID.toStdString()<<std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fromTo.first=node;
|
// fromTo.first=node;
|
||||||
fromTo.second=disConID;
|
// fromTo.second=disConID;
|
||||||
|
|
||||||
if(!Dis)
|
if(!Dis)
|
||||||
{
|
{
|
||||||
|
|
@ -223,8 +223,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
if(this->isEquipmentNeeded(equipmentContainer))
|
if(this->isEquipmentNeeded(equipmentContainer))
|
||||||
{
|
{
|
||||||
this->tfs.push_back(tfID);
|
this->tfs.push_back(tfID);
|
||||||
fromTo.first=node;
|
// fromTo.first=node;
|
||||||
fromTo.second=tfID;
|
// fromTo.second=tfID;
|
||||||
foundEle=tf;
|
foundEle=tf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -237,14 +237,24 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
if(foundEle)
|
if(foundEle)
|
||||||
{
|
{
|
||||||
Branch *branch=NULL;
|
Branch *branch=NULL;
|
||||||
|
QString nextTerminal;
|
||||||
|
nextTerminal=(terminalA==anotherTerminal)?terminalB:terminalA;
|
||||||
|
Terminal *nextTerminalP=static_cast<Terminal *>(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)
|
switch(typ)
|
||||||
{
|
{
|
||||||
//有可能会访问到重复的元件,所以这里判断一下,如果是已经访问过的就不添加了。
|
|
||||||
if(this->hasAdded.contains(foundEle->getID()))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
this->hasAdded[foundEle->getID()]=0;
|
|
||||||
case TopologyRecorder::Type::AC:
|
case TopologyRecorder::Type::AC:
|
||||||
branch=new Line(fromTo,static_cast<ACLineSegment *>(foundEle),this);
|
branch=new Line(fromTo,static_cast<ACLineSegment *>(foundEle),this);
|
||||||
this->cimExporter.add(fromTo,static_cast<Line *>(branch));
|
this->cimExporter.add(fromTo,static_cast<Line *>(branch));
|
||||||
|
|
@ -264,14 +274,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QString nextTerminal;
|
|
||||||
nextTerminal=(terminalA==anotherTerminal)?terminalB:terminalA;
|
|
||||||
Terminal *nextTerminalP=static_cast<Terminal *>(ht[nextTerminal]);
|
|
||||||
if(!nextTerminalP)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
QString nextNode=nextTerminalP->getConnectivityNode();
|
|
||||||
this->startWithNode(nextNode);
|
this->startWithNode(nextNode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue