cimforreduceloss/testHasttable/element/line.cpp

35 lines
870 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::extract()
{
//用YJV22-3x240
ACLineSegment *ac=this->ac;
double length=ac->getLength();
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/1000);//电压10.5kV,基准容量1MVA
double x0=xn0/(10.5*10.5/1000);
double g0=0;
double b0=0;
this->r=r0*length;
this->x=x0*length;
this->g1=g0*length;
this->g2=g0*length;
this->b1=b0*length;
this->b2=b0*length;
this->length=length;
}