@@ -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
|
||||
|
||||
|
||||
28
testHasttable/element/dg.cpp
Normal file
28
testHasttable/element/dg.cpp
Normal 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;
|
||||
}
|
||||
|
||||
20
testHasttable/element/dg.h
Normal file
20
testHasttable/element/dg.h
Normal 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
|
||||
Reference in New Issue
Block a user