增加开关状态

Signed-off-by: facat@lab.com <facat@lab.com>
This commit is contained in:
facat@lab.com 2014-12-11 20:32:49 +08:00
parent a27bb65465
commit 936c4a7e6f
6 changed files with 27 additions and 20 deletions

View File

@ -28,6 +28,19 @@ bool Breaker::derivedParse(QXmlStreamReader &reader)
this->equipmentContainer=ss.replace("#","").leftRef(-1).toString();
qDebug()<<"got "<<"Equipment.MemberOf_EquipmentContainer "<<this->equipmentContainer<<"\n";
}
if("Switch.normalOpen"==reader.name())
{
QString open=reader.readElementText();
if(open=="TRUE")
{
this->isOpen=true;
}
else
{
this->isOpen=false;
}
}
return true;
}

View File

@ -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;

View File

@ -13,10 +13,7 @@ NodeToTerminal::NodeToTerminal()
void NodeToTerminal::add(const QString& key,const QString& value)
{
// if(this->contains(key))
// {
// std::cout<<"duplicat"<<std::endl;
// }
(*NodeToTerminal::ht)[key].push_back(value);
}
@ -27,24 +24,11 @@ bool NodeToTerminal::contains(const QString& key)
QVector<QString> 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;
// }
}

View File

@ -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;

View File

@ -70,6 +70,13 @@ bool TopologyRecorder::startWithNode(const QString& node)
{
continue;
}
if(ce.startsWith("TF"))
{
QString tfID=ce;
PowerTransformer *tf=static_cast<PowerTransformer *>(ht[tfID]);
std::cout<<"TF"<<tf->getNamingDescription().toStdString()<<std::endl;
// foundCate=true;
}
if(foundCate)
{
this->branch.push_back(fromTo);

View File

@ -9,7 +9,7 @@
#include "aclinesegment.h"
#include "nodetoterminal.h"
#include "terminal.h"
#include "powertransformer.h"
class TopologyRecorder
{
public: