1163 lines
35 KiB
C++
1163 lines
35 KiB
C++
|
|
#include "head.h"
|
|||
|
|
|
|||
|
|
//extern vector<Substation> substation;
|
|||
|
|
//extern vector<Terminal> terminal;
|
|||
|
|
//extern vector<BaseVoltage> base_voltage;
|
|||
|
|
//extern vector<BasePower> base_power;
|
|||
|
|
//extern vector<ConnectivityNode> connectivity_node;
|
|||
|
|
//extern vector<ACLineSegment> acline_segment;
|
|||
|
|
//extern vector<BusbarSection> busbar_section;
|
|||
|
|
//extern vector<Disconnector> disconnector;
|
|||
|
|
//extern vector<PowerTransformer> power_transformer;
|
|||
|
|
//extern vector<TransformerWinding> transformer_winding;
|
|||
|
|
//extern vector<List> list1;
|
|||
|
|
//extern vector<GroundDisconnector> ground_disconnector;
|
|||
|
|
//extern vector<CompositeSwitch> composite_switch;
|
|||
|
|
//extern vector<Circuit> circuit;
|
|||
|
|
//extern vector<Bay> bay;
|
|||
|
|
//extern vector<Connector> connector;
|
|||
|
|
//extern vector<Fuse> fuse;
|
|||
|
|
//extern vector<Pole> pole;
|
|||
|
|
//extern vector<LoadBreakSwitch> load_break_switch;
|
|||
|
|
//extern vector<Breaker> breaker;
|
|||
|
|
//extern vector<AC_kind> ac_kind;
|
|||
|
|
|
|||
|
|
//extern int i1;
|
|||
|
|
//extern int i2;
|
|||
|
|
//extern int i3;
|
|||
|
|
//extern int i4;
|
|||
|
|
//extern int i5;
|
|||
|
|
//extern int i6;
|
|||
|
|
//extern int i7;
|
|||
|
|
//extern int i8;
|
|||
|
|
//extern int i9;
|
|||
|
|
//extern int i10;
|
|||
|
|
//extern int i11;
|
|||
|
|
//extern int i12;
|
|||
|
|
//extern int i13;
|
|||
|
|
//extern int i14;
|
|||
|
|
//extern int i15;
|
|||
|
|
//extern int i16;
|
|||
|
|
//extern int i17;
|
|||
|
|
//extern int i18;
|
|||
|
|
//extern int i19;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//extern QStringRef R1;
|
|||
|
|
#include "qt_readxml.h"
|
|||
|
|
bool Qt_readxml::XmlReaderreadFile(QIODevice *file)
|
|||
|
|
{
|
|||
|
|
setDevice(file);
|
|||
|
|
//std::cout<<"XmlReaderreadFile"<<std::endl;
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
// if(name()=="RDF")
|
|||
|
|
// {
|
|||
|
|
XmlReaderread();
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
// raiseError(QObject::tr("Not cim file"));
|
|||
|
|
// }
|
|||
|
|
}
|
|||
|
|
readNext();
|
|||
|
|
}
|
|||
|
|
file->close();
|
|||
|
|
return 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderFormList(int i,QString name1,QString id)
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderFormList"<<std::endl;
|
|||
|
|
List L;
|
|||
|
|
L.ID=id;
|
|||
|
|
L.name=name1;
|
|||
|
|
L.no=i;
|
|||
|
|
list1.push_back(L);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread"<<std::endl;
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Substation")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Substation();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Terminal")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Terminal();
|
|||
|
|
}
|
|||
|
|
else if(name()=="BaseVoltage")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_BaseVoltage();
|
|||
|
|
}
|
|||
|
|
else if(name()=="BasePower")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_BasePower();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConnectivityNode")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_ConnectivityNode();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ACLineSegment")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_ACLineSegment();
|
|||
|
|
}
|
|||
|
|
else if(name()=="BusbarSection")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_BusbarSection();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Disconnector")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Disconnector();
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerTransformer")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_PowerTransformer();
|
|||
|
|
}
|
|||
|
|
else if(name()=="TransformerWinding")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_TransformerWinding();
|
|||
|
|
}
|
|||
|
|
else if(name()=="GroundDisconnector")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_GroundDisconnector();
|
|||
|
|
}
|
|||
|
|
else if(name()=="CompositeSwitch")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_CompositeSwitch();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Circuit")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Circuit();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Bay")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Bay();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Connector")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Connector();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Fuse")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Fuse();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Pole")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Pole();
|
|||
|
|
}
|
|||
|
|
else if(name()=="LoadBreakSwitch")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_LoadBreakSwitch();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Breaker")
|
|||
|
|
{
|
|||
|
|
XmlReaderread_Breaker();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Substation()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Substation"<<std::endl;
|
|||
|
|
Substation S;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
S.ID=ID1.toString();
|
|||
|
|
S.flag=0; S.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(S.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Substation")
|
|||
|
|
{
|
|||
|
|
substation.push_back(S);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
S.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
S.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Substation.MemberOf_SubControlArea")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
S.MemberOf_SubControlArea_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="GIS_type")
|
|||
|
|
{
|
|||
|
|
S.GIS_type=readElementText();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="substation";
|
|||
|
|
XmlReaderFormList(i1,name1,S.ID);
|
|||
|
|
i1++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Terminal()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Terminal"<<std::endl;
|
|||
|
|
Terminal T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Terminal")
|
|||
|
|
{
|
|||
|
|
terminal.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Terminal.ConductingEquipment")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.ConductingEquipment_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="Terminal.ConnectivityNode")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.ConnectivityNode_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="terminal";
|
|||
|
|
XmlReaderFormList(i2,name1,T1.ID);
|
|||
|
|
i2++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_BaseVoltage()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_BaseVoltage"<<std::endl;
|
|||
|
|
BaseVoltage T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "BaseVoltage")
|
|||
|
|
{
|
|||
|
|
base_voltage.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="nominalVoltage")
|
|||
|
|
{
|
|||
|
|
T1.nominalVoltage=readElementText().toDouble();
|
|||
|
|
}
|
|||
|
|
else if(name()=="BaseVoltage.BasePower")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BasePower_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="base_voltage";
|
|||
|
|
XmlReaderFormList(i3,name1,T1.ID);
|
|||
|
|
i3++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_BasePower()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_BasePower"<<std::endl;
|
|||
|
|
BasePower T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "BasePower")
|
|||
|
|
{
|
|||
|
|
base_power.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="BasePower.basePower")
|
|||
|
|
{
|
|||
|
|
T1.basePower=readElementText().toDouble();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="base_power";
|
|||
|
|
XmlReaderFormList(i4,name1,T1.ID);
|
|||
|
|
i4++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_ConnectivityNode()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_ConnectivityNode"<<std::endl;
|
|||
|
|
ConnectivityNode T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "ConnectivityNode")
|
|||
|
|
{
|
|||
|
|
connectivity_node.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="connectivity_node";
|
|||
|
|
XmlReaderFormList(i5,name1,T1.ID);
|
|||
|
|
i5++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_ACLineSegment()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_ACLineSegment"<<std::endl;
|
|||
|
|
ACLineSegment T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
T1.link_from=0;
|
|||
|
|
T1.link_to=0;
|
|||
|
|
T1.secLength=0;
|
|||
|
|
T1.foreheadI=-1;
|
|||
|
|
T1.depth=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "ACLineSegment")
|
|||
|
|
{
|
|||
|
|
acline_segment.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="LongLength")
|
|||
|
|
{
|
|||
|
|
T1.LongLength=readElementText().toDouble();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Model")
|
|||
|
|
{
|
|||
|
|
T1.Model=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="GIS_ID")
|
|||
|
|
{
|
|||
|
|
T1.GIS_ID=readElementText();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="acline_segment";
|
|||
|
|
XmlReaderFormList(i6,name1,T1.ID);
|
|||
|
|
i6++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_BusbarSection()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_BusbarSection"<<std::endl;
|
|||
|
|
BusbarSection T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
T1.busSequence=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "BusbarSection")
|
|||
|
|
{
|
|||
|
|
busbar_section.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Normal_Voltage")
|
|||
|
|
{
|
|||
|
|
T1.Normal_Voltage=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="busbar_section";
|
|||
|
|
XmlReaderFormList(i7,name1,T1.ID);
|
|||
|
|
i7++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Disconnector()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Disconnector"<<std::endl;
|
|||
|
|
Disconnector T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Disconnector")
|
|||
|
|
{
|
|||
|
|
disconnector.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Switch.normalOpen")
|
|||
|
|
{
|
|||
|
|
T1.normalOpen=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="disconnector";
|
|||
|
|
XmlReaderFormList(i8,name1,T1.ID);
|
|||
|
|
i8++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_PowerTransformer()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_PowerTransformer"<<std::endl;
|
|||
|
|
PowerTransformer T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
T1.link_1=0;
|
|||
|
|
T1.link_2=0;
|
|||
|
|
T1.link_3=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "PowerTransformer")
|
|||
|
|
{
|
|||
|
|
power_transformer.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ratedMVA")
|
|||
|
|
{
|
|||
|
|
T1.ratedMVA=readElementText().toDouble();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if (name()=="Serial_Number")
|
|||
|
|
{
|
|||
|
|
T1.Serial_Number=readElementText();
|
|||
|
|
}
|
|||
|
|
else if (name()=="Model")
|
|||
|
|
{
|
|||
|
|
T1.Model=readElementText();
|
|||
|
|
}
|
|||
|
|
else if (name()=="Type")
|
|||
|
|
{
|
|||
|
|
if(readElementText()=="public")
|
|||
|
|
{
|
|||
|
|
T1.isPublic=true;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
T1.isPublic=false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="power_transformer";
|
|||
|
|
XmlReaderFormList(i9,name1,T1.ID);
|
|||
|
|
i9++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_TransformerWinding()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_TransformerWinding"<<std::endl;
|
|||
|
|
TransformerWinding T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "TransformerWinding")
|
|||
|
|
{
|
|||
|
|
transformer_winding.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="TransformerWinding.MemberOf_PowerTransformer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_PowerTransformer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="transformer_winding";
|
|||
|
|
XmlReaderFormList(i10,name1,T1.ID);
|
|||
|
|
i10++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_GroundDisconnector()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_GroundDisconnector"<<std::endl;
|
|||
|
|
GroundDisconnector T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "GroundDisconnector")
|
|||
|
|
{
|
|||
|
|
ground_disconnector.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Switch.normalOpen")
|
|||
|
|
{
|
|||
|
|
T1.normalOpen=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="ground_disconnector";
|
|||
|
|
XmlReaderFormList(i11,name1,T1.ID);
|
|||
|
|
i11++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_CompositeSwitch()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_CompositeSwitch"<<std::endl;
|
|||
|
|
CompositeSwitch T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "CompositeSwitch")
|
|||
|
|
{
|
|||
|
|
composite_switch.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="CompositeSwitchType")
|
|||
|
|
{
|
|||
|
|
T1.CompositeSwitchType=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="composite_switch";
|
|||
|
|
XmlReaderFormList(i12,name1,T1.ID);
|
|||
|
|
i12++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Circuit()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Circuit"<<std::endl;
|
|||
|
|
Circuit T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Circuit")
|
|||
|
|
{
|
|||
|
|
circuit.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Substations")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Substations_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="circuit";
|
|||
|
|
XmlReaderFormList(i13,name1,T1.ID);
|
|||
|
|
i13++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Bay()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Bay"<<std::endl;
|
|||
|
|
Bay T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Bay")
|
|||
|
|
{
|
|||
|
|
bay.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="VoltageLevel.MemberOf_Substation")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_Substation_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="bay";
|
|||
|
|
XmlReaderFormList(i14,name1,T1.ID);
|
|||
|
|
i14++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Connector()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Connector"<<std::endl;
|
|||
|
|
Connector T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
T1.link_from=0;
|
|||
|
|
T1.link_to=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Connector")
|
|||
|
|
{
|
|||
|
|
connector.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="connector";
|
|||
|
|
XmlReaderFormList(i15,name1,T1.ID);
|
|||
|
|
i15++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Fuse()
|
|||
|
|
{
|
|||
|
|
// std::cout<<"XmlReaderread_Fuse"<<std::endl;
|
|||
|
|
Fuse T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Fuse")
|
|||
|
|
{
|
|||
|
|
fuse.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="normalOpen")
|
|||
|
|
{
|
|||
|
|
T1.normalOpen=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="fuse";
|
|||
|
|
XmlReaderFormList(i16,name1,T1.ID);
|
|||
|
|
i16++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Pole()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Pole"<<std::endl;
|
|||
|
|
Pole T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Pole")
|
|||
|
|
{
|
|||
|
|
pole.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="pole";
|
|||
|
|
XmlReaderFormList(i17,name1,T1.ID);
|
|||
|
|
i17++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_LoadBreakSwitch()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_LoadBreakSwitch"<<std::endl;
|
|||
|
|
LoadBreakSwitch T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "LoadBreakSwitch" )
|
|||
|
|
{
|
|||
|
|
load_break_switch.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="normalOpen")
|
|||
|
|
{
|
|||
|
|
T1.normalOpen=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="PowerSystemResource.Circuits")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.Circuits_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="load_break_switch";
|
|||
|
|
XmlReaderFormList(i18,name1,T1.ID);
|
|||
|
|
i18++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Qt_readxml::XmlReaderread_Breaker()
|
|||
|
|
{
|
|||
|
|
//std::cout<<"XmlReaderread_Breaker"<<std::endl;
|
|||
|
|
Breaker T1;
|
|||
|
|
QStringRef ID1 =attributes().value("ID");
|
|||
|
|
T1.ID=ID1.toString();
|
|||
|
|
T1.flag=0; T1.island=0;
|
|||
|
|
std::vector<List>::iterator it = find_if(list1.begin(), list1.end(), vector_finder(T1.ID)); //得到与ID号相对应的元素
|
|||
|
|
if(it==list1.end())
|
|||
|
|
{
|
|||
|
|
while(!atEnd())
|
|||
|
|
{
|
|||
|
|
readNext();
|
|||
|
|
if(isEndElement())
|
|||
|
|
{
|
|||
|
|
if(name() == "Breaker" )
|
|||
|
|
{
|
|||
|
|
breaker.push_back(T1);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(isStartElement())
|
|||
|
|
{
|
|||
|
|
if(name()=="Naming.description")
|
|||
|
|
{
|
|||
|
|
T1.description=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="Naming.name")
|
|||
|
|
{
|
|||
|
|
T1.name=readElementText();
|
|||
|
|
}
|
|||
|
|
else if(name()=="MemberOf_EquipmentContainer")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.MemberOf_EquipmentContainer_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
else if(name()=="ConductingEquipment.BaseVoltage")
|
|||
|
|
{
|
|||
|
|
R1=attributes().value("resource");
|
|||
|
|
T1.BaseVoltage_res.push_back(R1.toString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
QString name1="breaker";
|
|||
|
|
XmlReaderFormList(i19,name1,T1.ID);
|
|||
|
|
i19++;
|
|||
|
|
}
|
|||
|
|
}
|