Skip to content

Commit

Permalink
reorder val declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickoswald committed Feb 12, 2018
1 parent 6f1379e commit 24005eb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions GridLAB-D/src/main/scala/ch/ninecode/gl/TransformerSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ case class TransformerSet (transformers: Array[TData])
case _
}

// get the transformer name (of the parallel transformers)
val transformer_name: String =
{
val n = transformers.map (_.transformer.id).map (valid_config_name).sortWith (_ < _).mkString ("_")
if (n.getBytes.length > 63)
"_" + Math.abs (n.hashCode()) + "_" + n.substring (0, n.indexOf ("_", 32)) + "_etc"
else
n
}

// primary and secondary voltage should be the same on all edges - use the first
val v0: Double =
{
Expand Down Expand Up @@ -84,16 +94,6 @@ case class TransformerSet (transformers: Array[TData])
n
}

// get the transformer name (of the parallel transformers)
val transformer_name: String =
{
val n = transformers.map (_.transformer.id).map (valid_config_name).sortWith (_ < _).mkString ("_")
if (n.getBytes.length > 63)
"_" + Math.abs (n.hashCode()) + "_" + n.substring (0, n.indexOf ("_", 32)) + "_etc"
else
n
}

// rated power is the sum of the powers - use low voltage side, but high voltage side is the same for simple transformer
val power_rating: Double = transformers.foldLeft (0.0) ((sum, edge) => sum + edge.end1.ratedS)

Expand Down

0 comments on commit 24005eb

Please sign in to comment.