From edfb3310f8bfd3f6f7bb38ff66164f4d9eff66fe Mon Sep 17 00:00:00 2001 From: "facat@lab.com" Date: Thu, 25 Dec 2014 21:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=A4=84=E7=90=86Disconnecto?= =?UTF-8?q?r=E8=BF=9E=E6=8E=A5=E5=85=B3=E7=B3=BB=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: facat@lab.com --- testHasttable/disconnector.cpp | 36 +++++++++++++ testHasttable/disconnector.h | 6 +++ testHasttable/elementhashtable.cpp | 2 +- testHasttable/topologyrecorder.cpp | 86 +++++++++++++++++++++++------- testHasttable/topologyrecorder.h | 3 ++ 5 files changed, 114 insertions(+), 19 deletions(-) diff --git a/testHasttable/disconnector.cpp b/testHasttable/disconnector.cpp index 4cefca2..f8f615a 100644 --- a/testHasttable/disconnector.cpp +++ b/testHasttable/disconnector.cpp @@ -29,6 +29,23 @@ bool Disconnector::derivedParse(QXmlStreamReader &reader) this->equipmentContainer=ss.replace("#","").leftRef(-1).toString(); qDebug()<<"got "<<"Equipment.MemberOf_EquipmentContainer "<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; +} diff --git a/testHasttable/disconnector.h b/testHasttable/disconnector.h index 7069cb2..5f7901e 100644 --- a/testHasttable/disconnector.h +++ b/testHasttable/disconnector.h @@ -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; diff --git a/testHasttable/elementhashtable.cpp b/testHasttable/elementhashtable.cpp index 4633e35..261ba1f 100644 --- a/testHasttable/elementhashtable.cpp +++ b/testHasttable/elementhashtable.cpp @@ -85,7 +85,7 @@ bool ElementHashtable::GoPath() // if(p->getName()=="ACLineSegment"){ // std::cout<getID().toStdString()<getName()=="ACLineSegment" && p->getID()=="AC-671401") + if(p->getName()=="ACLineSegment" && p->getID()=="AC-591827") { ACLineSegment *ac=static_cast(p);//BusbarSection也就是线路头节点 QString acTerminal=ac->getTerminalB(); diff --git a/testHasttable/topologyrecorder.cpp b/testHasttable/topologyrecorder.cpp index ac708d7..6437254 100644 --- a/testHasttable/topologyrecorder.cpp +++ b/testHasttable/topologyrecorder.cpp @@ -4,6 +4,11 @@ TopologyRecorder::TopologyRecorder(const QHash& elem { } +TopologyRecorder::~TopologyRecorder() +{ + std::cout<<"total tf"<tfs.length()<(ht[swID]); - if(!SW) + BasicElementInfo *bi=ht[ce]; + if(bi!=NULL) { - // std::cout<<"can not SW "<getOpenState()==true) - { - std::cout<<"sw "<getNamingDescription().toStdString()<<"is open"<getName().toStdString()<getName()=="Breaker") + { + QString swID=ce; + fromTo.first=node; + fromTo.second=swID; + + Breaker *SW=static_cast(ht[swID]); + if(!SW) + { + // std::cout<<"can not SW "<getOpenState()==true) + { + std::cout<<"sw "<getNamingDescription().toStdString()<<"is open"<getNamingDescription().toStdString()<<"is close"<getTerminalA(); + terminalB=SW->getTerminalB(); + std::cout<<"find"<getID().toStdString()<getName()=="Disconnector") + { + QString disConID=ce; + fromTo.first=node; + fromTo.second=disConID; + + Disconnector *Dis=static_cast(ht[disConID]); + if(!Dis) + { + // std::cout<<"can not SW "<getOpenState()==true) + { + std::cout<<"Dissw "<getNamingDescription().toStdString()<<"is open"<getNamingDescription().toStdString()<<"is close"<getTerminalA(); + terminalB=Dis->getTerminalB(); + std::cout<<"find"<getID().toStdString()<getNamingDescription().toStdString()<<"is close"<getTerminalA(); - terminalB=SW->getTerminalB(); - std::cout<<"find"<getID().toStdString()<getSubstationMemberOf_Feeder(); - if(feederID!="FD-2003") + if(feederID!="FD-2023") { std::cout<getNamingDescription().toStdString()<<"not belong"<tfs.push_back(tf->getNamingDescription()); + } } // foundCate=true; } diff --git a/testHasttable/topologyrecorder.h b/testHasttable/topologyrecorder.h index bd4afa0..d94eea0 100644 --- a/testHasttable/topologyrecorder.h +++ b/testHasttable/topologyrecorder.h @@ -12,16 +12,19 @@ #include "powertransformer.h" #include "substation.h" #include "busbarsection.h" +#include "disconnector.h" class TopologyRecorder { public: TopologyRecorder(const QHash& elementHT); + ~TopologyRecorder(); bool startWithNode(const QString& node); private: NodeToTerminal nodeToTerminal; const QHash& eleHT; QVector > branch; QHash reachedTerminal; + QVector tfs; }; #endif // TOPOLOGYRECORDER_H