From 936c4a7e6f74910a0541692fbb9c588438711e00 Mon Sep 17 00:00:00 2001 From: "facat@lab.com" Date: Thu, 11 Dec 2014 20:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=85=B3=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: facat@lab.com --- testHasttable/breaker.cpp | 13 +++++++++++++ testHasttable/breaker.h | 2 ++ testHasttable/nodetoterminal.cpp | 22 +++------------------- testHasttable/powertransformer.h | 1 + testHasttable/topologyrecorder.cpp | 7 +++++++ testHasttable/topologyrecorder.h | 2 +- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/testHasttable/breaker.cpp b/testHasttable/breaker.cpp index be973f4..33a879f 100644 --- a/testHasttable/breaker.cpp +++ b/testHasttable/breaker.cpp @@ -28,6 +28,19 @@ bool Breaker::derivedParse(QXmlStreamReader &reader) this->equipmentContainer=ss.replace("#","").leftRef(-1).toString(); qDebug()<<"got "<<"Equipment.MemberOf_EquipmentContainer "<equipmentContainer<<"\n"; } + if("Switch.normalOpen"==reader.name()) + { + QString open=reader.readElementText(); + if(open=="TRUE") + { + this->isOpen=true; + } + else + { + this->isOpen=false; + } + + } return true; } diff --git a/testHasttable/breaker.h b/testHasttable/breaker.h index 5fe6d2c..528536c 100644 --- a/testHasttable/breaker.h +++ b/testHasttable/breaker.h @@ -10,10 +10,12 @@ public: virtual bool parse(QXmlStreamReader& reader); QString getTerminalA(); QString getTerminalB(); + bool getOpenState(); protected: QString terminalA; QString terminalB; QString equipmentContainer; + bool isOpen; virtual bool derivedParse(QXmlStreamReader& reader); private: bool isTerminalA; diff --git a/testHasttable/nodetoterminal.cpp b/testHasttable/nodetoterminal.cpp index 6717666..122e12e 100644 --- a/testHasttable/nodetoterminal.cpp +++ b/testHasttable/nodetoterminal.cpp @@ -13,10 +13,7 @@ NodeToTerminal::NodeToTerminal() void NodeToTerminal::add(const QString& key,const QString& value) { -// if(this->contains(key)) -// { -// std::cout<<"duplicat"< NodeToTerminal::value(const QString& key) { -// if(NodeToTerminal::ht) -// { -// //return NodeToTerminal::ht->value(key); -// return "not null"; -// } -// else -// { -// return "null"; -// } -// return ""; + return NodeToTerminal::ht->value(key); } NodeToTerminal::~NodeToTerminal() { -// if(NodeToTerminal::ht) -// { -// delete NodeToTerminal::ht; -// NodeToTerminal::ht=NULL; -// } + } diff --git a/testHasttable/powertransformer.h b/testHasttable/powertransformer.h index 6302990..05e861c 100644 --- a/testHasttable/powertransformer.h +++ b/testHasttable/powertransformer.h @@ -7,6 +7,7 @@ class PowerTransformer:public BasicElementInfo public: explicit PowerTransformer(QObject *parent = 0); virtual bool parse(QXmlStreamReader& reader); + QString getNamingDescription(); protected: QString terminalA; QString terminalB; diff --git a/testHasttable/topologyrecorder.cpp b/testHasttable/topologyrecorder.cpp index 5fcbb7f..012cdfd 100644 --- a/testHasttable/topologyrecorder.cpp +++ b/testHasttable/topologyrecorder.cpp @@ -70,6 +70,13 @@ bool TopologyRecorder::startWithNode(const QString& node) { continue; } + if(ce.startsWith("TF")) + { + QString tfID=ce; + PowerTransformer *tf=static_cast(ht[tfID]); + std::cout<<"TF"<getNamingDescription().toStdString()<branch.push_back(fromTo); diff --git a/testHasttable/topologyrecorder.h b/testHasttable/topologyrecorder.h index 8523877..3c438c9 100644 --- a/testHasttable/topologyrecorder.h +++ b/testHasttable/topologyrecorder.h @@ -9,7 +9,7 @@ #include "aclinesegment.h" #include "nodetoterminal.h" #include "terminal.h" - +#include "powertransformer.h" class TopologyRecorder { public: