Skip to content

Commit

Permalink
Update to new powsybl release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkleiven committed Oct 3, 2023
1 parent 80ac0dd commit 6dad01d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-starter</artifactId>
<version>2023.2.4</version>
<version>2023.3.0</version>
</dependency>

<dependency>
Expand Down
8 changes: 5 additions & 3 deletions src/main/ApiUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.powsybl.loadflow.LoadFlowParameters
import com.powsybl.loadflow.json.JsonLoadFlowParameters
import com.powsybl.nad.NetworkAreaDiagram
import com.powsybl.sld.SingleLineDiagram
import com.powsybl.sld.SldParameters
import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.http.content.*
import java.io.ByteArrayInputStream
Expand Down Expand Up @@ -113,13 +114,14 @@ fun singleLineDiagram(type: DiagramType, name: String, network: Network): String

// Declare a writer for metadata
val metaDataWriter = StringWriter()
val sldParams = SldParameters()
when (type) {
DiagramType.VoltageLevel -> {
SingleLineDiagram.drawVoltageLevel(network, name, svgWriter, metaDataWriter)
SingleLineDiagram.drawVoltageLevel(network, name, svgWriter, metaDataWriter, sldParams)
}

DiagramType.Substation -> {
SingleLineDiagram.drawSubstation(network, name, svgWriter, metaDataWriter)
SingleLineDiagram.drawSubstation(network, name, svgWriter, metaDataWriter, sldParams)
}

DiagramType.Generic -> {
Expand All @@ -131,7 +133,7 @@ fun singleLineDiagram(type: DiagramType, name: String, network: Network): String

fun networkDiagram(network: Network): String {
val svgWriter = StringWriter()
NetworkAreaDiagram(network).draw(svgWriter)
NetworkAreaDiagram.draw(network, svgWriter)
return svgWriter.toString()
}

Expand Down

0 comments on commit 6dad01d

Please sign in to comment.