-
Notifications
You must be signed in to change notification settings - Fork 43
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
Geographical and ControlArea persistence #1983
Conversation
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: Luma <zamarrenolm@aia.es>
private void addIidmMappingsControlArea(Network network) { | ||
CgmesControlAreas cgmesControlAreas = network.getExtension(CgmesControlAreas.class); | ||
if (cgmesControlAreas == null) { | ||
network.newExtension(CgmesControlAreasAdder.class).add(); | ||
cgmesControlAreas = network.getExtension(CgmesControlAreas.class); | ||
String cgmesControlAreaId = CgmesExportUtil.getUniqueId(); | ||
cgmesControlAreas.newCgmesControlArea() | ||
.setId(cgmesControlAreaId) | ||
.setName("Network") | ||
.setEnergyIdentificationCodeEic("Network--1") | ||
.add(); | ||
CgmesControlArea cgmesControlArea = cgmesControlAreas.getCgmesControlArea(cgmesControlAreaId); | ||
for (DanglingLine danglingLine : network.getDanglingLines()) { | ||
cgmesControlArea.add(danglingLine.getTerminal()); | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why you're adding Control areas here? I don't think it is needed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CGMES export was creating a "default" control area if none was defined in the input files, or the Network came from IIDM.
Instead of only writing it in the export module, we also keep it in the CGMES-IIDM mappings, as we are doing for the rest of information produced. The export module will write what is found in the CGMES-IIDM mapping data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thank you for your answer
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
The original Id of the Geographical and Subgeographical Regions are not preserved in the export to CGMES.
What is the new behavior (if this is a feature change)?
Keep the Id of the Geographical and Subgeographical Regions if it exists, or create a new Id to use for all network exports.