1.把xml文件中明显错误的变压器容量读为630kVA
2.把电容器输出到数据文件中。 Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
parent
7e5c6c71a1
commit
d0316a7c50
|
|
@ -20,6 +20,7 @@ class iPsoData:
|
||||||
self.__voltLimit = []
|
self.__voltLimit = []
|
||||||
self.__ground = []
|
self.__ground = []
|
||||||
self.__isAvailable = False
|
self.__isAvailable = False
|
||||||
|
self.__cap=[]
|
||||||
self.__read__(filePath)
|
self.__read__(filePath)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -57,6 +58,8 @@ class iPsoData:
|
||||||
self.__trans.append(floatSep)
|
self.__trans.append(floatSep)
|
||||||
if cur == 5:
|
if cur == 5:
|
||||||
self.__ground.append(floatSep)
|
self.__ground.append(floatSep)
|
||||||
|
if cur==6:
|
||||||
|
self.__cap.append(floatSep)
|
||||||
if cur == 8:
|
if cur == 8:
|
||||||
self.__nodePwer.append(floatSep)
|
self.__nodePwer.append(floatSep)
|
||||||
if cur == 9:
|
if cur == 9:
|
||||||
|
|
@ -67,6 +70,9 @@ class iPsoData:
|
||||||
self.__voltLimit.append(floatSep)
|
self.__voltLimit.append(floatSep)
|
||||||
line = f.readline()
|
line = f.readline()
|
||||||
|
|
||||||
|
def GetCapcitor(self):
|
||||||
|
return self.__cap
|
||||||
|
|
||||||
def GetBasicInfo(self):
|
def GetBasicInfo(self):
|
||||||
return self.__basicInfo
|
return self.__basicInfo
|
||||||
|
|
||||||
|
|
@ -105,18 +111,22 @@ class MergeReconfigFile: # 合并重构用文件
|
||||||
self.__mergedIpsoBalance = []
|
self.__mergedIpsoBalance = []
|
||||||
self.__mergedIpsoLine = []
|
self.__mergedIpsoLine = []
|
||||||
self.__mergedIpsoTrans = []
|
self.__mergedIpsoTrans = []
|
||||||
|
self.__mergedCapcitor=[]
|
||||||
self.__mergedIpsoLoad = []
|
self.__mergedIpsoLoad = []
|
||||||
self.__mergedIpsoGround = []
|
self.__mergedIpsoGround = []
|
||||||
self.__mergedNodeNameDic = {}
|
self.__mergedNodeNameDic = {}
|
||||||
# self.__addNumDic = {} #计算每个文件在新文件中的偏移量
|
# self.__addNumDic = {} #计算每个文件在新文件中的偏移量
|
||||||
self.__balanceNodeOffset=[]#记录每条线路头节点在整个合并文件中的位置
|
self.__balanceNodeOffset=[]#记录每条线路头节点在整个合并文件中的位置
|
||||||
|
self.__nodePlace= dict()
|
||||||
self.__merge(fileList)
|
self.__merge(fileList)
|
||||||
|
|
||||||
|
|
||||||
def __merge(self, fileList):
|
def __merge(self, fileList):
|
||||||
indLine = 1 #序号
|
indLine = 1 #序号
|
||||||
indTrans=1
|
indTrans=1
|
||||||
indNode = 2
|
indNode = 2
|
||||||
indGround = 1
|
indGround = 1
|
||||||
|
indCap=1
|
||||||
addNum = 1
|
addNum = 1
|
||||||
# offsetNodeNum = {} #记录每个一个文件在新文件里节点的偏移量
|
# offsetNodeNum = {} #记录每个一个文件在新文件里节点的偏移量
|
||||||
count=1
|
count=1
|
||||||
|
|
@ -150,11 +160,17 @@ class MergeReconfigFile: # 合并重构用文件
|
||||||
#接地支路
|
#接地支路
|
||||||
for g in ipsodata.GetGround():
|
for g in ipsodata.GetGround():
|
||||||
self.__mergedIpsoGround.append([indGround, g[1] + addNum, g[2], g[3]])
|
self.__mergedIpsoGround.append([indGround, g[1] + addNum, g[2], g[3]])
|
||||||
|
indGround+=1
|
||||||
|
#电容器
|
||||||
|
for c in ipsodata.GetCapcitor():
|
||||||
|
self.__mergedCapcitor.append([indCap,c[1],c[2]+addNum,c[3],c[4],c[5],c[6],c[7]])
|
||||||
|
indCap+=1
|
||||||
#先给PG和QG赋值
|
#先给PG和QG赋值
|
||||||
node = ipsodata.GetNodePower()
|
node = ipsodata.GetNodePower()
|
||||||
#序号 节点编号 节点有功 节点无功 负荷有功 负荷无功
|
#序号 节点编号 节点有功 节点无功 负荷有功 负荷无功
|
||||||
for n in ipsodata.GetNodePower():
|
for n in ipsodata.GetNodePower():
|
||||||
self.__mergedIpsoLoad.append([indNode, n[1], n[2] + addNum, n[3], n[4], n[5], n[6], n[7], 0, 0])
|
self.__mergedIpsoLoad.append([indNode, n[1], n[2] + addNum, n[3], n[4], n[5], n[6], n[7], 0, 0])
|
||||||
|
self.__nodePlace[n[2] + addNum]=f
|
||||||
indNode += 1
|
indNode += 1
|
||||||
# self.__addNumDic[lineName] = len(ipsodata.GetNodePower()) #每条线路的节点数
|
# self.__addNumDic[lineName] = len(ipsodata.GetNodePower()) #每条线路的节点数
|
||||||
# offsetNodeNum[lineName] = addNum #记录的是与之前线路的偏移量
|
# offsetNodeNum[lineName] = addNum #记录的是与之前线路的偏移量
|
||||||
|
|
@ -198,6 +214,9 @@ class MergeReconfigFile: # 合并重构用文件
|
||||||
for g in self.__mergedIpsoGround:
|
for g in self.__mergedIpsoGround:
|
||||||
f.write('%d %d %f %f\n' % (g[0], g[1], g[2],g[3]))
|
f.write('%d %d %f %f\n' % (g[0], g[1], g[2],g[3]))
|
||||||
f.write('0\n')
|
f.write('0\n')
|
||||||
|
for c in self.__mergedCapcitor:
|
||||||
|
#[indCap,c[1],c[2]+addNum,c[3],c[4],c[5],c[6],c[7]]
|
||||||
|
f.write('%d %d %d %f %f %d %d %d\n' % (c[0], c[1], c[2],c[3],c[4],c[5],c[6],c[7]))
|
||||||
f.write('0\n')
|
f.write('0\n')
|
||||||
f.write('0\n')
|
f.write('0\n')
|
||||||
for n in self.__mergedIpsoLoad:
|
for n in self.__mergedIpsoLoad:
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,8 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
|
||||||
QList<CIMExporter::GroundBranch > groudBranch;//first is g, second is b.
|
QList<CIMExporter::GroundBranch > groudBranch;//first is g, second is b.
|
||||||
QList<CIMExporter::NodePQ> nodePQ;//节点注入功率,也就是负荷或者发电机
|
QList<CIMExporter::NodePQ> nodePQ;//节点注入功率,也就是负荷或者发电机
|
||||||
QStringList usedLoad;
|
QStringList usedLoad;
|
||||||
|
//电容器补偿量
|
||||||
|
QHash<int,double> capacitor;
|
||||||
for(QList<TransformerStru>::iterator ite=this->tf.begin();
|
for(QList<TransformerStru>::iterator ite=this->tf.begin();
|
||||||
ite!=this->tf.end();
|
ite!=this->tf.end();
|
||||||
ite++)
|
ite++)
|
||||||
|
|
@ -238,7 +240,9 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
|
||||||
writer<<endLine;
|
writer<<endLine;
|
||||||
//保存接地支路
|
//保存接地支路
|
||||||
groudBranch.push_back(CIMExporter::GroundBranch(ite->fromNum, ite->tf->g1,ite->tf->b1));//都只用g1,b1的数据
|
groudBranch.push_back(CIMExporter::GroundBranch(ite->fromNum, ite->tf->g1,ite->tf->b1));//都只用g1,b1的数据
|
||||||
|
//保存补偿量
|
||||||
|
capacitor[ite->toNum]=ite->tf->capacityMVA*.3;//30% 容性
|
||||||
|
// std::cout<<"cap "<<ite->tf->capacityMVA<< ite->id.toStdString()<<capacitor[ite->toNum] <<std::endl;
|
||||||
|
|
||||||
LoadMapping loadMapping;
|
LoadMapping loadMapping;
|
||||||
QVector<QSharedPointer<LoadInfo> > vecLoadInfo=loadMapping.getSubstationLoad(sub->getID());
|
QVector<QSharedPointer<LoadInfo> > vecLoadInfo=loadMapping.getSubstationLoad(sub->getID());
|
||||||
|
|
@ -277,6 +281,13 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
|
||||||
writer<<endLine;
|
writer<<endLine;
|
||||||
}
|
}
|
||||||
writer<<0<<endLine;//数据间隔
|
writer<<0<<endLine;//数据间隔
|
||||||
|
//电容器
|
||||||
|
seqN=1;
|
||||||
|
foreach(int node,capacitor.keys())
|
||||||
|
{
|
||||||
|
// std::cout<<"cap"<< capacitor[node]<<std::endl;
|
||||||
|
writer<<seqN++<<seperator<<1<<seperator<<node<<seperator<<0<<seperator<<capacitor[node]<<seperator<<0<<seperator<<-1<<seperator<<1<<endLine;
|
||||||
|
}
|
||||||
writer<<0<<endLine;//数据间隔
|
writer<<0<<endLine;//数据间隔
|
||||||
writer<<0<<endLine;//数据间隔
|
writer<<0<<endLine;//数据间隔
|
||||||
//列出DG
|
//列出DG
|
||||||
|
|
@ -286,7 +297,7 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
|
||||||
ite++)
|
ite++)
|
||||||
{
|
{
|
||||||
//保存到节点注入功率中
|
//保存到节点注入功率中
|
||||||
nodePQ.push_back(CIMExporter::NodePQ(ite->toNum,-ite->dg->getPG(0.95)/1000,-ite->dg->getQG(0.95)/1000) );//capapcity的单位是kVA
|
nodePQ.push_back(CIMExporter::NodePQ(ite->toNum,-ite->dg->getPG(0.999)/1000*.5,-ite->dg->getQG(0.999)/1000*.5) );//capapcity的单位是kVA
|
||||||
// writer<<ite->fromNum<<"\t";
|
// writer<<ite->fromNum<<"\t";
|
||||||
// writer<<ite->toNum<<"\t";
|
// writer<<ite->toNum<<"\t";
|
||||||
// writer<<ite->dg->capacity<<"\r\n";
|
// writer<<ite->dg->capacity<<"\r\n";
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,12 @@ bool PowerTransformer::derivedParse(QXmlStreamReader &reader)
|
||||||
QString ratedMVA=reader.readElementText();
|
QString ratedMVA=reader.readElementText();
|
||||||
bool ok;
|
bool ok;
|
||||||
double _ratedMVA=ratedMVA.toDouble(&ok);
|
double _ratedMVA=ratedMVA.toDouble(&ok);
|
||||||
this->powerTransformerRatedMVA_H=ok?_ratedMVA:-10000;
|
double assignedMVA=ok?_ratedMVA:-10000;
|
||||||
|
if(assignedMVA>5)
|
||||||
|
{
|
||||||
|
assignedMVA=0.63;
|
||||||
|
}
|
||||||
|
this->powerTransformerRatedMVA_H=assignedMVA;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue