parent
a012ca3502
commit
edfb3310f8
|
|
@ -29,6 +29,23 @@ bool Disconnector::derivedParse(QXmlStreamReader &reader)
|
||||||
this->equipmentContainer=ss.replace("#","").leftRef(-1).toString();
|
this->equipmentContainer=ss.replace("#","").leftRef(-1).toString();
|
||||||
qDebug()<<"got "<<"Equipment.MemberOf_EquipmentContainer "<<this->equipmentContainer<<"\n";
|
qDebug()<<"got "<<"Equipment.MemberOf_EquipmentContainer "<<this->equipmentContainer<<"\n";
|
||||||
}
|
}
|
||||||
|
if("Naming.description"==reader.name())
|
||||||
|
{
|
||||||
|
this->namingDescription=reader.readElementText();
|
||||||
|
}
|
||||||
|
if("Switch.normalOpen"==reader.name())
|
||||||
|
{
|
||||||
|
QString open=reader.readElementText();
|
||||||
|
if(open=="TRUE")
|
||||||
|
{
|
||||||
|
this->isOpen=true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->isOpen=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,3 +53,22 @@ bool Disconnector::parse(QXmlStreamReader &reader)
|
||||||
{
|
{
|
||||||
return this->parseBasicInfo(reader);
|
return this->parseBasicInfo(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Disconnector::getNamingDescription()
|
||||||
|
{
|
||||||
|
return this->namingDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Disconnector::getOpenState()
|
||||||
|
{
|
||||||
|
return this->isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Disconnector::getTerminalA()
|
||||||
|
{
|
||||||
|
return this->terminalA;
|
||||||
|
}
|
||||||
|
QString Disconnector::getTerminalB()
|
||||||
|
{
|
||||||
|
return this->terminalB;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,16 @@ class Disconnector:public BasicElementInfo
|
||||||
public:
|
public:
|
||||||
explicit Disconnector(QObject *parent = 0);
|
explicit Disconnector(QObject *parent = 0);
|
||||||
virtual bool parse(QXmlStreamReader& reader);
|
virtual bool parse(QXmlStreamReader& reader);
|
||||||
|
QString getNamingDescription();
|
||||||
|
bool getOpenState();
|
||||||
|
QString getTerminalA();
|
||||||
|
QString getTerminalB();
|
||||||
protected:
|
protected:
|
||||||
QString terminalA;
|
QString terminalA;
|
||||||
QString terminalB;
|
QString terminalB;
|
||||||
QString equipmentContainer;
|
QString equipmentContainer;
|
||||||
|
QString namingDescription;
|
||||||
|
bool isOpen;
|
||||||
virtual bool derivedParse(QXmlStreamReader& reader);
|
virtual bool derivedParse(QXmlStreamReader& reader);
|
||||||
private:
|
private:
|
||||||
bool isTerminalA;
|
bool isTerminalA;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ bool ElementHashtable::GoPath()
|
||||||
// if(p->getName()=="ACLineSegment"){
|
// if(p->getName()=="ACLineSegment"){
|
||||||
// std::cout<<p->getID().toStdString()<<std::endl;
|
// std::cout<<p->getID().toStdString()<<std::endl;
|
||||||
// }
|
// }
|
||||||
if(p->getName()=="ACLineSegment" && p->getID()=="AC-671401")
|
if(p->getName()=="ACLineSegment" && p->getID()=="AC-591827")
|
||||||
{
|
{
|
||||||
ACLineSegment *ac=static_cast<ACLineSegment *>(p);//BusbarSection也就是线路头节点
|
ACLineSegment *ac=static_cast<ACLineSegment *>(p);//BusbarSection也就是线路头节点
|
||||||
QString acTerminal=ac->getTerminalB();
|
QString acTerminal=ac->getTerminalB();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elem
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TopologyRecorder::~TopologyRecorder()
|
||||||
|
{
|
||||||
|
std::cout<<"total tf"<<this->tfs.length()<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
bool TopologyRecorder::startWithNode(const QString& node)
|
bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
{
|
{
|
||||||
if(node=="")
|
if(node=="")
|
||||||
|
|
@ -52,28 +57,69 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
}
|
}
|
||||||
if(ce.startsWith("SW"))
|
if(ce.startsWith("SW"))
|
||||||
{
|
{
|
||||||
QString swID=ce;
|
BasicElementInfo *bi=ht[ce];
|
||||||
fromTo.first=node;
|
if(bi!=NULL)
|
||||||
fromTo.second=swID;
|
|
||||||
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
|
||||||
if(!SW)
|
|
||||||
{
|
{
|
||||||
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||||
continue;
|
if(bi->getName()=="Breaker")
|
||||||
}
|
{
|
||||||
//显示开关状态
|
QString swID=ce;
|
||||||
if(SW->getOpenState()==true)
|
fromTo.first=node;
|
||||||
{
|
fromTo.second=swID;
|
||||||
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
|
||||||
|
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
||||||
|
if(!SW)
|
||||||
|
{
|
||||||
|
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//显示开关状态
|
||||||
|
if(SW->getOpenState()==true)
|
||||||
|
{
|
||||||
|
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||||
|
}
|
||||||
|
terminalA=SW->getTerminalA();
|
||||||
|
terminalB=SW->getTerminalB();
|
||||||
|
std::cout<<"find"<<SW->getID().toStdString()<<std::endl;
|
||||||
|
foundCate=true;
|
||||||
|
}
|
||||||
|
if(bi->getName()=="Disconnector")
|
||||||
|
{
|
||||||
|
QString disConID=ce;
|
||||||
|
fromTo.first=node;
|
||||||
|
fromTo.second=disConID;
|
||||||
|
|
||||||
|
Disconnector *Dis=static_cast<Disconnector *>(ht[disConID]);
|
||||||
|
if(!Dis)
|
||||||
|
{
|
||||||
|
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//显示开关状态
|
||||||
|
if(Dis->getOpenState()==true)
|
||||||
|
{
|
||||||
|
std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||||
|
}
|
||||||
|
terminalA=Dis->getTerminalA();
|
||||||
|
terminalB=Dis->getTerminalB();
|
||||||
|
std::cout<<"find"<<Dis->getID().toStdString()<<std::endl;
|
||||||
|
foundCate=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
continue;
|
||||||
}
|
}
|
||||||
terminalA=SW->getTerminalA();
|
|
||||||
terminalB=SW->getTerminalB();
|
|
||||||
std::cout<<"find"<<SW->getID().toStdString()<<std::endl;
|
|
||||||
foundCate=true;
|
|
||||||
}
|
}
|
||||||
if(ce.startsWith("BS"))
|
if(ce.startsWith("BS"))
|
||||||
{
|
{
|
||||||
|
|
@ -114,10 +160,14 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
||||||
if(feederID!="FD-2003")
|
if(feederID!="FD-2023")
|
||||||
{
|
{
|
||||||
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->tfs.push_back(tf->getNamingDescription());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// foundCate=true;
|
// foundCate=true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,19 @@
|
||||||
#include "powertransformer.h"
|
#include "powertransformer.h"
|
||||||
#include "substation.h"
|
#include "substation.h"
|
||||||
#include "busbarsection.h"
|
#include "busbarsection.h"
|
||||||
|
#include "disconnector.h"
|
||||||
class TopologyRecorder
|
class TopologyRecorder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT);
|
TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT);
|
||||||
|
~TopologyRecorder();
|
||||||
bool startWithNode(const QString& node);
|
bool startWithNode(const QString& node);
|
||||||
private:
|
private:
|
||||||
NodeToTerminal nodeToTerminal;
|
NodeToTerminal nodeToTerminal;
|
||||||
const QHash<QString,BasicElementInfo *>& eleHT;
|
const QHash<QString,BasicElementInfo *>& eleHT;
|
||||||
QVector<QPair<QString,QString> > branch;
|
QVector<QPair<QString,QString> > branch;
|
||||||
QHash<QString,char> reachedTerminal;
|
QHash<QString,char> reachedTerminal;
|
||||||
|
QVector<QString> tfs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOPOLOGYRECORDER_H
|
#endif // TOPOLOGYRECORDER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue