Skip to content

Commit ac78e52

Browse files
committed
Create SAR writer
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
1 parent c6319d1 commit ac78e52

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

data/result-exporter/nc-exporter/src/main/java/com/powsybl/openrao/data/raoresult/nc/NcExporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public void exportData(RaoResult raoResult, CracCreationContext cracCreationCont
4444
rootRdfElement.appendChild(header);
4545

4646
new RemedialActionScheduleProfileExporter().addWholeProfile(document, rootRdfElement, header, raoResult, ncCracCreationContext);
47+
new SecurityAnalysisResultProfileWriter().addWholeProfile(document, rootRdfElement, header, raoResult, ncCracCreationContext);
4748

4849
writeOutputXmlFile(document, outputStream);
4950
} else {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.powsybl.openrao.data.raoresult.nc;
2+
3+
import com.powsybl.openrao.data.cracio.csaprofiles.craccreator.CsaProfileCracCreationContext;
4+
import com.powsybl.openrao.data.raoresultapi.RaoResult;
5+
import org.w3c.dom.Document;
6+
import org.w3c.dom.Element;
7+
8+
public class SecurityAnalysisResultProfileWriter implements NcProfileWriter {
9+
@Override
10+
public String getKeyword() {
11+
return "SAR";
12+
}
13+
14+
@Override
15+
public void addProfileContent(Document document, Element rootRdfElement, RaoResult raoResult, CsaProfileCracCreationContext ncCracCreationContext) {
16+
17+
}
18+
}

data/result-exporter/nc-exporter/src/test/java/com/powsybl/openrao/data/raoresult/nc/NcExporterTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.mockito.Mockito;
2020

2121
import java.io.FileNotFoundException;
22-
import java.io.FileOutputStream;
2322
import java.io.OutputStream;
2423
import java.time.OffsetDateTime;
2524
import java.time.ZoneOffset;
@@ -129,7 +128,7 @@ void exportRasProfile() throws FileNotFoundException {
129128
Mockito.when(ncContext.getTimeStamp()).thenReturn(OffsetDateTime.of(2024, 10, 10, 14, 42, 0, 0, ZoneOffset.UTC));
130129
Mockito.when(ncContext.getCrac()).thenReturn(crac);
131130
Mockito.when(ncContext.getInstantApplicationTimeMap()).thenReturn(Map.of(preventiveInstant, 0, curative1Instant, 600, curative2Instant, 1200));
132-
OutputStream outputStream = new FileOutputStream("RAS.xml");
131+
OutputStream outputStream = null; // new FileOutputStream("RAS.xml");
133132
new NcExporter().exportData(raoResult, ncContext, null, outputStream);
134133
}
135134
}

0 commit comments

Comments
 (0)