解决头结点变化错误的问题。

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab 2015-03-09 10:31:33 +08:00
parent 1b7e860bdc
commit 774a9339e8
5 changed files with 113 additions and 17 deletions

View File

@ -104,7 +104,16 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
writer<<-1<<endLine;//忘记是什么了 writer<<-1<<endLine;//忘记是什么了
writer<<0<<endLine;//数据间隔 writer<<0<<endLine;//数据间隔
int balanceNum;//平衡节点号 int balanceNum;//平衡节点号
balanceNum=this->line.first().fromNum; foreach(LineStru l,this->line )
{
if(l.id==rootID)
{
balanceNum=l.fromNum;
break;
}
}
// std::cout<<"line number "<<this->line.first().fromNum<<" "<<this->line.first().toNum<<" "<<this->line.first().isZeroBranch<<this->line.first().dispose <<std::endl;
writer<<1<<seperator<<balanceNum<<seperator; writer<<1<<seperator<<balanceNum<<seperator;
writer<<"1.05"<<endLine;//平衡节点电压 writer<<"1.05"<<endLine;//平衡节点电压
writer<<0<<endLine;//数据间隔 writer<<0<<endLine;//数据间隔

View File

@ -1,5 +1,5 @@
#include "line.h" #include "line.h"
#include <iostream>
Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second,parent) Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second,parent)
{ {
this->ratio=1; this->ratio=1;
@ -10,11 +10,18 @@ Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *par
void Line::extract() void Line::extract()
{ {
//用YJV22-3x240
ACLineSegment *ac=this->ac; ACLineSegment *ac=this->ac;
double length=ac->getLength(); double length=ac->getLength();
if((int)length==0)
{
std::cout<<"line length zeros "<<ac->getID().toStdString()<<std::endl;
}
//单位阻抗 //单位阻抗
double r0=0.01; double rn0=0.0958;//单位电阻有名值
double x0=0.01; double xn0=0.0881;//单位电抗有名值
double r0=rn0/(10.5*10.5/1000);//电压10.5kV,基准容量1MVA
double x0=xn0/(10.5*10.5/1000);
double g0=0; double g0=0;
double b0=0; double b0=0;
this->r=r0*length; this->r=r0*length;

View File

@ -1,6 +1,6 @@
#include "transformer.h" #include "transformer.h"
#include <iostream>
Transformer::Transformer(const QPair<QString,QString>& fromTo, PowerTransformer* tf, QObject *parent):Branch(fromTo.first,fromTo.second,parent) Transformer::Transformer(const QPair<QString,QString>& fromTo, PowerTransformer* tf, QObject *parent):Branch(fromTo.first,fromTo.second,parent)
{ {
this->ratio=1; this->ratio=1;
@ -13,18 +13,88 @@ void Transformer::extract()
{ {
PowerTransformer *tf=this->tf; PowerTransformer *tf=this->tf;
this->capacityMVA=tf->getMVA(); this->capacityMVA=tf->getMVA();
double length=10; // double length=-1;
//几个变压器型号的参数
//S11-315/10 uk(short)=4% copper loss=3.3kW Noload=1.1% Noload Loss=0.48kW
//S11-M-160/10 uk(short)=4% copper loss=1.9955kW Noload=1.4% Noload Loss=0.28kW
//S11-M-250/10 uk(short)=4% copper loss=3.05kW Noload=1.2% Noload Loss=0.4kW
//S11-M-30/10 uk(short)=4% copper loss=0.6kW Noload=2% Noload Loss=0.1kW
//S11-M-500/10 uk(short)=4% copper loss=4.67kW Noload=1% Noload Loss=0.68kW
//S11-M-630/10 uk(short)=4.5% copper loss=5.62kW Noload=0.9% Noload Loss=0.81kW
//S11-M-800/10 uk(short)=4.5% copper loss=6.08kW Noload=0.8% Noload Loss=0.98kW
int capkVA=int(this->capacityMVA*1000);
//std::cout<<"cap"<<cap<<std::endl;
// if(cap==0)
// {
// std::cout<<"0 cap "<<tf->getID().toStdString()<<std::endl;
// }
double short_kw=0;
double short_vp=0;
double noload_kw=0;
double noload_vp=0;
switch (capkVA) {
case 315:
short_kw=3.3;
short_vp=4;
noload_kw=0.48;
noload_vp=1.1;
break;
case 160:
short_kw=1.9955;
short_vp=4;
noload_kw=0.28;
noload_vp=1.4;
break;
case 250:
short_kw=3.05;
short_vp=4;
noload_kw=0.4;
noload_vp=1.2;
break;
case 30:
short_kw=0.6;
short_vp=4;
noload_kw=0.1;
noload_vp=2;
break;
case 500:
short_kw=4.67;
short_vp=4;
noload_kw=0.68;
noload_vp=1;
break;
case 630:
short_kw=5.62;
short_vp=4.5;
noload_kw=0.81;
noload_vp=0.9;
break;
case 800:
short_kw=6.08;
short_vp=4.5;
noload_kw=0.98;
noload_vp=0.8;
break;
default:
short_kw=6.08;
short_vp=4.5;
noload_kw=0.98;
noload_vp=0.8;
break;
}
//单位阻抗 //单位阻抗
double r0=0.01; double r0=short_kw/1000/capkVA/1000;
double x0=0.01; double x0=short_vp/100;
double g0=0; double g0=noload_kw/1000/capkVA/1000;
double b0=0; double b0=noload_vp/100;
this->r=r0*length; this->r=r0;
this->x=x0*length; this->x=x0;
this->g1=g0*length; this->g1=g0;
this->g2=g0*length; this->g2=g0;
this->b1=b0*length; this->b1=b0;
this->b2=b0*length; this->b2=b0;
} }

View File

@ -20,6 +20,16 @@ void ElementReduction::calibration(const QString &id,QHash<QString,BranchStruc *
{ {
idToBranch[id]->fromID.swap(idToBranch[id]->toID); idToBranch[id]->fromID.swap(idToBranch[id]->toID);
} }
LineStru *line=static_cast<LineStru *>(idToBranch[id]);
if(0==static_cast<int>(line->length))
{
line->length=10;
line->line->length=10;
}
} }
void ElementReduction::doIt(const QString& rootID) void ElementReduction::doIt(const QString& rootID)

View File

@ -32,7 +32,7 @@ QPair<double,double> LoadInfo::getPQ(double current)
double S=0.4*current;//单位kvA double S=0.4*current;//单位kvA
double p=std::cos(c)*S; double p=std::cos(c)*S;
double q=std::sin(c)*S; double q=std::sin(c)*S;
return QPair<double,double>(p,q); return QPair<double,double>(p/1000,q/1000);//返回的是标幺值基准容量是1MVA
} }
double LoadInfo::get3PhP() double LoadInfo::get3PhP()