Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a new parameter to unify SLD and NAD colors #112

Merged
merged 7 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ SvgAndMetadata generateSvgAndMetadata(UUID networkUuid, String variantId, String
svgParameters.setLabelDiagonal(diagParams.isDiagonalLabel());
svgParameters.setUseName(diagParams.isUseName());
svgParameters.setLanguageTag(diagParams.getLanguage());
svgParameters.setUnifyVoltageLevelColors(true);
LayoutParameters layoutParameters = new LayoutParameters(LAYOUT_PARAMETERS);

SldParameters sldParameters = new SldParameters();
Expand All @@ -120,8 +121,8 @@ SvgAndMetadata generateSvgAndMetadata(UUID networkUuid, String variantId, String
sldParameters.setSubstationLayoutFactory(substationLayoutFactory);
sldParameters.setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactory);
sldParameters.setLayoutParameters(layoutParameters);
sldParameters.setStyleProviderFactory(n -> diagParams.isTopologicalColoring() ?
new StyleProvidersList(new TopologicalStyleProvider(network), new HighlightLineStateStyleProvider(network)) :
sldParameters.setStyleProviderFactory((n, s) -> diagParams.isTopologicalColoring() ?
new StyleProvidersList(new TopologicalStyleProvider(network, svgParameters), new HighlightLineStateStyleProvider(network)) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems strange to use network and svgParameters instead of n and s the parameters of the provider factory here. Maybe it will be the same objects, but seems incorrect.

new StyleProvidersList(new NominalVoltageStyleProvider(), new HighlightLineStateStyleProvider(network)));
sldParameters.setComponentLibrary(compLibrary);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public void testPositionDiagramLabelProvider() throws IOException {
assertFalse(feederInfos1.get(0).getLeftLabel().isPresent());
assertFalse(feederInfos1.get(1).getLeftLabel().isPresent());
sldParameters.setLabelProviderFactory((a, b, c, d) -> new PositionDiagramLabelProvider(testNetwork, componentLibrary, layoutParameters, svgParameters, "vl1"));
sldParameters.setStyleProviderFactory(n -> new NominalVoltageStyleProvider());
sldParameters.setStyleProviderFactory((n, s) -> new NominalVoltageStyleProvider());
sldParameters.setComponentLibrary(componentLibrary);
sldParameters.setLayoutParameters(layoutParameters);

Expand Down
Loading