From 774a9339e80979afd8c58249b7a4f8677aa8195f Mon Sep 17 00:00:00 2001 From: "dmy@lab" Date: Mon, 9 Mar 2015 10:31:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=B4=E7=BB=93=E7=82=B9?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dmy@lab --- testHasttable/cimexporter.cpp | 11 +++- testHasttable/element/line.cpp | 13 +++- testHasttable/element/transformer.cpp | 94 +++++++++++++++++++++++---- testHasttable/elementreduction.cpp | 10 +++ testHasttable/loadinfo.cpp | 2 +- 5 files changed, 113 insertions(+), 17 deletions(-) diff --git a/testHasttable/cimexporter.cpp b/testHasttable/cimexporter.cpp index 7bd9bff..6f70022 100644 --- a/testHasttable/cimexporter.cpp +++ b/testHasttable/cimexporter.cpp @@ -104,7 +104,16 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID) writer<<-1<line.first().fromNum; + foreach(LineStru l,this->line ) + { + if(l.id==rootID) + { + balanceNum=l.fromNum; + break; + } + } + +// std::cout<<"line number "<line.first().fromNum<<" "<line.first().toNum<<" "<line.first().isZeroBranch<line.first().dispose < Line::Line(const QPair& fromTo, ACLineSegment* ac, QObject *parent):Branch(fromTo.first,fromTo.second,parent) { this->ratio=1; @@ -10,11 +10,18 @@ Line::Line(const QPair& fromTo, ACLineSegment* ac, QObject *par void Line::extract() { + //用YJV22-3x240 ACLineSegment *ac=this->ac; double length=ac->getLength(); + if((int)length==0) + { + std::cout<<"line length zeros "<getID().toStdString()<r=r0*length; diff --git a/testHasttable/element/transformer.cpp b/testHasttable/element/transformer.cpp index 671a211..94f57b7 100644 --- a/testHasttable/element/transformer.cpp +++ b/testHasttable/element/transformer.cpp @@ -1,6 +1,6 @@ #include "transformer.h" - +#include Transformer::Transformer(const QPair& fromTo, PowerTransformer* tf, QObject *parent):Branch(fromTo.first,fromTo.second,parent) { this->ratio=1; @@ -13,18 +13,88 @@ void Transformer::extract() { PowerTransformer *tf=this->tf; 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"<getID().toStdString()<r=r0*length; - this->x=x0*length; - this->g1=g0*length; - this->g2=g0*length; - this->b1=b0*length; - this->b2=b0*length; + double r0=short_kw/1000/capkVA/1000; + double x0=short_vp/100; + double g0=noload_kw/1000/capkVA/1000; + double b0=noload_vp/100; + this->r=r0; + this->x=x0; + this->g1=g0; + this->g2=g0; + this->b1=b0; + this->b2=b0; } diff --git a/testHasttable/elementreduction.cpp b/testHasttable/elementreduction.cpp index 99d3951..bb61b08 100644 --- a/testHasttable/elementreduction.cpp +++ b/testHasttable/elementreduction.cpp @@ -20,6 +20,16 @@ void ElementReduction::calibration(const QString &id,QHashfromID.swap(idToBranch[id]->toID); } + + LineStru *line=static_cast(idToBranch[id]); + if(0==static_cast(line->length)) + { + line->length=10; + line->line->length=10; + } + + + } void ElementReduction::doIt(const QString& rootID) diff --git a/testHasttable/loadinfo.cpp b/testHasttable/loadinfo.cpp index ec0a71f..ff1ebb3 100644 --- a/testHasttable/loadinfo.cpp +++ b/testHasttable/loadinfo.cpp @@ -32,7 +32,7 @@ QPair LoadInfo::getPQ(double current) double S=0.4*current;//单位kvA double p=std::cos(c)*S; double q=std::sin(c)*S; - return QPair(p,q); + return QPair(p/1000,q/1000);//返回的是标幺值,基准容量是1MVA } double LoadInfo::get3PhP()