cimforreduceloss/testHasttable/cimexporter.h

77 lines
1.9 KiB
C
Raw Normal View History

#ifndef CIMEXPORTER_H
#define CIMEXPORTER_H
#include <QList>
#include "element/line.h"
#include "element/switch.h"
#include "element/transformer.h"
#include "element/commontype.h"
#include <QPair>
#include <QHash>
#include <QStringList>
#include <QFileInfo>
#include <QSharedPointer>
#include <QTime>
#include <QFile>
#include <QTextStream>
#include "recursedir.h"
#include "substation.h"
#include "loadmapping.h"
#include "loadinfo.h"
#include <QVector>
#include "topologytest.h"
#include "elementreduction.h"
#include "loadmatchexception.h"
#include "special/loadexporter.h"
#include <cmath>
//#include "elementhashtable.h"
//class Substation;
class CIMExporter
{
class NodePQ
{
public:
NodePQ():nodeNum(0),P(0),Q(0)
{}
explicit NodePQ(int nodeNum,double P,double Q):nodeNum(nodeNum),P(P),Q(Q)
{}
int nodeNum;
double P;
double Q;
};
class GroundBranch
{
public:
explicit GroundBranch(int nodeNum,double g,double b):nodeNum(nodeNum),g(g),b(b)
{}
int nodeNum;
double g;
double b;
};
public:
explicit CIMExporter(const QHash<QString,BasicElementInfo *>& eleHT,const QString& loadDir);
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);
void add(const QPair<QString,QString>& fromTo,DG* dg);
void exportTo(const QString& path, const QString &rootID);
private:
bool topologyTest();
QList<LineStru> line;
QList<SwitchStru> sw;
QList<TransformerStru> tf;
QList<DGStru> dg;
QHash<QString,int> number;
int numberIt(const QString &id);//编号
template<typename T>
void idToNumber(QList<T> &s);//把所有元件的标识进行编号
QString loadDir;
const QHash<QString,BasicElementInfo *>& eleHT;
};
#endif // CIMEXPORTER_H