parent
8d5fcf9c95
commit
a208823264
|
|
@ -53,25 +53,18 @@ void CIMExporter::exportTo(const QString& path)
|
|||
recurseDir.setDir(this->loadDir);
|
||||
QStringList files;
|
||||
files=recurseDir.getFiles();
|
||||
//转换斜杠
|
||||
for(QStringList::iterator ite=files.begin();ite!=files.end();ite++)
|
||||
//只取文件名
|
||||
QStringList baseNames;
|
||||
foreach(QString file,files)
|
||||
{
|
||||
*ite=(*ite).replace("\\","/");
|
||||
QFileInfo fileInfo(file);
|
||||
baseNames<<fileInfo.baseName();
|
||||
}
|
||||
|
||||
// //只取文件名
|
||||
// QStringList baseNames;
|
||||
// foreach(QString file,files)
|
||||
// {
|
||||
// QFileInfo fileInfo(file);
|
||||
// baseNames<<fileInfo.baseName();
|
||||
// }
|
||||
QStringList usedLoad;
|
||||
for(QList<CIMExporter::TransformerStru>::iterator ite=this->tf.begin();
|
||||
ite!=this->tf.end();
|
||||
ite++)
|
||||
{
|
||||
std::cout<<"f"<<std::endl;
|
||||
PowerTransformer *tf=ite->tf->getTF();
|
||||
QString subID=tf->getEquipmentMemberOf_EquipmentContainer();//所属Substation的ID
|
||||
Substation *sub=static_cast<Substation *>(this->eleHT[subID]);
|
||||
|
|
@ -84,12 +77,12 @@ void CIMExporter::exportTo(const QString& path)
|
|||
QVector<QSharedPointer<LoadInfo> > vecLoadInfo=loadMapping.getSubstationLoad(sub->getID());
|
||||
foreach(QSharedPointer<LoadInfo> p,vecLoadInfo)
|
||||
{
|
||||
std::cout<<"match "<<p->getLoadPath().toLocal8Bit().data()<<std::endl;
|
||||
if( files.contains( p->getLoadPath()) )
|
||||
QFileInfo targetBasename(p->getLoadPath());
|
||||
std::cout<<targetBasename.baseName().toLocal8Bit().data()<<std::endl;
|
||||
if( baseNames.contains( targetBasename.baseName()) and !usedLoad.contains(targetBasename.baseName()))
|
||||
{
|
||||
usedLoad<<p->getLoadPath();
|
||||
|
||||
|
||||
// std::cout<<"match "<<targetBasename.baseName().toLocal8Bit().data()<<std::endl;
|
||||
usedLoad<<targetBasename.baseName();
|
||||
p->getPA();
|
||||
break;
|
||||
}
|
||||
|
|
@ -97,11 +90,11 @@ void CIMExporter::exportTo(const QString& path)
|
|||
|
||||
}
|
||||
//列出没有用的负荷文件
|
||||
foreach(QString file, files)
|
||||
foreach(QString name, baseNames)
|
||||
{
|
||||
if(!usedLoad.contains(file))
|
||||
if(!usedLoad.contains(name))
|
||||
{
|
||||
std::cout<<file.toLocal8Bit().data()<<"not used"<<std::endl;
|
||||
std::cout<<name.toLocal8Bit().data()<<"not used"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ bool ElementHashtable::GoPath()
|
|||
}
|
||||
this->tpRecorder=new TopologyRecorder(this->eleHT,this->FDSet,this->loadFilePath);
|
||||
this->tpRecorder->startWithNode(node);
|
||||
// this->tpRecorder->exportTo("");
|
||||
this->tpRecorder->exportTo("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ public:
|
|||
QSharedPointer<LoadInfo> getALoad(const QString& id);
|
||||
QVector<QSharedPointer<LoadInfo> > getSubstationLoad(const QString& id);
|
||||
bool load(const QString& loadDir, const QString &matchdDir, const QString &exceptionFile);
|
||||
bool readLoads(const QString& dir);
|
||||
bool readMatch(const QString& dir);
|
||||
|
||||
|
||||
private:
|
||||
class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例
|
||||
|
|
@ -43,6 +42,8 @@ private:
|
|||
}
|
||||
};
|
||||
static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数
|
||||
bool readLoads(const QString& dir);
|
||||
bool readMatch(const QString& dir);
|
||||
// static QHash<QString,QVector<double> > *ht;//
|
||||
static QHash<QString,QVector<QSharedPointer<LoadInfo> > > *loads;//保存的是一个Substation下面的所有负荷信息
|
||||
static QHash<QString,QSharedPointer<LoadInfo> > *loadsToLoadInfo;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
// LoadMapping lm;
|
||||
// lm.load("D:/Project/佛山项目/数据/搭网架参数文件/","D:/Project/佛山项目/数据/匹配的数据/","D:/Project/佛山项目/数据/exception.txt");
|
||||
|
||||
// LoadInfo loadInfo;
|
||||
// loadInfo.setLoadPath("D:/Project/佛山项目/数据/搭网架参数文件/泰安/泰安负荷/718发展线/专变/威灵电机工业园电房1.csv");
|
||||
// loadInfo.updateByTime(QTime(0,15,0));
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ Task::Task()
|
|||
|
||||
void Task::doAgainstTaskFile(ElementHashtable &eleHT)
|
||||
{
|
||||
LoadMapping lm;
|
||||
lm.load("D:/Project/佛山项目/数据/搭网架参数文件/","D:/Project/佛山项目/数据/匹配的数据/","D:/Project/佛山项目/数据/exception.txt");//单例,执行一次行了。
|
||||
QFile file(this->taskFile);
|
||||
QString line;
|
||||
QStringList sep;
|
||||
|
|
|
|||
Loading…
Reference in New Issue