parent
af8f64dfd0
commit
8a994253b9
|
|
@ -82,7 +82,7 @@ bool ElementHashtable::GoPath()
|
||||||
ite++)
|
ite++)
|
||||||
{
|
{
|
||||||
BasicElementInfo *p=zwht[*ite];
|
BasicElementInfo *p=zwht[*ite];
|
||||||
if(p->getName()=="ACLineSegment" && p->getID()=="AC-591839")
|
if(p->getName()=="ACLineSegment" && p->getID()=="AC-591821")
|
||||||
{
|
{
|
||||||
ACLineSegment *ac=static_cast<ACLineSegment *>(p);//BusbarSection也就是线路头节点
|
ACLineSegment *ac=static_cast<ACLineSegment *>(p);//BusbarSection也就是线路头节点
|
||||||
QString acTerminal=ac->getTerminalB();
|
QString acTerminal=ac->getTerminalB();
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,43 @@
|
||||||
#include "topologyrecorder.h"
|
#include "topologyrecorder.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <QList>
|
||||||
TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT, QObject *parent):eleHT(elementHT)
|
TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT, QObject *parent):eleHT(elementHT)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TopologyRecorder::~TopologyRecorder()
|
TopologyRecorder::~TopologyRecorder()
|
||||||
{
|
{
|
||||||
|
const QHash<QString,BasicElementInfo*> &ht=this->eleHT;
|
||||||
std::cout<<"total tf"<<this->tfs.length()<<std::endl;
|
std::cout<<"total tf"<<this->tfs.length()<<std::endl;
|
||||||
|
//统计一下每个Container下有多少个变压器
|
||||||
|
QHash<QString,QVector<QString> > s;
|
||||||
|
for(QVector<QString>::iterator ite=this->tfs.begin();
|
||||||
|
ite!=this->tfs.end();
|
||||||
|
ite++)
|
||||||
|
{
|
||||||
|
PowerTransformer *pf=static_cast<PowerTransformer *>(ht[*ite]);
|
||||||
|
QString container;
|
||||||
|
container=pf->getEquipmentMemberOf_EquipmentContainer();
|
||||||
|
s[container].push_back(*ite);
|
||||||
|
}
|
||||||
|
std::cout<<"container "<<s.keys().length()<<std::endl;
|
||||||
|
QList<QString> keys=s.keys();
|
||||||
|
for(QList<QString>::iterator ite=keys.begin();
|
||||||
|
ite!=keys.end();
|
||||||
|
ite++)
|
||||||
|
{
|
||||||
|
QString k=*ite;
|
||||||
|
std::cout<<k.toStdString();
|
||||||
|
Substation *sb=static_cast<Substation *>(ht[k]);
|
||||||
|
std::cout<<", "<<sb->getNamingDescription().toStdString();
|
||||||
|
QVector<QString> v=s[k];
|
||||||
|
foreach (QString n, v) {
|
||||||
|
std::cout<<", "<<n.toStdString();
|
||||||
|
PowerTransformer *pf=static_cast<PowerTransformer *>(ht[n]);
|
||||||
|
std::cout<<"("<<pf->getNamingDescription().toStdString()<<")";
|
||||||
|
}
|
||||||
|
std::cout<<std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TopologyRecorder::isEquipmentNeeded(const QString& substatinID)
|
bool TopologyRecorder::isEquipmentNeeded(const QString& substatinID)
|
||||||
|
|
@ -20,7 +51,7 @@ bool TopologyRecorder::isEquipmentNeeded(const QString& substatinID)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
||||||
return feederID=="FD-2056"||sfd->getNamingDescription()=="V馈线站";
|
return feederID=="FD-2014"||sfd->getNamingDescription()=="V馈线站";
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -72,6 +103,8 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
terminalB=AC->getTerminalB();
|
terminalB=AC->getTerminalB();
|
||||||
std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
||||||
std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
||||||
|
//把线路长度也输出来看一下
|
||||||
|
std::cout<<AC->getLength()<<std::endl;
|
||||||
foundEle=AC;
|
foundEle=AC;
|
||||||
typ=TopologyRecorder::Type::AC;
|
typ=TopologyRecorder::Type::AC;
|
||||||
}
|
}
|
||||||
|
|
@ -168,6 +201,10 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout<<"encounter "<<sfd->getNamingDescription().toStdString()<<std::endl;
|
std::cout<<"encounter "<<sfd->getNamingDescription().toStdString()<<std::endl;
|
||||||
|
if(!this->isEquipmentNeeded(container))
|
||||||
|
{
|
||||||
|
std::cout<<"not belong"<<std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -182,7 +219,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
equipmentContainer=tf->getEquipmentMemberOf_EquipmentContainer();
|
equipmentContainer=tf->getEquipmentMemberOf_EquipmentContainer();
|
||||||
if(this->isEquipmentNeeded(equipmentContainer))
|
if(this->isEquipmentNeeded(equipmentContainer))
|
||||||
{
|
{
|
||||||
this->tfs.push_back(tf->getNamingDescription());
|
this->tfs.push_back(tfID);
|
||||||
fromTo.first=node;
|
fromTo.first=node;
|
||||||
fromTo.second=tfID;
|
fromTo.second=tfID;
|
||||||
foundEle=tf;
|
foundEle=tf;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue