parent
4df79fa6fb
commit
46f890b77b
|
|
@ -64,6 +64,11 @@ QString ACLineSegment::getTerminalB()
|
|||
return this->terminalB;
|
||||
}
|
||||
|
||||
void ACLineSegment::setLength(double length)
|
||||
{
|
||||
this->conductorLength=length;
|
||||
}
|
||||
|
||||
bool ACLineSegment::parse(QXmlStreamReader &reader)
|
||||
{
|
||||
return this->parseBasicInfo(reader);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public:
|
|||
QString getTerminalB();
|
||||
double getLength();
|
||||
QString getNamingDescription();
|
||||
void setLength(double length);
|
||||
protected:
|
||||
QString terminalA;
|
||||
QString terminalB;
|
||||
|
|
|
|||
|
|
@ -136,20 +136,20 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
|
|||
writer<<seqN++<<seperator;
|
||||
writer<<l.fromNum<<seperator;
|
||||
writer<<l.toNum<<seperator;
|
||||
if(l.id==rootID && static_cast<int>(l.length)==0)
|
||||
{
|
||||
writer<<0.01<<seperator;
|
||||
writer<<0.01<<seperator;
|
||||
writer<<0<<seperator;
|
||||
writer<<0<<seperator;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if(l.id==rootID && static_cast<int>(l.length)==0)
|
||||
// {
|
||||
// writer<<0.01<<seperator;
|
||||
// writer<<0.01<<seperator;
|
||||
// writer<<0<<seperator;
|
||||
// writer<<0<<seperator;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
writer<<l.line->r<<seperator;
|
||||
writer<<l.line->x<<seperator;
|
||||
writer<<l.line->b1<<seperator;
|
||||
writer<<l.line->b2<<seperator;
|
||||
}
|
||||
// }
|
||||
writer<<endLine;
|
||||
// writer<<"type"<<seperator;
|
||||
// writer<<l.id<<"\t";
|
||||
|
|
|
|||
|
|
@ -8,12 +8,17 @@ Line::Line(const QPair<QString,QString>& fromTo, ACLineSegment* ac, QObject *par
|
|||
}
|
||||
|
||||
|
||||
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;
|
||||
|
|
@ -31,5 +36,5 @@ void Line::extract()
|
|||
this->g2=g0*length/1000;
|
||||
this->b1=b0*length/1000;
|
||||
this->b2=b0*length/1000;
|
||||
this->length=length/1000;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class Line:public Branch
|
|||
{
|
||||
public:
|
||||
Line(const QPair<QString, QString> &fromTo, ACLineSegment* ac,QObject* parent=0);
|
||||
void re_extract();
|
||||
double length;
|
||||
ACLineSegment *ac;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,15 @@ void ElementReduction::doIt(const QString& rootID)
|
|||
|
||||
this->merge(element,idToBranch);
|
||||
this->reduceSection();
|
||||
//因为有线路合并,线路长度变了,所以要重新计算参数
|
||||
foreach(BranchStruc* v,this->branchList)
|
||||
{
|
||||
LineStru *line=static_cast<LineStru*>(v);
|
||||
if(line!=NULL)
|
||||
{
|
||||
line->line->re_extract();
|
||||
}
|
||||
}
|
||||
|
||||
// QFile file("1.xml");
|
||||
// if(file.open(QFile::WriteOnly))
|
||||
|
|
@ -274,6 +283,7 @@ void ElementReduction::reduceSection()
|
|||
if(lineBranch)
|
||||
{
|
||||
lineBranch->line->length=branch->length;
|
||||
lineBranch->line->ac->setLength(branch->length);//TODO:线路的这个长度还是要统一一下,否则很容易出错。
|
||||
}else
|
||||
{
|
||||
std::cout<<"can not conver from BranchStruc to LineStru"<<std::endl;
|
||||
|
|
|
|||
Loading…
Reference in New Issue