parent
edfb3310f8
commit
432724f3d2
|
|
@ -54,6 +54,11 @@ bool Disconnector::parse(QXmlStreamReader &reader)
|
||||||
return this->parseBasicInfo(reader);
|
return this->parseBasicInfo(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Disconnector::getEquipmentMemberOf_EquipmentContainer()
|
||||||
|
{
|
||||||
|
return this->equipmentContainer;
|
||||||
|
}
|
||||||
|
|
||||||
QString Disconnector::getNamingDescription()
|
QString Disconnector::getNamingDescription()
|
||||||
{
|
{
|
||||||
return this->namingDescription;
|
return this->namingDescription;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ class Disconnector:public BasicElementInfo
|
||||||
public:
|
public:
|
||||||
explicit Disconnector(QObject *parent = 0);
|
explicit Disconnector(QObject *parent = 0);
|
||||||
virtual bool parse(QXmlStreamReader& reader);
|
virtual bool parse(QXmlStreamReader& reader);
|
||||||
|
QString getEquipmentMemberOf_EquipmentContainer();
|
||||||
QString getNamingDescription();
|
QString getNamingDescription();
|
||||||
bool getOpenState();
|
bool getOpenState();
|
||||||
QString getTerminalA();
|
QString getTerminalA();
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,11 @@ bool ElementHashtable::child(QXmlStreamReader &reader)
|
||||||
// pointer=new Compensator(this);
|
// pointer=new Compensator(this);
|
||||||
// pointer->parse(reader);
|
// pointer->parse(reader);
|
||||||
// }
|
// }
|
||||||
// if(elementName=="Disconnector")
|
if(elementName=="Disconnector")
|
||||||
// {
|
{
|
||||||
// pointer=new Disconnector(this);
|
pointer=new Disconnector(this);
|
||||||
// pointer->parse(reader);
|
pointer->parse(reader);
|
||||||
// }
|
}
|
||||||
if(elementName=="PowerTransformer")
|
if(elementName=="PowerTransformer")
|
||||||
{
|
{
|
||||||
pointer=new PowerTransformer(this);
|
pointer=new PowerTransformer(this);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,22 @@ TopologyRecorder::~TopologyRecorder()
|
||||||
std::cout<<"total tf"<<this->tfs.length()<<std::endl;
|
std::cout<<"total tf"<<this->tfs.length()<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TopologyRecorder::isEquipmentNeeded(const QString& substatinID)
|
||||||
|
{
|
||||||
|
const QHash<QString,BasicElementInfo*> &ht=this->eleHT;
|
||||||
|
Substation *sfd=static_cast<Substation *>(ht[substatinID]);
|
||||||
|
if(sfd==NULL)
|
||||||
|
{
|
||||||
|
std::cout<<"can not find"<<substatinID.toStdString()<<std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
||||||
|
return feederID=="FD-2023";
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool TopologyRecorder::startWithNode(const QString& node)
|
bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
{
|
{
|
||||||
if(node=="")
|
if(node=="")
|
||||||
|
|
@ -60,9 +76,10 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
BasicElementInfo *bi=ht[ce];
|
BasicElementInfo *bi=ht[ce];
|
||||||
if(bi!=NULL)
|
if(bi!=NULL)
|
||||||
{
|
{
|
||||||
std::cout<<bi->getName().toStdString()<<std::endl;
|
|
||||||
if(bi->getName()=="Breaker")
|
if(bi->getName()=="Breaker")
|
||||||
{
|
{
|
||||||
|
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||||
QString swID=ce;
|
QString swID=ce;
|
||||||
fromTo.first=node;
|
fromTo.first=node;
|
||||||
fromTo.second=swID;
|
fromTo.second=swID;
|
||||||
|
|
@ -89,11 +106,18 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
}
|
}
|
||||||
if(bi->getName()=="Disconnector")
|
if(bi->getName()=="Disconnector")
|
||||||
{
|
{
|
||||||
|
std::cout<<bi->getName().toStdString()<<std::endl;
|
||||||
QString disConID=ce;
|
QString disConID=ce;
|
||||||
|
Disconnector *Dis=static_cast<Disconnector *>(ht[disConID]);
|
||||||
|
//先判断一下是不是需要的Disconnector
|
||||||
|
QString container=Dis->getEquipmentMemberOf_EquipmentContainer();
|
||||||
|
if(!this->isEquipmentNeeded(container))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
fromTo.first=node;
|
fromTo.first=node;
|
||||||
fromTo.second=disConID;
|
fromTo.second=disConID;
|
||||||
|
|
||||||
Disconnector *Dis=static_cast<Disconnector *>(ht[disConID]);
|
|
||||||
if(!Dis)
|
if(!Dis)
|
||||||
{
|
{
|
||||||
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
// std::cout<<"can not SW "<<swID.toStdString()<<std::endl;//@1
|
||||||
|
|
@ -152,22 +176,13 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
||||||
//判断一下这个变压器是不是我们需要的
|
//判断一下这个变压器是不是我们需要的
|
||||||
QString equipmentContainer;
|
QString equipmentContainer;
|
||||||
equipmentContainer=tf->getEquipmentMemberOf_EquipmentContainer();
|
equipmentContainer=tf->getEquipmentMemberOf_EquipmentContainer();
|
||||||
Substation *sfd=static_cast<Substation *>(ht[equipmentContainer]);
|
if(this->isEquipmentNeeded(equipmentContainer))
|
||||||
if(sfd==NULL)
|
|
||||||
{
|
{
|
||||||
std::cout<<"can not find"<<equipmentContainer.toStdString()<<std::endl;
|
this->tfs.push_back(tf->getNamingDescription());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString feederID=sfd->getSubstationMemberOf_Feeder();
|
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
||||||
if(feederID!="FD-2023")
|
|
||||||
{
|
|
||||||
std::cout<<tf->getNamingDescription().toStdString()<<"not belong"<<std::endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->tfs.push_back(tf->getNamingDescription());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// foundCate=true;
|
// foundCate=true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ private:
|
||||||
QVector<QPair<QString,QString> > branch;
|
QVector<QPair<QString,QString> > branch;
|
||||||
QHash<QString,char> reachedTerminal;
|
QHash<QString,char> reachedTerminal;
|
||||||
QVector<QString> tfs;
|
QVector<QString> tfs;
|
||||||
|
bool isEquipmentNeeded(const QString& substatinID);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOPOLOGYRECORDER_H
|
#endif // TOPOLOGYRECORDER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue