2014-12-26 21:21:58 +08:00
|
|
|
#ifndef CIMEXPORTER_H
|
|
|
|
|
#define CIMEXPORTER_H
|
2014-12-28 16:40:57 +08:00
|
|
|
#include <QList>
|
|
|
|
|
#include "element/line.h"
|
|
|
|
|
#include "element/switch.h"
|
|
|
|
|
#include "element/transformer.h"
|
|
|
|
|
#include <QPair>
|
2014-12-28 16:56:45 +08:00
|
|
|
#include <QHash>
|
2015-01-20 13:19:28 +08:00
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QSharedPointer>
|
|
|
|
|
#include "recursedir.h"
|
|
|
|
|
#include "substation.h"
|
|
|
|
|
#include "loadmapping.h"
|
|
|
|
|
#include "loadinfo.h"
|
|
|
|
|
#include <QVector>
|
|
|
|
|
//#include "elementhashtable.h"
|
|
|
|
|
class Substation;
|
2014-12-26 21:21:58 +08:00
|
|
|
class CIMExporter
|
|
|
|
|
{
|
2014-12-28 16:40:57 +08:00
|
|
|
struct BranchStruc
|
|
|
|
|
{
|
|
|
|
|
QString fromID;
|
|
|
|
|
QString toID;
|
|
|
|
|
int fromNum;
|
|
|
|
|
int toNum;
|
|
|
|
|
};
|
|
|
|
|
struct LineStru:public BranchStruc
|
|
|
|
|
{
|
|
|
|
|
Line *line;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
struct SwitchStru:public BranchStruc
|
|
|
|
|
{
|
|
|
|
|
Switch *sw;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
struct TransformerStru:public BranchStruc
|
|
|
|
|
{
|
|
|
|
|
Transformer *tf;
|
|
|
|
|
|
|
|
|
|
};
|
2014-12-26 21:21:58 +08:00
|
|
|
public:
|
2015-01-20 13:19:28 +08:00
|
|
|
explicit CIMExporter(const QHash<QString,BasicElementInfo *>& eleHT,const QString& loadDir);
|
2014-12-28 16:40:57 +08:00
|
|
|
void add(const QPair<QString,QString>& fromTo,Line* line);
|
|
|
|
|
void add(const QPair<QString,QString>& fromTo,Switch* sw);
|
|
|
|
|
void add(const QPair<QString,QString>& fromTo,Transformer* tf);
|
2014-12-28 16:56:45 +08:00
|
|
|
void exportTo(const QString& path);
|
2014-12-28 16:40:57 +08:00
|
|
|
private:
|
|
|
|
|
QList<LineStru> line;
|
2014-12-28 17:16:29 +08:00
|
|
|
QList<SwitchStru> sw;
|
2014-12-28 16:40:57 +08:00
|
|
|
QList<TransformerStru> tf;
|
2014-12-28 16:56:45 +08:00
|
|
|
QHash<QString,int> number;
|
|
|
|
|
int numberIt(const QString &id);//编号
|
2014-12-28 17:16:29 +08:00
|
|
|
template<typename T>
|
|
|
|
|
void idToNumber(QList<T> &s);//把所有元件的标识进行编号
|
2015-01-20 13:19:28 +08:00
|
|
|
QString loadDir;
|
|
|
|
|
const QHash<QString,BasicElementInfo *>& eleHT;
|
2014-12-26 21:21:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CIMEXPORTER_H
|