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