cimforreduceloss/testHasttable/element/line.cpp

41 lines
990 B
C++

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