parent
ac08caee2a
commit
c1b2c0e367
|
|
@ -76,7 +76,7 @@ bool ElementHashtable::GoPath()
|
|||
const QHash<QString,BasicElementInfo*> &zwht=this->eleHT;//从配网开始找
|
||||
QList<QString> keys;
|
||||
keys=zwht.keys();
|
||||
std::cout<<keys.length()<<std::endl;
|
||||
// std::cout<<keys.length()<<std::endl;
|
||||
for(QList<QString>::Iterator ite=keys.begin();
|
||||
ite!=keys.end();
|
||||
ite++)
|
||||
|
|
@ -88,14 +88,14 @@ bool ElementHashtable::GoPath()
|
|||
QString acTerminal=ac->getTerminalB();
|
||||
//找Terminal的东西
|
||||
Terminal *acTerminalP=static_cast<Terminal *>(zwht[acTerminal]);
|
||||
std::cout<<acTerminalP->getID().toStdString()<<std::endl;
|
||||
// std::cout<<acTerminalP->getID().toStdString()<<std::endl;
|
||||
QString node;
|
||||
node=acTerminalP->getConnectivityNode();
|
||||
if(node=="")
|
||||
{
|
||||
continue;//有些Terminal是没有Node的
|
||||
}
|
||||
std::cout<<node.toStdString()<<std::endl;
|
||||
// std::cout<<node.toStdString()<<std::endl;
|
||||
if(this->tpRecorder!=NULL)
|
||||
{
|
||||
delete this->tpRecorder;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@
|
|||
#include "regexextract.h"
|
||||
#include "task.h"
|
||||
#include <iostream>
|
||||
#include "readwrite.h"
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
// ReadWrite aa;
|
||||
// return a.exec();
|
||||
RegexExtract re;
|
||||
re.extract("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml");
|
||||
re.exportBlocks("./a");
|
||||
return a.exec();
|
||||
ElementHashtable eleReader;
|
||||
eleReader.Parse("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml","D:/Project/佛山项目/佛山收资/exportmodel_zwyth20141204/exportmodel_zwyth.xml");
|
||||
// eleReader.GoPath();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "nodetoterminal.h"
|
||||
#include <iostream>
|
||||
//#include <iostream>
|
||||
QHash<QString,QVector<QString> > *NodeToTerminal::ht=NULL;
|
||||
NodeToTerminal::NodeToTerminal()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ bool RegexExtract::extract(const QString& xmlPath)
|
|||
std::cout<<lineNum<<std::endl;
|
||||
}
|
||||
// std::cout<<line.toStdString()<<std::endl;
|
||||
if(!isInner && this->startsWith(line,"ThermalGeneratingUnit"))
|
||||
if(!isInner && this->startsWith(line,"SynchronousMachine"))
|
||||
{
|
||||
block="";
|
||||
isInner=true;
|
||||
|
|
@ -58,7 +58,7 @@ bool RegexExtract::extract(const QString& xmlPath)
|
|||
{
|
||||
block=block+line+QString("\n");
|
||||
}
|
||||
if(isInner && this->endsWith(line,"ThermalGeneratingUnit"))
|
||||
if(isInner && this->endsWith(line,"SynchronousMachine"))
|
||||
{
|
||||
isInner=false;
|
||||
this->blocks.push_back(block);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "topologyrecorder.h"
|
||||
#include <iostream>
|
||||
//#include <iostream>
|
||||
#include <QList>
|
||||
TopologyRecorder::TopologyRecorder(const QHash<QString,BasicElementInfo *>& elementHT, const QVector<QString> &FDSet, QObject *parent):eleHT(elementHT),FDSet(FDSet)
|
||||
{
|
||||
|
|
@ -16,7 +16,7 @@ bool TopologyRecorder::isEquipmentNeeded(const QString& substatinID)
|
|||
Substation *sfd=static_cast<Substation *>(ht[substatinID]);
|
||||
if(sfd==NULL)
|
||||
{
|
||||
std::cout<<"can not find"<<substatinID.toStdString()<<std::endl;
|
||||
// std::cout<<"can not find"<<substatinID.toStdString()<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -47,7 +47,7 @@ void TopologyRecorder::showContainerInfo(QTextStream &stream)
|
|||
container=pf->getEquipmentMemberOf_EquipmentContainer();
|
||||
s[container].push_back(*ite);
|
||||
}
|
||||
std::cout<<"container "<<s.keys().length()<<std::endl;
|
||||
// std::cout<<"container "<<s.keys().length()<<std::endl;
|
||||
QList<QString> keys=s.keys();
|
||||
for(QList<QString>::iterator ite=keys.begin();
|
||||
ite!=keys.end();
|
||||
|
|
@ -109,10 +109,10 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
}
|
||||
terminalA=AC->getTerminalA();
|
||||
terminalB=AC->getTerminalB();
|
||||
std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
||||
std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
||||
// std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
||||
// std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
||||
//把线路长度也输出来看一下
|
||||
std::cout<<AC->getLength()<<std::endl;
|
||||
// std::cout<<AC->getLength()<<std::endl;
|
||||
foundEle=AC;
|
||||
typ=TopologyRecorder::Type::AC;
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
|
||||
if(bi->getName()=="Breaker")
|
||||
{
|
||||
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||
// std::cout<<bi->getName().toStdString()<<std::endl;
|
||||
QString swID=ce;
|
||||
fromTo.first=node;
|
||||
fromTo.second=swID;
|
||||
|
|
@ -136,28 +136,28 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
//显示开关状态
|
||||
if(SW->getOpenState()==true)
|
||||
{
|
||||
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||
// std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||
// std::cout<<"sw "<<SW->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||
}
|
||||
terminalA=SW->getTerminalA();
|
||||
terminalB=SW->getTerminalB();
|
||||
std::cout<<"find"<<SW->getID().toStdString()<<std::endl;
|
||||
// std::cout<<"find"<<SW->getID().toStdString()<<std::endl;
|
||||
foundEle=SW;
|
||||
typ=TopologyRecorder::Type::BREAKER;
|
||||
}
|
||||
if(bi->getName()=="Disconnector")
|
||||
{
|
||||
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||
// std::cout<<bi->getName().toStdString()<<std::endl;
|
||||
QString disConID=ce;
|
||||
Disconnector *Dis=static_cast<Disconnector *>(ht[disConID]);
|
||||
//先判断一下是不是需要的Disconnector
|
||||
QString container=Dis->getEquipmentMemberOf_EquipmentContainer();
|
||||
if(!this->isEquipmentNeeded(container))
|
||||
{
|
||||
std::cout<<"Dissw not belong "<<disConID.toStdString()<<std::endl;
|
||||
// std::cout<<"Dissw not belong "<<disConID.toStdString()<<std::endl;
|
||||
continue;
|
||||
}
|
||||
fromTo.first=node;
|
||||
|
|
@ -170,15 +170,15 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
//显示开关状态
|
||||
if(Dis->getOpenState()==true)
|
||||
{
|
||||
std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||
// std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is open"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||
// std::cout<<"Dissw "<<Dis->getNamingDescription().toStdString()<<"is close"<<std::endl;
|
||||
}
|
||||
terminalA=Dis->getTerminalA();
|
||||
terminalB=Dis->getTerminalB();
|
||||
std::cout<<"find"<<Dis->getID().toStdString()<<std::endl;
|
||||
// std::cout<<"find"<<Dis->getID().toStdString()<<std::endl;
|
||||
foundEle=Dis;
|
||||
typ=TopologyRecorder::Type::DISCONNECTOR;
|
||||
}
|
||||
|
|
@ -196,7 +196,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
BusbarSection *bs=static_cast<BusbarSection *>(ht[ce]);
|
||||
if(bs==NULL)
|
||||
{
|
||||
std::cout<<"not find bussection"<<ce.toStdString()<<std::endl;
|
||||
// std::cout<<"not find bussection"<<ce.toStdString()<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -204,14 +204,14 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
Substation *sfd=static_cast<Substation *>(ht[container]);
|
||||
if(sfd==NULL)
|
||||
{
|
||||
std::cout<<"can not find"<<container.toStdString()<<std::endl;
|
||||
// std::cout<<"can not find"<<container.toStdString()<<std::endl;
|
||||
}
|
||||
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;
|
||||
// std::cout<<"not belong"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
{
|
||||
QString tfID=ce;
|
||||
PowerTransformer *tf=static_cast<PowerTransformer *>(ht[tfID]);
|
||||
std::cout<<"TF"<<tf->getNamingDescription().toStdString()<<std::endl;
|
||||
// std::cout<<"TF"<<tf->getNamingDescription().toStdString()<<std::endl;
|
||||
//判断一下这个变压器是不是我们需要的
|
||||
QString equipmentContainer;
|
||||
equipmentContainer=tf->getEquipmentMemberOf_EquipmentContainer();
|
||||
|
|
@ -234,7 +234,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||
// std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||
}
|
||||
typ=TopologyRecorder::Type::TF;
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"not found cate "<<ce.toStdString()<<std::endl;
|
||||
// std::cout<<"not found cate "<<ce.toStdString()<<std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue