Skip to content

Commit

Permalink
Override default parameters for CGMES
Browse files Browse the repository at this point in the history
Signed-off-by: BOUHOURS Antoine <[email protected]>
  • Loading branch information
antoinebhs committed Mar 26, 2024
1 parent 648e2e1 commit d09d5e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public class NetworkConversionService {

private static final String IMPORT_TYPE_REPORT = "ImportNetwork";

public static final Map<String, Object> DEFAULT_IMPORT_PARAMETERS_OVERRIDE = Map.of("iidm.import.cgmes.cgm-with-subnetworks", false);

private RestTemplate caseServerRest;

private RestTemplate geoDataServerRest;
Expand Down Expand Up @@ -346,7 +348,9 @@ ImportExportFormatMeta getCaseImportParameters(UUID caseUuid) {
List<ParamMeta> paramsMeta = importer.getParameters()
.stream()
.filter(pp -> pp.getScope().equals(ParameterScope.FUNCTIONAL))
.map(pp -> new ParamMeta(pp.getName(), pp.getType(), pp.getDescription(), pp.getDefaultValue(), pp.getPossibleValues()))
.map(pp -> new ParamMeta(pp.getName(), pp.getType(), pp.getDescription(),
DEFAULT_IMPORT_PARAMETERS_OVERRIDE.getOrDefault(pp.getName(), pp.getDefaultValue()),
pp.getPossibleValues()))
.collect(Collectors.toList());
return new ImportExportFormatMeta(caseInfos.getFormat(), paramsMeta);
}
Expand Down

0 comments on commit d09d5e8

Please sign in to comment.