2014-11-22 22:18:18 +08:00
|
|
|
#include "aclinesegment.h"
|
2014-12-11 19:57:55 +08:00
|
|
|
#include <iostream>
|
2014-11-24 22:01:30 +08:00
|
|
|
ACLineSegment::ACLineSegment(QObject *parent):BasicElementInfo(parent),isTerminalA(true)
|
2014-11-22 22:18:18 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ACLineSegment::derivedParse(QXmlStreamReader &reader)
|
|
|
|
|
{
|
|
|
|
|
if(this->isTerminalA && "ConductingEquipment.Terminals"==reader.name() && reader.attributes().hasAttribute("rdf:resource"))
|
|
|
|
|
{
|
|
|
|
|
QString terminal;
|
|
|
|
|
terminal=reader.attributes().value("rdf:resource").toString();
|
2014-12-06 22:12:17 +08:00
|
|
|
this->terminalA=terminal.replace("#","").leftRef(-1).toString();
|
2014-11-22 22:18:18 +08:00
|
|
|
qDebug()<<"got "<<"ConductingEquipment.Terminals "<<this->terminalA<<"\n";
|
|
|
|
|
this->isTerminalA=false;
|
|
|
|
|
}
|
|
|
|
|
if(!this->isTerminalA && "ConductingEquipment.Terminals"==reader.name() && reader.attributes().hasAttribute("rdf:resource"))
|
|
|
|
|
{
|
|
|
|
|
QString terminal;
|
|
|
|
|
terminal=reader.attributes().value("rdf:resource").toString();
|
2014-12-06 22:12:17 +08:00
|
|
|
this->terminalB=terminal.replace("#","").leftRef(-1).toString();
|
2014-11-22 22:18:18 +08:00
|
|
|
qDebug()<<"got "<<"ConductingEquipment.Terminals "<<this->terminalB<<"\n";
|
|
|
|
|
}
|
|
|
|
|
if("ConductingEquipment.Substation"==reader.name() && reader.attributes().hasAttribute("rdf:resource"))
|
|
|
|
|
{
|
|
|
|
|
QString ss;
|
|
|
|
|
ss=reader.attributes().value("rdf:resource").toString();
|
2014-12-06 22:12:17 +08:00
|
|
|
this->containsOfSubstation=ss.replace("#","").leftRef(-1).toString();
|
2014-11-22 22:18:18 +08:00
|
|
|
qDebug()<<"got "<<"ConductingEquipment.Substation "<<this->containsOfSubstation<<"\n";
|
|
|
|
|
}
|
2014-12-11 19:57:55 +08:00
|
|
|
if("Naming.description"==reader.name())
|
|
|
|
|
{
|
2014-12-12 16:41:36 +08:00
|
|
|
this->namingDescription=reader.readElementText();
|
2014-12-11 19:57:55 +08:00
|
|
|
}
|
2014-12-26 21:21:58 +08:00
|
|
|
if("Conductor.length"==reader.name())
|
|
|
|
|
{
|
|
|
|
|
bool ok;
|
2014-12-27 21:45:46 +08:00
|
|
|
this->conductorLength=reader.readElementText().toDouble(&ok);
|
2014-12-26 21:21:58 +08:00
|
|
|
if(!ok)
|
|
|
|
|
{
|
|
|
|
|
this->conductorLength=-100000;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-11-22 22:18:18 +08:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-26 21:21:58 +08:00
|
|
|
|
|
|
|
|
double ACLineSegment::getLength()
|
|
|
|
|
{
|
|
|
|
|
return this->conductorLength;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-12 16:41:36 +08:00
|
|
|
QString ACLineSegment::getNamingDescription()
|
2014-12-11 19:57:55 +08:00
|
|
|
{
|
2014-12-12 16:41:36 +08:00
|
|
|
return this->namingDescription;
|
2014-12-11 19:57:55 +08:00
|
|
|
}
|
|
|
|
|
|
2014-12-06 21:48:07 +08:00
|
|
|
QString ACLineSegment::getTerminalA()
|
|
|
|
|
{
|
|
|
|
|
return this->terminalA;
|
|
|
|
|
}
|
|
|
|
|
QString ACLineSegment::getTerminalB()
|
|
|
|
|
{
|
|
|
|
|
return this->terminalB;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-09 16:26:47 +08:00
|
|
|
void ACLineSegment::setLength(double length)
|
|
|
|
|
{
|
|
|
|
|
this->conductorLength=length;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-22 22:18:18 +08:00
|
|
|
bool ACLineSegment::parse(QXmlStreamReader &reader)
|
|
|
|
|
{
|
|
|
|
|
return this->parseBasicInfo(reader);
|
|
|
|
|
}
|
|
|
|
|
|