显示输出遇到的Substation的名字

Signed-off-by: facat@lab.com <facat@lab.com>
This commit is contained in:
facat@lab.com 2014-12-25 16:21:20 +08:00
parent 9a70026cf3
commit a012ca3502
7 changed files with 42 additions and 2 deletions

View File

@ -14,11 +14,24 @@ bool BusbarSection::derivedParse(QXmlStreamReader& reader)
terminal=reader.attributes().value("rdf:resource").toString();
this->terminal=terminal.replace("#","").leftRef(-1).toString();
qDebug()<<"got "<<"ConductingEquipment.Terminals "<<this->terminal<<"\n";
// std::cout<<"ConductingEquipment.Terminals"<<this->terminal.toStdString()<<std::endl;
}
if("Equipment.MemberOf_EquipmentContainer"==reader.name() && reader.attributes().hasAttribute("rdf:resource"))
{
QString container;
container=reader.attributes().value("rdf:resource").toString();
this->equipmentMemberOf_EquipmentContainer=container.replace("#","").leftRef(-1).toString();
qDebug()<<"got "<<"ConductingEquipment.Terminals "<<this->terminal<<"\n";
// std::cout<<"ConductingEquipment.Terminals"<<this->terminal.toStdString()<<std::endl;
}
return true;
}
QString BusbarSection::getEquipmentMemberOf_EquipmentContainer()
{
return this->equipmentMemberOf_EquipmentContainer;
}
QString BusbarSection::getTerminal()
{
return this->terminal;

View File

@ -7,10 +7,12 @@ class BusbarSection:public BasicElementInfo
public:
explicit BusbarSection(QObject *parent = 0);
virtual bool parse(QXmlStreamReader& reader);
QString getEquipmentMemberOf_EquipmentContainer();
QString getTerminal();
protected:
QString terminal;
virtual bool derivedParse(QXmlStreamReader& reader);
QString equipmentMemberOf_EquipmentContainer;
};
#endif // BUSBARSECTION_H

View File

@ -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-671400")
if(p->getName()=="ACLineSegment" && p->getID()=="AC-671401")
{
ACLineSegment *ac=static_cast<ACLineSegment *>(p);//BusbarSection也就是线路头节点
QString acTerminal=ac->getTerminalB();

View File

@ -24,6 +24,10 @@ bool Substation::derivedParse(QXmlStreamReader& reader)
return true;
}
QString Substation::getNamingDescription()
{
return this->namingDescription;
}
QString Substation::getSubstationMemberOf_Feeder()
{

View File

@ -7,6 +7,7 @@ class Substation:public BasicElementInfo
public:
explicit Substation(QObject *parent = 0);
virtual bool parse(QXmlStreamReader& reader);
QString getNamingDescription();
QString getSubstationMemberOf_Feeder();
protected:
virtual bool derivedParse(QXmlStreamReader& reader);

View File

@ -77,6 +77,25 @@ bool TopologyRecorder::startWithNode(const QString& node)
}
if(ce.startsWith("BS"))
{
//看找到那个Substation了
BusbarSection *bs=static_cast<BusbarSection *>(ht[ce]);
if(bs==NULL)
{
std::cout<<"not find bussection"<<ce.toStdString()<<std::endl;
}
else
{
QString container=bs->getEquipmentMemberOf_EquipmentContainer();
Substation *sfd=static_cast<Substation *>(ht[container]);
if(sfd==NULL)
{
std::cout<<"can not find"<<container.toStdString()<<std::endl;
}
else
{
std::cout<<"encounter "<<sfd->getNamingDescription().toStdString()<<std::endl;
}
}
continue;
}
if(ce.startsWith("TF"))
@ -95,7 +114,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
else
{
QString feederID=sfd->getSubstationMemberOf_Feeder();
if(feederID!="FD-2004")
if(feederID!="FD-2003")
{
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
}

View File

@ -11,6 +11,7 @@
#include "terminal.h"
#include "powertransformer.h"
#include "substation.h"
#include "busbarsection.h"
class TopologyRecorder
{
public: