diff --git a/testHasttable/cimexporter.cpp b/testHasttable/cimexporter.cpp index 8595211..180c447 100644 --- a/testHasttable/cimexporter.cpp +++ b/testHasttable/cimexporter.cpp @@ -22,6 +22,12 @@ void CIMExporter::add(const QPair& fromTo,Switch* sw) switchStru.sw=sw; switchStru.fromID=fromTo.first; switchStru.toID=fromTo.second; +// if(fromTo.second.trimmed()=="") +// { +//// QString id=sw->id; +//// switchStru.toID=id.section('-',0,0)+id.section('-',0,0)+id.section('-',1,1);//定义一个虚拟的 +// switchStru.toID=sw->id; +// } switchStru.id=sw->id; switchStru.isZeroBranch=true; switchStru.dispose=false; @@ -113,8 +119,14 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID) foreach(QString file,files) { QFileInfo fileInfo(file); + if(fileInfo.suffix().toLower()!="csv") + { + continue; + } baseNames<tf->getTF(); QString subID=tf->getEquipmentMemberOf_EquipmentContainer();//所属Substation的ID + Substation *sub=static_cast(this->eleHT[subID]); if(!sub) { std::cout<<"CIMExporter:: can not substation of "<getID().toStdString()< > vecLoadInfo=loadMapping.getSubstationLoad(sub->getID()); foreach(QSharedPointer p,vecLoadInfo) { + QFileInfo targetBasename(p->getLoadPath()); - // std::cout<getLoadPath().toLocal8Bit().data()<updateByTime(QTime(3,45,0)); -// std::cout<numberIt(ite->toID)<<" "<< p->getPA()<fromNum<<"\t"; writer<toNum<<"\t"; writer<<"type"<<"\t"; diff --git a/testHasttable/elementreduction.cpp b/testHasttable/elementreduction.cpp index 542c7ea..61877ca 100644 --- a/testHasttable/elementreduction.cpp +++ b/testHasttable/elementreduction.cpp @@ -71,7 +71,7 @@ void ElementReduction::doIt(const QString& rootID) void ElementReduction::merge(QDomElement &element,QHash& idToBranch) { - return; +// return; QString parentID=idToBranch[element.tagName()]->id; QStringList sep=parentID.split('-'); QString toID=sep.at(1)+sep.at(0); diff --git a/testHasttable/loadmapping.cpp b/testHasttable/loadmapping.cpp index 84a2a67..654cbc8 100644 --- a/testHasttable/loadmapping.cpp +++ b/testHasttable/loadmapping.cpp @@ -48,6 +48,10 @@ QSharedPointer LoadMapping::getALoad(const QString& id) QVector > LoadMapping::getSubstationLoad(const QString& id) { + if(!this->loads->contains(id)) + { + return QVector >(); + } return (*this->loads)[id]; } @@ -122,6 +126,7 @@ bool LoadMapping::readLoads(const QString &dir) continue; } QSharedPointer loadInfo=(*this->loadsToLoadInfo)[fileName]; +// std::cout<<"file name "<setLoadPath(filePath); } @@ -174,6 +179,14 @@ bool LoadMapping::readMatch(const QString& dir) } QSharedPointer t(new LoadInfo); t->setLoadName(sep.at(i)); +// if(sep.at(i).trimmed()=="") +// { +// std::cout<<"empy "<loadsToLoadInfo)[sep.at(i)]=t; diff --git a/testHasttable/main.cpp b/testHasttable/main.cpp index ef191cb..2ffac2b 100644 --- a/testHasttable/main.cpp +++ b/testHasttable/main.cpp @@ -3,10 +3,11 @@ #include "regexextract.h" #include "task.h" #include -//#include "loadmapping.h" +#include "loadmapping.h" //#include "loadinfo.h" #include "dgmapping.h" -#include "topologytest.h" +//#include "topologytest.h" +//#include "recursedir.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); @@ -124,6 +125,16 @@ int main(int argc, char *argv[]) // re.extract("D:/Project/佛山项目/数据/df8003/df8600/exportfiles/exportmodel_pw.xml"); // re.exportBlocks("./a"); +// LoadMapping lm; +// lm.load("D:/Project/佛山项目/数据/搭网架参数文件/","D:/Project/佛山项目/数据/匹配的数据/","D:/Project/佛山项目/数据/exception.txt");//单例,执行一次行了。 +// std::cout<getConnectivityNode(); fromTo.first=node; fromTo.second=nextNode; + if(nextNode=="") + { + fromTo.second=foundEle->getID();//用虚拟节点 + } } } else