38
testHasttable/aclinesegment.cpp
Normal file
38
testHasttable/aclinesegment.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "aclinesegment.h"
|
||||
|
||||
ACLineSegment::ACLineSegment():isTerminalA(true)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
this->terminalA=terminal.replace("#","").leftRef(-1);//返回整个字符串的Ref
|
||||
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();
|
||||
this->terminalB=terminal.replace("#","").leftRef(-1);//返回整个字符串的Ref
|
||||
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();
|
||||
this->containsOfSubstation=ss.replace("#","").leftRef(-1);//返回整个字符串的Ref
|
||||
qDebug()<<"got "<<"ConductingEquipment.Substation "<<this->containsOfSubstation<<"\n";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ACLineSegment::parse(QXmlStreamReader &reader)
|
||||
{
|
||||
return this->parseBasicInfo(reader);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user