Skip to content

Commit 90341df

Browse files
committed
feat: LDEPF used COMPAS-LNodeStatus of Source LDevice and LN instead of Mod.stVal for sources consideration, closes #514, RSR-1243
Signed-off-by: Samir Romdhani <[email protected]>
1 parent cb36862 commit 90341df

7 files changed

+25
-29
lines changed

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/ExtRefEditorService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private static boolean doesIcdHeaderMatchLDEPFChannel(IEDAdapter iedAdapter, TCh
147147
*/
148148
private Optional<LDeviceAdapter> getActiveSourceLDeviceByLDEPFChannel(IEDAdapter iedAdapter, TChannel channel) {
149149
return ldeviceService.findLdevice(iedAdapter.getCurrentElem(), channel.getLDInst())
150-
.filter(tlDevice -> ldeviceService.getLdeviceStatus(tlDevice).map(ActiveStatus.ON::equals).orElse(false))
150+
.filter(tlDevice -> PrivateUtils.extractStringPrivate(tlDevice.getLN0(), COMPAS_LNODE_STATUS).map(status -> status.equals(ActiveStatus.ON.getValue())).orElse(false))
151151
.map(tlDevice -> new LDeviceAdapter(iedAdapter, tlDevice));
152152
}
153153

@@ -165,9 +165,7 @@ private static Optional<AbstractLNAdapter<?>> getActiveLNSourceByLDEPFChannel(LD
165165
&& lnAdapter.getLNInst().equals(channel.getLNInst())
166166
&& trimToEmpty(channel.getLNPrefix()).equals(trimToEmpty(lnAdapter.getPrefix())))
167167
.findFirst()
168-
.filter(lnAdapter -> lnAdapter.getDaiModStValValue()
169-
.map(status -> status.equals(ActiveStatus.ON.getValue()))
170-
.orElse(true));
168+
.filter(abstractLNAdapter -> PrivateUtils.extractStringPrivate(abstractLNAdapter.getCurrentElem(), COMPAS_LNODE_STATUS).map(status -> status.equals(ActiveStatus.ON.getValue())).orElse(true));
171169
}
172170

