parent
a012ca3502
commit
edfb3310f8
|
|
@ -29,6 +29,23 @@ bool Disconnector::derivedParse(QXmlStreamReader &reader)
|
|||
this->equipmentContainer=ss.replace("#","").leftRef(-1).toString();
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -36,3 +53,22 @@ bool Disconnector::parse(QXmlStreamReader &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:
|
||||
explicit Disconnector(QObject *parent = 0);
|
||||
virtual bool parse(QXmlStreamReader& reader);
|
||||
QString getNamingDescription();
|
||||
bool getOpenState();
|
||||
QString getTerminalA();
|
||||
QString getTerminalB();
|
||||
protected:
|
||||
QString terminalA;
|
||||
QString terminalB;
|
||||
QString equipmentContainer;
|
||||
QString namingDescription;
|
||||
bool isOpen;
|
||||
virtual bool derivedParse(QXmlStreamReader& reader);
|
||||
private:
|
||||
bool isTerminalA;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ bool ElementHashtable::GoPath()
|
|||
// if(p->getName()=="ACLineSegment"){
|
||||
// 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也就是线路头节点
|
||||
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)
|
||||
{
|
||||
if(node=="")
|
||||
|
|
@ -51,10 +56,17 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
foundCate=true;
|
||||
}
|
||||
if(ce.startsWith("SW"))
|
||||
{
|
||||
BasicElementInfo *bi=ht[ce];
|
||||
if(bi!=NULL)
|
||||
{
|
||||
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||
if(bi->getName()=="Breaker")
|
||||
{
|
||||
QString swID=ce;
|
||||
fromTo.first=node;
|
||||
fromTo.second=swID;
|
||||
|
||||
Breaker *SW=static_cast<Breaker *>(ht[swID]);
|
||||
if(!SW)
|
||||
{
|
||||
|
|
@ -74,6 +86,40 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
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
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(ce.startsWith("BS"))
|
||||
{
|
||||
|
|
@ -114,10 +160,14 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
else
|
||||
{
|
||||
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
||||
if(feederID!="FD-2003")
|
||||
if(feederID!="FD-2023")
|
||||
{
|
||||
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->tfs.push_back(tf->getNamingDescription());
|
||||
}
|
||||
}
|
||||
// foundCate=true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,16 +12,19 @@
|
|||
#include "powertransformer.h"
|
||||
#include "substation.h"
|
||||
#include "busbarsection.h"
|
||||
#include "disconnector.h"
|
||||
class TopologyRecorder
|
||||
{
|
||||
public:
|
||||
TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT);
|
||||
~TopologyRecorder();
|
||||
bool startWithNode(const QString& node);
|
||||
private:
|
||||
NodeToTerminal nodeToTerminal;
|
||||
const QHash<QString,BasicElementInfo *>& eleHT;
|
||||
QVector<QPair<QString,QString> > branch;
|
||||
QHash<QString,char> reachedTerminal;
|
||||
QVector<QString> tfs;
|
||||
};
|
||||
|
||||
#endif // TOPOLOGYRECORDER_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue