用CIMExporter分别处理读到的线路,开关,变压器等元件。
Signed-off-by: facat@lab.com <facat@lab.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "topologyrecorder.h"
|
||||
#include <iostream>
|
||||
TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT):eleHT(elementHT)
|
||||
TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT, QObject *parent):eleHT(elementHT)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
anotherTerminalVector=this->nodeToTerminal.value(node);//一个Node可以找到多个与之相连的Terminal
|
||||
for(int atI=0;atI<anotherTerminalVector.length();atI++)
|
||||
{
|
||||
bool foundCate=false;
|
||||
TopologyRecorder::Type::EleType typ;
|
||||
BasicElementInfo *foundEle=NULL;
|
||||
// bool foundCate=false;
|
||||
anotherTerminal=anotherTerminalVector.at(atI);
|
||||
if(this->reachedTerminal.contains(anotherTerminal))
|
||||
{
|
||||
@@ -65,7 +67,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
terminalB=AC->getTerminalB();
|
||||
std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
||||
std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
||||
foundCate=true;
|
||||
foundEle=AC;
|
||||
typ=TopologyRecorder::Type::AC;
|
||||
}
|
||||
if(ce.startsWith("SW"))
|
||||
{
|
||||
@@ -82,7 +85,6 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
||||
if(!SW)
|
||||
{
|
||||
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
||||
continue;
|
||||
}
|
||||
//显示开关状态
|
||||
@@ -97,7 +99,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
terminalA=SW->getTerminalA();
|
||||
terminalB=SW->getTerminalB();
|
||||
std::cout<<"find"<<SW->getID().toStdString()<<std::endl;
|
||||
foundCate=true;
|
||||
foundEle=SW;
|
||||
typ=TopologyRecorder::Type::BREAKER;
|
||||
}
|
||||
if(bi->getName()=="Disconnector")
|
||||
{
|
||||
@@ -130,7 +133,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
terminalA=Dis->getTerminalA();
|
||||
terminalB=Dis->getTerminalB();
|
||||
std::cout<<"find"<<Dis->getID().toStdString()<<std::endl;
|
||||
foundCate=true;
|
||||
foundEle=Dis;
|
||||
typ=TopologyRecorder::Type::DISCONNECTOR;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -174,16 +178,41 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||
if(this->isEquipmentNeeded(equipmentContainer))
|
||||
{
|
||||
this->tfs.push_back(tf->getNamingDescription());
|
||||
fromTo.first=node;
|
||||
fromTo.second=tfID;
|
||||
foundEle=tf;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||
}
|
||||
typ=TopologyRecorder::Type::TF;
|
||||
|
||||
}
|
||||
if(foundCate)
|
||||
if(foundEle)
|
||||
{
|
||||
this->branch.push_back(fromTo);
|
||||
Branch *branch=NULL;
|
||||
switch(typ)
|
||||
{
|
||||
case TopologyRecorder::Type::AC:
|
||||
branch=new Line(fromTo,static_cast<ACLineSegment *>(foundEle),this);
|
||||
this->cimExporter.add(fromTo,static_cast<Line *>(branch));
|
||||
break;
|
||||
case TopologyRecorder::Type::BREAKER:
|
||||
branch=new Switch(fromTo,this);
|
||||
this->cimExporter.add(fromTo,static_cast<Switch *>(branch));
|
||||
break;
|
||||
case TopologyRecorder::Type::DISCONNECTOR:
|
||||
branch=new Switch(fromTo,this);
|
||||
this->cimExporter.add(fromTo,static_cast<Switch *>(branch));
|
||||
break;
|
||||
case TopologyRecorder::Type::TF:
|
||||
branch=new Transformer(fromTo,static_cast<PowerTransformer *>(foundEle),this);
|
||||
this->cimExporter.add(fromTo,static_cast<Transformer *>(branch));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QString nextTerminal;
|
||||
nextTerminal=(terminalA==anotherTerminal)?terminalB:terminalA;
|
||||
Terminal *nextTerminalP=static_cast<Terminal *>(ht[nextTerminal]);
|
||||
|
||||
Reference in New Issue
Block a user