173171
/**

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_dataTypeTemplateValid.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<!-- SPDX-FileCopyrightText: 2023 RTE FRANCE -->
2+
<!-- SPDX-FileCopyrightText: 2023 2024 2025 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
55
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
@@ -92,13 +92,15 @@
9292
</LDevice>
9393
<LDevice inst="LDTM1" ldName="IED_NAME1LDTM1">
9494
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
95+
<Private type="COMPAS-LNodeStatus">on</Private>
9596
<DOI name="Mod">
9697
<DAI name="stVal">
9798
<Val>on</Val>
9899
</DAI>
99100
</DOI>
100101
</LN0>
101102
<LN lnClass="TVTR" inst="11" prefix="U01A" lnType="TVTR_ID1">
103+
<Private type="COMPAS-LNodeStatus">on</Private>
102104
</LN>
103105
</LDevice>
104106
</Server>

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extref_with_IedType_BCU.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<!-- SPDX-FileCopyrightText: 2023 RTE FRANCE -->
2+
<!-- SPDX-FileCopyrightText: 2023 2024 2025 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
55
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
@@ -103,6 +103,7 @@
103103
</LDevice>
104104
<LDevice inst="LDPX" ldName="IED_NAME1LDPX">
105105
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
106+
<Private type="COMPAS-LNodeStatus">on</Private>
106107
<DOI name="Mod">
107108
<DAI name="stVal">
108109
<Val>on</Val>
@@ -112,15 +113,12 @@
112113
<LN lnClass="PTRC" inst="0" lnType="PTRC_ID1">
113114
</LN>
114115
<LN lnClass="PTRC" inst="2" lnType="PTRC_ID1">
115-
<DOI name="Mod">
116-
<DAI name="stVal">
117-
<Val>off</Val>
118-
</DAI>
119-
</DOI>
116+
<Private type="COMPAS-LNodeStatus">off</Private>
120117
</LN>
121118
</LDevice>
122119
<LDevice inst="LDPXINVALID" ldName="IED_NAME1LDPX">
123120
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
121+
<Private type="COMPAS-LNodeStatus">off</Private>
124122
<DOI name="Mod">
125123
<DAI name="stVal">
126124
<Val>off</Val>

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<!-- SPDX-FileCopyrightText: 2023 RTE FRANCE -->
2+
<!-- SPDX-FileCopyrightText: 2023 2024 2025 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
55
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
@@ -91,6 +91,7 @@
9191
</LDevice>
9292
<LDevice inst="LDPX" ldName="IED_NAME1LDPX">
9393
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
94+
<Private type="COMPAS-LNodeStatus">on</Private>
9495
<DOI name="Mod">
9596
<DAI name="stVal">
9697
<Val>on</Val>
@@ -99,13 +100,10 @@
99100
</LN0>
100101
<LN lnClass="PTRC" inst="0" lnType="PTRC_ID1">
101102
<!-- If not exist it considered active by default -->
102-
<!-- <DOI name="Mod">-->
103-
<!-- <DAI name="stVal">-->
104-
<!-- <Val>on</Val>-->
105-
<!-- </DAI>-->
106-
<!-- </DOI>-->
103+
<!-- <Private type="COMPAS-LNodeStatus">on</Private>-->
107104
</LN>
108105
<LN lnClass="PTRC" inst="2" lnType="PTRC_ID1">
106+
<Private type="COMPAS-LNodeStatus">off</Private>
109107
<DOI name="Mod">
110108
<DAI name="stVal">
111109
<Val>off</Val>
@@ -115,6 +113,7 @@
115113
</LDevice>
116114
<LDevice inst="LDEVICE_INVALID" ldName="IED_NAME1LDPX">
117115
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
116+
<Private type="COMPAS-LNodeStatus">off</Private>
118117
<DOI name="Mod">
119118
<DAI name="stVal">
120119
<Val>off</Val>
@@ -154,6 +153,7 @@
154153
</LDevice>
155154
<LDevice inst="LDPX" ldName="IED_NAME2LDPX">
156155
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
156+
<Private type="COMPAS-LNodeStatus">on</Private>
157157
<DOI name="Mod">
158158
<DAI name="stVal">
159159
<Val>on</Val>
@@ -162,11 +162,7 @@
162162
</LN0>
163163
<LN lnClass="PTRC" inst="0" lnType="PTRC_ID1">
164164
<!-- If not exist it considered active by default -->
165-
<!-- <DOI name="Mod">-->
166-
<!-- <DAI name="stVal">-->
167-
<!-- <Val>on</Val>-->
168-
<!-- </DAI>-->
169-
<!-- </DOI>-->
165+
<!-- <Private type="COMPAS-LNodeStatus">on</Private> -->
170166
</LN>
171167
</LDevice>
172168
</Server>
@@ -199,20 +195,16 @@
199195
</LDevice>
200196
<LDevice inst="LDPX" ldName="IED_NAME3LDPX">
201197
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
198+
<Private type="COMPAS-LNodeStatus">on</Private>
202199
<DOI name="Mod">
203200
<DAI name="stVal">
204201
<Val>on</Val>
205202
</DAI>
206203
</DOI>
207-
208204
</LN0>
209205
<LN lnClass="PTRC" inst="0" lnType="PTRC_ID1">
210206
<!-- If not exist it considered active by default -->
211-
<!-- <DOI name="Mod">-->
212-
<!-- <DAI name="stVal">-->
213-
<!-- <Val>on</Val>-->
214-
<!-- </DAI>-->
215-
<!-- </DOI>-->
207+
<!-- <Private type="COMPAS-LNodeStatus">on</Private> -->
216208
</LN>
217209
</LDevice>
218210
</Server>

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<!-- SPDX-FileCopyrightText: 2023 RTE FRANCE -->
2+
<!-- SPDX-FileCopyrightText: 2023 2024 2025 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
55
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
@@ -38,6 +38,7 @@
3838
</LDevice>
3939
<LDevice inst="LDPX" ldName="IED_NAME1LDPX">
4040
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
41+
<Private type="COMPAS-LNodeStatus">on</Private>
4142
<DOI name="Mod">
4243
<DAI name="stVal">
4344
<Val>on</Val>
@@ -124,6 +125,7 @@
124125
</LDevice>
125126
<LDevice inst="LDPX" ldName="IED_NAME2LDPX">
126127
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
128+
<Private type="COMPAS-LNodeStatus">on</Private>
127129
<DOI name="Mod">
128130
<DAI name="stVal">
129131
<Val>on</Val>
@@ -163,6 +165,7 @@
163165
</LDevice>
164166
<LDevice inst="LDPX" ldName="IED_NAME2LDPX">
165167
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
168+
<Private type="COMPAS-LNodeStatus">on</Private>
166169
<DOI name="Mod">
167170
<DAI name="stVal">
168171
<Val>on</Val>

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_processing_external_bind.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
<Authentication/>
148148
<LDevice inst="LDPX" ldName="IED_NAME2LDPX">
149149
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
150+
<Private type="COMPAS-LNodeStatus">on</Private>
150151
<DOI name="Mod">
151152
<DAI name="stVal">
152153
<Val>on</Val>

sct-commons/src/test/resources/scd-ldepf/scd_ldepf_processing_internal_bind.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
</LDevice>
143143
<LDevice inst="LDPX" ldName="IED_NAME1LDPX">
144144
<LN0 lnClass="LLN0" inst="" lnType="LLN0_ID1">
145+
<Private type="COMPAS-LNodeStatus">on</Private>
145146
<DOI name="Mod">
146147
<DAI name="stVal">
147148
<Val>on</Val>
@@ -151,6 +152,7 @@
151152
<LN lnClass="PTRC" inst="0" lnType="PTRC_ID1">
152153
</LN>
153154
<LN lnClass="PTRC" inst="2" lnType="PTRC_ID1">
155+
<Private type="COMPAS-LNodeStatus">off</Private>
154156
<DOI name="Mod">
155157
<DAI name="stVal">
156158
<Val>off</Val>

0 commit comments

Comments
 (0)