有可能会访问到重复的元件,如果是已经访问过的就不添加了。
Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
parent
c1b2c0e367
commit
5cd6849e95
|
|
@ -49,6 +49,7 @@ void CIMExporter::exportTo(const QString& path)
|
|||
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void CIMExporter::idToNumber(QList<T> &s)//把所有元件的标识进行编号
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
// ReadWrite aa;
|
||||
RegexExtract re;
|
||||
re.extract("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml");
|
||||
re.exportBlocks("./a");
|
||||
return a.exec();
|
||||
// RegexExtract re;
|
||||
// re.extract("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml");
|
||||
// re.exportBlocks("./a");
|
||||
// return a.exec();
|
||||
ElementHashtable eleReader;
|
||||
eleReader.Parse("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml","D:/Project/佛山项目/佛山收资/exportmodel_zwyth20141204/exportmodel_zwyth.xml");
|
||||
// eleReader.GoPath();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void Task::doAgainstTaskFile(ElementHashtable &eleHT)
|
|||
eleHT.SetFDSet(setSep.toVector());
|
||||
eleHT.GoPath();
|
||||
eleHT.ShowContainerInfo(lineName);
|
||||
// break;
|
||||
break;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
719广水Ⅱ线,AC-831217,(FD-2048)
|
||||
#704广水Ⅲ线,AC-591831,()无svg
|
||||
703港前北线,AC-671661,(FD-1992,FD-1998)
|
||||
730ĚŠ¸ŰŇŇĎß,AC-903666,(FD-58442,FD-2025)
|
||||
730ĚŠ¸ŰŇŇĎß,AC-903666,(FD-58442,FD-2025,)
|
||||
716兴业南线,AC-591810,(FD-1994,FD-58443)
|
||||
712洗碗机线,AC-671668,(FD-2042)
|
||||
714泰林西乙线,AC-671670,(FD-2103,)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
{
|
||||
TopologyRecorder::Type::EleType typ;
|
||||
BasicElementInfo *foundEle=NULL;
|
||||
// bool foundCate=false;
|
||||
anotherTerminal=anotherTerminalVector.at(atI);
|
||||
if(this->reachedTerminal.contains(anotherTerminal))
|
||||
{
|
||||
|
|
@ -109,10 +108,6 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
}
|
||||
terminalA=AC->getTerminalA();
|
||||
terminalB=AC->getTerminalB();
|
||||
// std::cout<<"find"<<AC->getID().toStdString()<<std::endl;
|
||||
// std::cout<<AC->getNamingDescription().toStdString()<<std::endl;
|
||||
//把线路长度也输出来看一下
|
||||
// std::cout<<AC->getLength()<<std::endl;
|
||||
foundEle=AC;
|
||||
typ=TopologyRecorder::Type::AC;
|
||||
}
|
||||
|
|
@ -244,6 +239,12 @@ bool TopologyRecorder::startWithNode(const QString& node)
|
|||
Branch *branch=NULL;
|
||||
switch(typ)
|
||||
{
|
||||
//有可能会访问到重复的元件,所以这里判断一下,如果是已经访问过的就不添加了。
|
||||
if(this->hasAdded.contains(foundEle->getID()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
this->hasAdded[foundEle->getID()]=0;
|
||||
case TopologyRecorder::Type::AC:
|
||||
branch=new Line(fromTo,static_cast<ACLineSegment *>(foundEle),this);
|
||||
this->cimExporter.add(fromTo,static_cast<Line *>(branch));
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ private:
|
|||
QVector<QString> tfs;
|
||||
CIMExporter cimExporter;
|
||||
QVector<QString> FDSet;
|
||||
QHash<QString,char> hasAdded;
|
||||
bool isEquipmentNeeded(const QString& substatinID);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue