1.修复了单例模板的bug

2.正在加DG

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab
2015-01-30 21:34:31 +08:00
parent cba2942574
commit d0b9071577
15 changed files with 167 additions and 45 deletions

View File

@@ -5,6 +5,7 @@
#include "line.h"
#include "switch.h"
#include "transformer.h"
#include "dg.h"
struct BranchStruc
{
QString fromID;
@@ -33,6 +34,11 @@ struct TransformerStru:public BranchStruc
};
struct DGStru:public BranchStruc
{
DG *dg;
};
#endif // COMMONTYPE

View File

@@ -0,0 +1,28 @@
#include "dg.h"
DG::DG(const QPair<QString, QString> &fromTo, double DGCapacity,const QString &id,QObject *parent):Branch(fromTo.first,fromTo.second,parent)
{
this->id=id;
this->capacity=DGCapacity;
}
DG::~DG()
{
}
void DG::extract()
{
//单位阻抗
double r0=0;
double x0=0.001;
double g0=0;
double b0=0;
this->r=r0;
this->x=x0;
this->g1=g0;
this->g2=g0;
this->b1=b0;
this->b2=b0;
}

View File

@@ -0,0 +1,20 @@
#ifndef DG_H
#define DG_H
#include <QPair>
#include <QString>
#include "branch.h"
class DG:public Branch
{
public:
DG(const QPair<QString, QString> &fromTo, double DGCapacity, const QString &id, QObject *parent=0);
DG();
~DG();
QString id;
double capacity;
private:
virtual void extract();
};
#endif // DG_H