Skip to content

Commit

Permalink
Merge pull request #389 from com-pas/feat/rsr-979_update_epf
Browse files Browse the repository at this point in the history
Update xsd (epf)
  • Loading branch information
samirromdhani authored Apr 17, 2024
2 parents 452bbe1 + d7e7dfe commit c413ac7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.lfenergy.compas.sct.commons.dto.*;
import org.lfenergy.compas.sct.commons.exception.ScdException;
import org.lfenergy.compas.sct.commons.model.epf.EPF;
import org.lfenergy.compas.sct.commons.model.epf.TCBscopeType;
import org.lfenergy.compas.sct.commons.model.epf.TCBScopeType;
import org.lfenergy.compas.sct.commons.model.epf.TChannel;
import org.lfenergy.compas.sct.commons.model.epf.TChannelType;
import org.lfenergy.compas.sct.commons.scl.ExtRefService;
Expand Down Expand Up @@ -65,9 +65,9 @@ public class ExtRefEditorService implements ExtRefEditor {
*/
private static List<TIED> getIedSources(SclRootAdapter sclRootAdapter, TCompasBay compasBay, TChannel channel) {
return sclRootAdapter.streamIEDAdapters()
.filter(iedAdapter -> (channel.getBayScope().equals(TCBscopeType.BAY_EXTERNAL)
.filter(iedAdapter -> (channel.getBayScope().equals(TCBScopeType.BAY_EXTERNAL)
&& iedAdapter.getPrivateCompasBay().stream().noneMatch(bay -> bay.getUUID().equals(compasBay.getUUID())))
|| (channel.getBayScope().equals(TCBscopeType.BAY_INTERNAL)
|| (channel.getBayScope().equals(TCBScopeType.BAY_INTERNAL)
&& iedAdapter.getPrivateCompasBay().stream().anyMatch(bay -> bay.getUUID().equals(compasBay.getUUID()))))
.filter(iedAdapter -> doesIcdHeaderMatchLDEPFChannel(iedAdapter, channel))
.filter(iedAdapter -> getActiveSourceLDeviceByLDEPFChannel(iedAdapter, channel)
Expand Down
22 changes: 11 additions & 11 deletions sct-commons/src/main/resources/xsd/LDEPF.xsd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2023 RTE FRANCE
SPDX-FileCopyrightText: 2023 2024 RTE FRANCE
SPDX-License-Identifier: Apache-2.0
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.rte-france.com"
targetNamespace="http://www.rte-france.com" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="1">
<xs:schema xmlns="http://www.rte-france.com/epf"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.rte-france.com/epf" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1">

<xs:element name="EPF">
<xs:complexType>
Expand All @@ -26,10 +26,10 @@ SPDX-License-Identifier: Apache-2.0
</xs:element>

<xs:complexType name="tHitem" mixed="true">
<xs:attribute name="version" type="xs:normalizedString" use="required"/>
<xs:attribute name="when" type="xs:normalizedString" use="required"/>
<xs:attribute name="who" type="xs:normalizedString"/>
<xs:attribute name="what" type="xs:normalizedString"/>
<xs:attribute name="Version" type="xs:normalizedString" use="required"/>
<xs:attribute name="When" type="xs:normalizedString" use="required"/>
<xs:attribute name="Who" type="xs:normalizedString"/>
<xs:attribute name="What" type="xs:normalizedString"/>
</xs:complexType>

<xs:element name="Version" >
Expand All @@ -53,7 +53,7 @@ SPDX-License-Identifier: Apache-2.0
</xs:element>

<xs:complexType name="tChannel">
<xs:attribute name="BayScope" type="tCBscopeType" use="required"/>
<xs:attribute name="BayScope" type="tCBScopeType" use="required"/>
<xs:attribute name="ChannelType" type="tChannelType" use="optional"/>
<xs:attribute name="ChannelLongLabel" type="xs:string" use="optional"/>
<xs:attribute name="IEDType" type="xs:string" use="optional"/>
Expand All @@ -74,12 +74,12 @@ SPDX-License-Identifier: Apache-2.0
<xs:attribute name="SDOName" type="xs:string" use="optional"/>
<xs:attribute name="DAName" type="xs:string" use="optional"/>
<xs:attribute name="BDAName" type="xs:string" use="optional"/>
<xs:attribute name="sBDAName" type="xs:string" use="optional"/>
<xs:attribute name="SBDAName" type="xs:string" use="optional"/>
<xs:attribute name="ChannelNum" type="xs:string" use="optional"/>
<xs:attribute name="Opt" type="tOpt" use="optional"/>
</xs:complexType>

<xs:simpleType name="tCBscopeType">
<xs:simpleType name="tCBScopeType">
<xs:restriction base="xs:string">
<xs:enumeration value="BAY_EXTERNAL"/>
<xs:enumeration value="BAY_INTERNAL"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void manageBindingForLDEPF_whenFlowKindIsInternalAndAllExtRefInSameBay_should_re
//Given
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml");
TChannel channel = new TChannel();
channel.setBayScope(TCBscopeType.BAY_INTERNAL);
channel.setBayScope(TCBScopeType.BAY_INTERNAL);
channel.setChannelType(TChannelType.DIGITAL);
channel.setChannelNum("1");
channel.setChannelShortLabel("MR.PX1");
Expand Down Expand Up @@ -286,7 +286,7 @@ void manageBindingForLDEPF_when_internalBindingMatchEPFChannel_should_update_suc
// Given
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extref_with_IedType_BCU.xml");
TChannel channel = new TChannel();
channel.setBayScope(TCBscopeType.BAY_INTERNAL);
channel.setBayScope(TCBScopeType.BAY_INTERNAL);
channel.setChannelType(TChannelType.DIGITAL);
channel.setChannelNum("1");
channel.setChannelShortLabel("MR.PX1");
Expand Down Expand Up @@ -349,7 +349,7 @@ void manageBindingForLDEPF_when_manyIedSourceFound_should_return_reportMassages(
//Given
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml");
TChannel channel = new TChannel();
channel.setBayScope(TCBscopeType.BAY_INTERNAL);
channel.setBayScope(TCBScopeType.BAY_INTERNAL);
channel.setChannelType(TChannelType.DIGITAL);
channel.setChannelNum("1");
channel.setChannelShortLabel("MR.PX1");
Expand Down Expand Up @@ -410,7 +410,7 @@ void manageBindingForLDEPF_when_extRefMatchFlowKindInternalOrExternal_should_upd
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_dataTypeTemplateValid.xml");

TChannel analogueChannel1WithBayInternalScope = new TChannel();
analogueChannel1WithBayInternalScope.setBayScope(TCBscopeType.BAY_INTERNAL);
analogueChannel1WithBayInternalScope.setBayScope(TCBScopeType.BAY_INTERNAL);
analogueChannel1WithBayInternalScope.setChannelType(TChannelType.ANALOG);
analogueChannel1WithBayInternalScope.setChannelNum("1");
analogueChannel1WithBayInternalScope.setChannelShortLabel("V0");
Expand All @@ -431,7 +431,7 @@ void manageBindingForLDEPF_when_extRefMatchFlowKindInternalOrExternal_should_upd
analogueChannel1WithBayInternalScope.setBDAName("i");

TChannel analogueChannel10WithBayExternalBayScope = new TChannel();
analogueChannel10WithBayExternalBayScope.setBayScope(TCBscopeType.BAY_EXTERNAL);
analogueChannel10WithBayExternalBayScope.setBayScope(TCBScopeType.BAY_EXTERNAL);
analogueChannel10WithBayExternalBayScope.setChannelType(TChannelType.ANALOG);
analogueChannel10WithBayExternalBayScope.setChannelNum("10");
analogueChannel10WithBayExternalBayScope.setChannelShortLabel("U101");
Expand Down Expand Up @@ -505,7 +505,7 @@ void manageBindingForLDEPF_when_DOI_Mod_and_DAI_stVal_notExists_should_precede()
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_withoutModStValInLN0.xml");
// When
TChannel channel = new TChannel();
channel.setBayScope(TCBscopeType.BAY_INTERNAL);
channel.setBayScope(TCBScopeType.BAY_INTERNAL);
channel.setChannelType(TChannelType.DIGITAL);
channel.setChannelNum("1");
channel.setChannelShortLabel("MR.PX1");
Expand Down Expand Up @@ -545,7 +545,7 @@ void manageBindingForLDEPF_when_LDEPF_NotActive_should_precede() {
//Given
SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_with_inactive_ldevice_ldepf.xml");
TChannel channel = new TChannel();
channel.setBayScope(TCBscopeType.BAY_INTERNAL);
channel.setBayScope(TCBScopeType.BAY_INTERNAL);
channel.setChannelType(TChannelType.DIGITAL);
channel.setChannelNum("1");
channel.setChannelShortLabel("MR.PX1");
Expand Down

0 comments on commit c413ac7

Please sign in to comment.