Skip to content

Commit

Permalink
NE-342: fix CIMEdges for cim17 (PhotoVoltaicUnit instead of SolarGene…
Browse files Browse the repository at this point in the history
…ratingUnit)
  • Loading branch information
junm committed Mar 22, 2021
1 parent 8161138 commit 15a60a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CIMReader/src/main/scala/ch/ninecode/cim/CIMEdges.scala
Expand Up @@ -217,10 +217,10 @@ class CIMEdges (spark: SparkSession, storage: StorageLevel)
do_equipment(o.asInstanceOf[ProtectionEquipment].Equipment)
case Some(o) if o.getClass == classOf[CurrentRelay] =>
do_equipment(o.asInstanceOf[CurrentRelay].ProtectionEquipment.Equipment)
case Some(o) if o.getClass == classOf[SolarGeneratingUnit] =>
val sgu = o.asInstanceOf[SolarGeneratingUnit]
bucket.power = sgu.GeneratingUnit.ratedNetMaxP
do_equipment(sgu.GeneratingUnit.Equipment)
case Some(o) if o.getClass == classOf[PhotoVoltaicUnit] =>
val pvu = o.asInstanceOf[PhotoVoltaicUnit]
bucket.power = pvu.PowerElectronicsUnit.maxP
do_equipment(pvu.PowerElectronicsUnit.Equipment)
case Some(o) if o.getClass == classOf[UsagePoint] =>
val up = o.asInstanceOf[UsagePoint]
bucket.voltage = up.nominalServiceVoltage.toString
Expand Down Expand Up @@ -430,14 +430,14 @@ class CIMEdges (spark: SparkSession, storage: StorageLevel)
val topologicals = getOrElse[TopologicalNode].keyBy(_.id)
val topo1 = asseted_edges.keyBy(_._1.cn_1).leftOuterJoin(topologicals).values.map(x => (x._1._1, x._1._2, x._1._3, x._2))
val topo2 = topo1.keyBy(_._1.cn_2).leftOuterJoin(topologicals).values.map(x => (x._1._1, x._1._2, x._1._3, x._1._4, x._2))
val edges = topo2.map(topo_edge_op)
val edges: RDD[TopoEdge] = topo2.map(topo_edge_op)

// persist and expose it
put(edges, "Edges", true)
}
else
{
val edges = asseted_edges.map(edge_op)
val edges: RDD[PostEdge] = asseted_edges.map(edge_op)

// persist and expose it
put(edges, "Edges", true)
Expand Down

0 comments on commit 15a60a2

Please sign in to comment.