From 64e1908dd2a61bf92faec948ac32e92d23f3c3cc Mon Sep 17 00:00:00 2001 From: Samir Romdhani Date: Thu, 13 Apr 2023 18:07:04 +0200 Subject: [PATCH] Disturbances and faults recording - Setting of LDEPF LDevices part II : binding Extref #256 Signed-off-by: Samir Romdhani LDEPF part II : binding Extref [WIP] add tests Signed-off-by: Samir Romdhani LDEPF part II : binding ExtRef, fix isDigitalMatchDesc and isAnalogMatchDesc BiPredicate #256 Signed-off-by: Samir Romdhani added review notes --- .../compas/sct/commons/dto/ExtRefInfo.java | 9 + .../compas/sct/commons/dto/LDEPFSettings.java | 25 -- .../commons/dto/LDEPFSettingsSupplier.java | 131 +++++++ .../compas/sct/commons/scl/ExtRefService.java | 63 +++- .../compas/sct/commons/scl/SclService.java | 2 +- .../sct/commons/scl/ied/IEDAdapter.java | 39 +- .../sct/commons/util/CommonConstants.java | 3 + .../commons/util/SettingLDEPFCsvHelper.java | 50 ++- .../dto/LDEPFSettingsSupplierTest.java | 339 ++++++++++++++++++ .../sct/commons/dto/LDEPFSettingsTest.java | 29 -- .../sct/commons/scl/ExtRefServiceTest.java | 94 ++++- .../sct/commons/scl/ied/IEDAdapterTest.java | 72 +++- .../src/test/resources/LDEPF_Setting_file.csv | 324 ++++++++--------- .../scd_ldepf_extref_with_BCU_BPU.xml | 163 +++++++++ .../scd-ldepf/scd_ldepf_extrefbayRef.xml | 126 +++++++ .../scd_ldepf_iedSources_in_different_bay.xml | 187 ++++++++++ .../scd_ldepf_manyIedSources_in_same_bay.xml | 112 ++++++ 17 files changed, 1517 insertions(+), 251 deletions(-) delete mode 100644 sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettings.java create mode 100644 sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplier.java create mode 100644 sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplierTest.java delete mode 100644 sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsTest.java create mode 100644 sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extref_with_BCU_BPU.xml create mode 100644 sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extrefbayRef.xml create mode 100644 sct-commons/src/test/resources/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml create mode 100644 sct-commons/src/test/resources/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/ExtRefInfo.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/ExtRefInfo.java index 867c2fc17..1ed007267 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/ExtRefInfo.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/ExtRefInfo.java @@ -6,6 +6,7 @@ import lombok.*; +import org.lfenergy.compas.scl2007b4.model.TCompasBay; import org.lfenergy.compas.scl2007b4.model.TExtRef; import org.lfenergy.compas.scl2007b4.model.TFCDA; /** @@ -91,4 +92,12 @@ public boolean checkMatchingFCDA(@NonNull TFCDA tfcda){ return fcdaInfo.checkFCDACompatibilitiesForBinding(fcdaOfBinding); } + /** + * ExtRef and related Bay model + * @param iedName The name of the IED containing bay + * @param compasBay The Bay object + * @param extRef The ExtRef object + */ + public record ExtRefBayReference(String iedName, TCompasBay compasBay, TExtRef extRef){ } + } diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettings.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettings.java deleted file mode 100644 index 67ceec6c4..000000000 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettings.java +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: 2023 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.commons.dto; - -import java.util.List; - -/** - * Represents a list of LDEPF settings - * This is a functional interface whose functional method is getLDEPFSettings - * the type of the input to the operation - * - * @param the type of the result of the LDEPFSettings - * - * @see org.lfenergy.compas.sct.commons.util.SettingLDEPFCsvHelper - */ -@FunctionalInterface -public interface LDEPFSettings { - - /** - * This method provides list of LDEPF settings - */ - List getSettings(); -} diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplier.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplier.java new file mode 100644 index 000000000..bc74c7817 --- /dev/null +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplier.java @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: 2023 RTE FRANCE +// +// SPDX-License-Identifier: Apache-2.0 + +package org.lfenergy.compas.sct.commons.dto; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; +import java.util.function.*; + +import lombok.Builder; +import org.apache.commons.lang3.StringUtils; +import org.lfenergy.compas.scl2007b4.model.*; +import org.lfenergy.compas.sct.commons.exception.ScdException; +import org.lfenergy.compas.sct.commons.scl.SclRootAdapter; +import org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter; +import org.lfenergy.compas.sct.commons.scl.ied.IEDAdapter; +import org.lfenergy.compas.sct.commons.scl.ied.LDeviceAdapter; +import org.lfenergy.compas.sct.commons.util.LDeviceStatus; +import org.lfenergy.compas.sct.commons.util.Utils; + + +/** + * Represents a list of LDEPF settings + * + * This is a functional interface whose functional method is @getSettings + */ +@FunctionalInterface +public interface LDEPFSettingsSupplier { + + /** + * This method provides list of LDEPF settings + */ + List getSettings(); + + @Builder + record LDEPFSetting(String rteIedType, String iedRedundancy, BigInteger iedInstance, + String channelShortLabel, String channelMREP, String channelLevModQ, + String channelLevModLevMod, String bapVariant, String bapIgnoredValue, + String ldInst, String lnPrefix, String lnClass, String lnInst, + String doName, String doInst, String sdoName, + String daName, String daType, + String dabType, String bdaName, String sbdaName, + String channelAnalogNum, String channelDigitalNum, String opt) { + } + + BiPredicate isAnalogMatchDesc = (setting, extRef) -> + setting.channelAnalogNum() != null && setting.channelDigitalNum() == null + && extRef.getDesc().startsWith("DYN_LDEPF_ANALOG CHANNEL " + setting.channelAnalogNum()+"_1_AnalogueValue") + && extRef.getDesc().endsWith("_" + setting.daName() + "_1"); + BiPredicate isDigitalMatchDesc = (setting, extRef) -> + setting.channelDigitalNum() != null && setting.channelAnalogNum() == null + && extRef.getDesc().startsWith("DYN_LDEPF_DIGITAL CHANNEL " + setting.channelDigitalNum()+"_1_BOOLEEN") + && extRef.getDesc().endsWith("_" + setting.daName() + "_1"); + + + BiPredicate isIcdHeaderMatch = (iedAdapter, setting) -> iedAdapter.getCompasICDHeader() + .map(compasICDHeader -> compasICDHeader.getIEDType().value().equals(setting.rteIedType()) + && compasICDHeader.getIEDredundancy().value().equals(setting.iedRedundancy()) + && compasICDHeader.getIEDSystemVersioninstance().equals(setting.iedInstance())) + .orElse(false); + + BiFunction> getActiveSourceLDevice = (iedAdapter, setting) -> + iedAdapter.findLDeviceAdapterByLdInst(setting.ldInst()) + .filter(lDeviceAdapter -> lDeviceAdapter.getLDeviceStatus() + .map(status -> status.equals(LDeviceStatus.ON)) + .orElse(false)) + .stream().findFirst(); + + BiFunction>> getActiveLNodeSource = (lDeviceAdapter, setting) -> + lDeviceAdapter.getLNAdaptersIncludingLN0().stream() + .filter(lnAdapter -> lnAdapter.getLNClass().equals(setting.lnClass()) + && lnAdapter.getLNInst().equals(setting.lnInst()) + && Utils.equalsOrBothBlank(setting.lnPrefix(), lnAdapter.getPrefix())) + .findFirst() + .filter(lnAdapter -> lnAdapter.getDaiModStValValue() + .map(status -> status.equals(LDeviceStatus.ON)) + .orElse(true)); + + BiPredicate, LDEPFSetting> isValidDataTypeTemplate = (lnAdapter, setting) -> { + String doName = setting.doInst() == null || setting.doInst().equals("0") ? setting.doName() : setting.doName()+setting.doInst(); + var lnType = lnAdapter.getLnType(); + return StringUtils.isEmpty(doName) || StringUtils.isEmpty(setting.daName()) || + lnAdapter.getDataTypeTemplateAdapter().getLNodeTypeAdapterById(lnType) + .filter(lNodeTypeAdapter -> { + try { + lNodeTypeAdapter.check(new DoTypeName(doName), new DaTypeName(setting.daName())); + } catch (ScdException ex) { + return false; + } + return true; + }).isPresent(); + }; + + /** + * Provides the matching setting for an ExtRef. + * @param extRef The ExtRef object + * @return the matching LDEPFSetting for an ExtRef + */ + default Optional getLDEPFSettingMatchingExtRef(TExtRef extRef) { + if(!extRef.isSetDesc()) return Optional.empty(); + return getSettings().stream() + .filter(setting -> isAnalogMatchDesc.or(isDigitalMatchDesc).test(setting, extRef)) + .filter(setting -> extRef.isSetPLN() && Utils.lnClassEquals(extRef.getPLN(), setting.lnClass()) + && extRef.isSetPDO() && extRef.getPDO().equals(setting.doName())) + .findFirst(); + } + + /** + * Provides the IED sources that belong to the LDEPF setting
+ * Example of this setting include: + * 1. COMPAS-Bay and COMPAS-ICDHeader verification.
+ * 2. Active LDevice source object with the same DO/DA hierarchy as the LDEPF setting. + * @param sclRootAdapter SCL + * @param compasBay TCompasBay + * @param setting LDEPFSetting + * @return the IED sources matching the LDEPFSetting + */ + default List getIedSources(SclRootAdapter sclRootAdapter, TCompasBay compasBay, LDEPFSetting setting) { + return sclRootAdapter.streamIEDAdapters() + .filter(iedAdapter -> iedAdapter.getPrivateCompasBay().filter(bay -> bay.getUUID().equals(compasBay.getUUID())).isPresent()) + .filter(iedAdapter -> isIcdHeaderMatch.test(iedAdapter, setting)) + .filter(iedAdapter -> getActiveSourceLDevice.apply(iedAdapter, setting) + .filter(lDeviceAdapter -> getActiveLNodeSource.apply(lDeviceAdapter, setting) + .filter(lnAdapter -> isValidDataTypeTemplate.test(lnAdapter, setting)).isPresent()) + .isPresent()) + .map(IEDAdapter::getCurrentElem).limit(2).toList(); + } + +} diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ExtRefService.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ExtRefService.java index e581ef34d..2c895d675 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ExtRefService.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ExtRefService.java @@ -5,18 +5,12 @@ package org.lfenergy.compas.sct.commons.scl; import org.apache.commons.lang3.StringUtils; -import org.lfenergy.compas.scl2007b4.model.SCL; -import org.lfenergy.compas.scl2007b4.model.TCompasICDHeader; -import org.lfenergy.compas.scl2007b4.model.TExtRef; -import org.lfenergy.compas.scl2007b4.model.TIED; -import org.lfenergy.compas.sct.commons.dto.ControlBlockNetworkSettings; -import org.lfenergy.compas.sct.commons.dto.SclReport; -import org.lfenergy.compas.sct.commons.dto.SclReportItem; +import org.lfenergy.compas.scl2007b4.model.*; +import org.lfenergy.compas.sct.commons.dto.*; +import org.lfenergy.compas.sct.commons.dto.LDEPFSettingsSupplier.LDEPFSetting; +import org.lfenergy.compas.sct.commons.dto.ExtRefInfo.ExtRefBayReference; import org.lfenergy.compas.sct.commons.exception.ScdException; -import org.lfenergy.compas.sct.commons.scl.ied.ControlBlockAdapter; -import org.lfenergy.compas.sct.commons.scl.ied.IEDAdapter; -import org.lfenergy.compas.sct.commons.scl.ied.LDeviceAdapter; -import org.lfenergy.compas.sct.commons.scl.ied.LN0Adapter; +import org.lfenergy.compas.sct.commons.scl.ied.*; import org.lfenergy.compas.sct.commons.util.ControlBlockEnum; import org.lfenergy.compas.sct.commons.util.PrivateEnum; import org.lfenergy.compas.sct.commons.util.Utils; @@ -27,6 +21,7 @@ import java.util.stream.Stream; import static org.lfenergy.compas.sct.commons.dto.ControlBlockNetworkSettings.*; +import static org.lfenergy.compas.sct.commons.util.CommonConstants.IED_TEST_NAME; import static org.lfenergy.compas.sct.commons.util.Utils.isExtRefFeedBySameControlBlock; public final class ExtRefService { @@ -245,4 +240,50 @@ public static List filterDuplicatedExtRefs(List tExtRefs) { }); return filteredList; } + + + /** + * ExtRef Binding For LDevice (inst=LDEPF) that matching LDEPF configuration + * @param scd SCL + * @param settingsSupplier LDEPFSettingsSupplier + * @return a report contains errors + */ + public static SclReport manageBindingForLDEPF(SCL scd, LDEPFSettingsSupplier settingsSupplier) { + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + List sclReportItems = new ArrayList<>(); + List extRefBayReferences = sclRootAdapter.streamIEDAdapters() + .filter(iedAdapter -> !iedAdapter.getName().equals(IED_TEST_NAME)) + .map(iedAdapter -> iedAdapter.getExtRefBayReferenceForActifLDEPF(sclReportItems)) + .flatMap(List::stream).toList(); + for (ExtRefBayReference extRefBayRef: extRefBayReferences){ + var lDPFSettingMatchingExtRef = settingsSupplier.getLDEPFSettingMatchingExtRef(extRefBayRef.extRef()); + if(lDPFSettingMatchingExtRef.isPresent()){ + List iedSources = settingsSupplier.getIedSources(sclRootAdapter, extRefBayRef.compasBay(), lDPFSettingMatchingExtRef.get()); + if(iedSources.size() != 1) { + if(iedSources.size() > 1) { + sclReportItems.add(SclReportItem.warning(null, "There is more than one IED source to bind the signal " + + "/IED@name="+extRefBayRef.iedName()+"/LDevice@inst=LDEPF/LN0" + + "/ExtRef@desc="+extRefBayRef.extRef().getDesc())); + } + continue; + } + updateLDEPFExtRefBinding(extRefBayRef.extRef(), iedSources.get(0), lDPFSettingMatchingExtRef.get()); + } + } + return new SclReport(sclRootAdapter, sclReportItems); + } + + private static void updateLDEPFExtRefBinding(TExtRef extRef, TIED iedSource, LDEPFSetting setting) { + extRef.setIedName(iedSource.getName()); + extRef.setLdInst(setting.ldInst()); + extRef.getLnClass().add(setting.lnClass()); + extRef.setLnInst(setting.lnInst()); + if(setting.lnPrefix() != null){ + extRef.setPrefix(setting.lnPrefix()); + } + var doName = setting.doInst().equals("0") ? setting.doName() : setting.doName()+setting.doInst() ; + extRef.setDoName(doName); + + } + } diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclService.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclService.java index 506bbb55c..b271f5adf 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclService.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclService.java @@ -25,6 +25,7 @@ import java.util.stream.Collectors; import static org.lfenergy.compas.sct.commons.util.CommonConstants.ICD_SYSTEM_VERSION_UUID; +import static org.lfenergy.compas.sct.commons.util.CommonConstants.IED_TEST_NAME; import static org.lfenergy.compas.sct.commons.util.PrivateEnum.COMPAS_ICDHEADER; /** @@ -80,7 +81,6 @@ public class SclService { private static final String UNKNOWN_LDEVICE_S_IN_IED_S = "Unknown LDevice (%s) in IED (%s)"; private static final String INVALID_OR_MISSING_ATTRIBUTES_IN_EXT_REF_BINDING_INFO = "Invalid or missing attributes in ExtRef binding info"; - private static final String IED_TEST_NAME = "IEDTEST"; private SclService() { throw new IllegalStateException("SclService class"); diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapter.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapter.java index 7fa193582..68b541783 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapter.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapter.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; import org.lfenergy.compas.scl2007b4.model.*; import org.lfenergy.compas.sct.commons.dto.ExtRefBindingInfo; +import org.lfenergy.compas.sct.commons.dto.ExtRefInfo.ExtRefBayReference; import org.lfenergy.compas.sct.commons.dto.ExtRefSignalInfo; import org.lfenergy.compas.sct.commons.dto.SclReportItem; import org.lfenergy.compas.sct.commons.exception.ScdException; @@ -15,14 +16,16 @@ import org.lfenergy.compas.sct.commons.scl.PrivateService; import org.lfenergy.compas.sct.commons.scl.SclElementAdapter; import org.lfenergy.compas.sct.commons.scl.SclRootAdapter; -import org.lfenergy.compas.sct.commons.util.MonitoringLnClassEnum; -import org.lfenergy.compas.sct.commons.util.ServicesConfigEnum; -import org.lfenergy.compas.sct.commons.util.Utils; +import org.lfenergy.compas.sct.commons.util.*; import java.util.*; import java.util.function.Function; import java.util.stream.Stream; +import static org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter.MOD_DO_TYPE_NAME; +import static org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter.STVAL_DA_TYPE_NAME; +import static org.lfenergy.compas.sct.commons.util.CommonConstants.LDEVICE_LDEPF; + /** * A representation of the model object * {@link org.lfenergy.compas.scl2007b4.model.TIED IED}. @@ -414,5 +417,35 @@ private List retrieveAllExtRefForServiceType(TServiceType tServiceType) .toList(); } + /** + * Provides a list of ExtRef and associated Bay
+ * - The location of ExtRef should be in an active LDevice (inst=LDEPF)
+ * - ExtRef that lacks Bay or ICDHeader Private is not returned
+ * @param sclReportItems List of SclReportItem + * @return list of ExtRef and associated Bay + */ + public List getExtRefBayReferenceForActifLDEPF(final List sclReportItems) { + return findLDeviceAdapterByLdInst(LDEVICE_LDEPF) + .filter(lDeviceAdapter -> { + if(getPrivateCompasBay().isEmpty()) { + sclReportItems.add(SclReportItem.fatal(getXPath(), "The IED has no Private Bay")); + if(getCompasICDHeader().isEmpty()) { + sclReportItems.add(SclReportItem.fatal(getXPath(), "The IED has no Private compas:ICDHeader")); + } + return false; + } + if(lDeviceAdapter.getLDeviceStatus().isEmpty()) { + sclReportItems.add(SclReportItem.fatal(getXPath(), + "There is no DOI@name="+MOD_DO_TYPE_NAME+"/DAI@name="+STVAL_DA_TYPE_NAME + "/Val for LDevice@inst"+LDEVICE_LDEPF)); + return false; + } + return lDeviceAdapter.getLDeviceStatus().get().equals(LDeviceStatus.ON); + }) + .map(lDeviceAdapter -> lDeviceAdapter.getLN0Adapter() + .getInputsAdapter().getCurrentElem().getExtRef().stream() + .map(extRef -> new ExtRefBayReference(getName(), getPrivateCompasBay().get(), extRef)) + .toList()) + .stream().flatMap(List::stream).toList(); + } } diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/CommonConstants.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/CommonConstants.java index e125f7af4..c41cbb4ab 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/CommonConstants.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/CommonConstants.java @@ -22,6 +22,9 @@ public final class CommonConstants { public static final String CONTROLBLOCK_NAME_PREFIX = "CB" + ATTRIBUTE_VALUE_SEPARATOR; public static final String DATASET_NAME_PREFIX = "DS" + ATTRIBUTE_VALUE_SEPARATOR; + public static final String LDEVICE_LDEPF = "LDEPF"; + public static final String IED_TEST_NAME = "IEDTEST"; + /** * Private Controlller, should not be instanced */ diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/SettingLDEPFCsvHelper.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/SettingLDEPFCsvHelper.java index ee4c36817..ed421bcf1 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/SettingLDEPFCsvHelper.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/SettingLDEPFCsvHelper.java @@ -5,11 +5,13 @@ package org.lfenergy.compas.sct.commons.util; import com.opencsv.bean.CsvBindByPosition; -import lombok.ToString; -import org.lfenergy.compas.sct.commons.dto.LDEPFSettings; +import lombok.Getter; +import org.lfenergy.compas.sct.commons.dto.LDEPFSettingsSupplier; import java.io.Reader; +import java.math.BigInteger; import java.util.List; +import java.util.function.Function; /** @@ -18,31 +20,59 @@ * * @see CsvUtils */ -public class SettingLDEPFCsvHelper implements LDEPFSettings { +public class SettingLDEPFCsvHelper implements LDEPFSettingsSupplier { - private final List settings ; + private final List settings ; /** * Constructor + * * @param reader input */ public SettingLDEPFCsvHelper(Reader reader) { - this.settings = CsvUtils.parseRows(reader, SettingLDEPF.class).stream().toList(); + this.settings = CsvUtils.parseRows(reader, LDEPFSettingBind.class).stream().map(lDEPFSettingsFunction).toList(); } @Override - public List getSettings() { + public List getSettings() { return this.settings; } - @ToString - public static class SettingLDEPF { + Function lDEPFSettingsFunction = (LDEPFSettingBind setting) -> LDEPFSetting.builder() + .rteIedType(setting.getRteIedType()) + .iedRedundancy(setting.getIedRedundancy()) + .iedInstance(setting.getIedInstance()) + .channelShortLabel(setting.getChannelShortLabel()) + .channelMREP(setting.getChannelMREP()) + .channelLevModQ(setting.getChannelLevModQ()) + .channelLevModLevMod(setting.getChannelLevModLevMod()) + .bapVariant(setting.getBapVariant()) + .bapIgnoredValue(setting.getBapIgnoredValue()) + .ldInst(setting.getLdInst()) + .lnPrefix(setting.getLnPrefix()) + .lnClass(setting.getLnClass()) + .lnInst(setting.getLnInst()) + .doName(setting.getDoName()) + .doInst(setting.getDoInst()) + .sdoName(setting.getSdoName()) + .daName(setting.getDaName()) + .daType(setting.getDaType()) + .dabType(setting.getDabType()) + .bdaName(setting.getBdaName()) + .sbdaName(setting.getSbdaName()) + .channelAnalogNum(setting.getChannelAnalogNum()) + .channelDigitalNum(setting.getChannelDigitalNum()) + .opt(setting.getOpt()) + .build(); + + @Getter + public static class LDEPFSettingBind { @CsvBindByPosition(position = 0) private String rteIedType; @CsvBindByPosition(position = 1) private String iedRedundancy; @CsvBindByPosition(position = 2) - private String iedInstance; + private BigInteger iedInstance; @CsvBindByPosition(position = 3) private String channelShortLabel; @CsvBindByPosition(position = 4) @@ -60,7 +90,7 @@ public static class SettingLDEPF { @CsvBindByPosition(position = 10) private String lnPrefix; @CsvBindByPosition(position = 11) - private String lnName; + private String lnClass; @CsvBindByPosition(position = 12) private String lnInst; @CsvBindByPosition(position = 13) diff --git a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplierTest.java b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplierTest.java new file mode 100644 index 000000000..87051fb97 --- /dev/null +++ b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplierTest.java @@ -0,0 +1,339 @@ +// SPDX-FileCopyrightText: 2023 RTE FRANCE +// +// SPDX-License-Identifier: Apache-2.0 + +package org.lfenergy.compas.sct.commons.dto; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EmptySource; +import org.junit.jupiter.params.provider.NullSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.lfenergy.compas.scl2007b4.model.*; +import org.lfenergy.compas.sct.commons.scl.SclElementAdapter; +import org.lfenergy.compas.sct.commons.scl.SclRootAdapter; +import org.lfenergy.compas.sct.commons.testhelpers.SclTestMarshaller; +import org.lfenergy.compas.sct.commons.util.CsvUtils; +import org.lfenergy.compas.sct.commons.util.SettingLDEPFCsvHelper; +import org.lfenergy.compas.sct.commons.dto.LDEPFSettingsSupplier.LDEPFSetting; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; + +import static org.assertj.core.api.Assertions.assertThat; + +class LDEPFSettingsSupplierTest { + + @Test + void getLDEPFSettings_should_return_settings() { + //Given + String fileName = "LDEPF_Setting_file.csv"; + InputStream inputStream = Objects.requireNonNull(CsvUtils.class.getClassLoader().getResourceAsStream(fileName) + , "Resource not found: " + fileName); + InputStreamReader reader = new InputStreamReader(inputStream); + LDEPFSettingsSupplier settingsSupplier = new SettingLDEPFCsvHelper(reader); + // When + // Then + assertThat(settingsSupplier.getSettings()).hasSize(161); + } + + @Test + void getLDPFSettingMatchingExtRef_should_return_digitalSetting_whenMatchExtRef() { + // Given + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSetting analogSetting = LDEPFSetting.builder() + .channelDigitalNum("1") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting, analogSetting); + TExtRef tExtRef = new TExtRef(); + tExtRef.setDesc("DYN_LDEPF_DIGITAL CHANNEL 10_1_BOOLEEN_Y_general_1"); + tExtRef.getPLN().add("PTRC"); + tExtRef.setPDO("Str"); + // When + var result = settingsSupplier.getLDEPFSettingMatchingExtRef(tExtRef); + // Then + assertThat(result).contains(digitalSetting); + } + + @Test + void getLDPFSettingMatchingExtRef_should_return_analogSetting_whenMatchExtRef() { + // Given + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSetting analogSetting = LDEPFSetting.builder() + .channelDigitalNum(null) + .channelAnalogNum("10") + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting, analogSetting); + TExtRef tExtRef = new TExtRef(); + tExtRef.setDesc("DYN_LDEPF_ANALOG CHANNEL 10_1_AnalogueValue_Y_general_1"); + tExtRef.getPLN().add("PTRC"); + tExtRef.setPDO("Str"); + // When + var result = settingsSupplier.getLDEPFSettingMatchingExtRef(tExtRef); + // Then + assertThat(result).contains(analogSetting); + } + + @Test + void getLDPFSettingMatchingExtRef_should_return_NoSetting_whenNotMatchExtRefDescValue() { + // Given + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSetting analogSetting = LDEPFSetting.builder() + .channelDigitalNum(null) + .channelAnalogNum("10") + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting, analogSetting); + TExtRef tExtRef = new TExtRef(); + tExtRef.setDesc("desc"); + tExtRef.getPLN().add("PTRC"); + tExtRef.setPDO("Str"); + // When + var result = settingsSupplier.getLDEPFSettingMatchingExtRef(tExtRef); + // Then + assertThat(result).isEmpty(); + } + + @Test + void getLDPFSettingMatchingExtRef_should_return_NoSetting_whenNotMatchExtRefPLNValue() { + // Given + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSetting analogSetting = LDEPFSetting.builder() + .channelDigitalNum(null) + .channelAnalogNum("10") + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting, analogSetting); + TExtRef tExtRef = new TExtRef(); + tExtRef.setDesc("DYN_LDEPF_ANALOG CHANNEL 10_1_AnalogueValue_Y_general_1"); + tExtRef.getPLN().add("TOTO"); + tExtRef.setPDO("Str"); + // When + var result = settingsSupplier.getLDEPFSettingMatchingExtRef(tExtRef); + // Then + assertThat(result).isEmpty(); + } + + @Test + void getLDPFSettingMatchingExtRef_should_return_NoSetting_when_AllSettingsNotMatchExtRefWithUnknownPDOValue() { + // Given + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSetting analogSetting = LDEPFSetting.builder() + .channelDigitalNum(null) + .channelAnalogNum("10") + .daName("general").lnClass("PTRC").doName("Str").build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting, analogSetting); + TExtRef tExtRef = new TExtRef(); + tExtRef.setDesc("DYN_LDEPF_ANALOG CHANNEL 10_1_AnalogueValue_Y_general_1"); + tExtRef.getPLN().add("PTRC"); + tExtRef.setPDO("TOTO"); + // When + var result = settingsSupplier.getLDEPFSettingMatchingExtRef(tExtRef); + // Then + assertThat(result).isEmpty(); + } + + @Test + void getIedSources_should_return_oneIedSource_whenMatchAllVerification() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + LDEPFSetting digitalSetting = LDEPFSetting.builder() + //required attributes to verify ExtRef + .channelDigitalNum("10") + .channelAnalogNum(null) + //required attributes to verify IED source for ExtRef + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + //required attributes to verify LDEVICE source for ExtRef + .ldInst("LDPX") + //required attributes to verify LNODE source for ExtRef + .lnClass("PTRC").lnInst("0").lnPrefix(null) + //required attributes to verify DO object source for ExtRef + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).hasSize(1); + assertThat(iedSources.get(0).getName()).isEqualTo("IED_NAME1"); + } + + + @Test + void getIedSources_should_return_TwoIedSources_whenTwoSourcesFoundHasTheSameBayUUID() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + .lnClass("PTRC").lnInst("0").lnPrefix(null) + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + setCompasBayUUID(sclRootAdapter, "IED_NAME2", "bayUUID1"); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).hasSize(2); + } + + @Test + void getIedSources_should_return_TwoIedSources_whenTwoSourcesFoundHasTheSameICDHeader() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + .lnClass("PTRC").lnInst("0").lnPrefix(null) + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + sclRootAdapter.getIEDAdapterByName("IED_NAME3").getCompasICDHeader().get().setIEDSystemVersioninstance(digitalSetting.iedInstance()); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).hasSize(2); + } + + @ParameterizedTest + @NullSource + @EmptySource + @ValueSource(strings = { + "NO_EXISTING_INST_OF_LDEVICE_SOURCE", + "LDEVICE_INVALID" + }) + void getIedSources_should_return_NoIedSource_whenLDevice(String ldInst) { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + //required attributes to match LDEVICE source for ExtRef + .ldInst(ldInst) + .lnClass("PTRC").lnInst("0").lnPrefix(null) + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).isEmpty(); + } + + @Test + void getIedSources_should_return_NoIedSource_whenNoExistingLNodeSource() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + var digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + //required attributes to verify LNODE source for ExtRef + .lnClass("PTRC").lnInst("100000").lnPrefix(null) + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "buyUUID1"); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).isEmpty(); + } + + + @Test + void getIedSources_should_return_NoIedSource_whenLNodeSourceIsOff() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + var digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + //required attributes to verify LNODE source for ExtRef + .lnClass("PTRC").lnInst("2").lnPrefix(null) + .doName("Str").doInst("0") + .daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).isEmpty(); + } + + + @Test + void getIedSources_should_return_NoIedSource_whenNoValidDataTypeTemplate() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + LDEPFSetting digitalSetting = LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + .lnClass("PTRC").lnInst("0").lnPrefix(null) + //required attributes to verify DO object source for ExtRef + .doName("Str").doInst("0").daName("general") + .build(); + TCompasBay compasBay = setCompasBayUUID(sclRootAdapter, "IED_NAME1", "bayUUID1"); + sclRootAdapter.getDataTypeTemplateAdapter().getLNodeTypeAdapters() + .stream() + .filter(lNodeTypeAdapter1 -> lNodeTypeAdapter1.getDOAdapterByName("Str").isPresent()) + .findFirst() + .map(SclElementAdapter::getCurrentElem).get() + .getDO().removeIf(tdo -> tdo.getName().equals("Str")); + // When + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + var iedSources = settingsSupplier.getIedSources(sclRootAdapter, compasBay, digitalSetting); + // Then + assertThat(iedSources).isEmpty(); + } + + private TCompasBay setCompasBayUUID(SclRootAdapter sclRootAdapter, String iedName, String uuid) { + TCompasBay compasBay = sclRootAdapter.getIEDAdapterByName(iedName).getPrivateCompasBay().get(); + compasBay.setUUID(uuid); + return compasBay; + } + +} \ No newline at end of file diff --git a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsTest.java b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsTest.java deleted file mode 100644 index ed5300bcc..000000000 --- a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsTest.java +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2023 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.commons.dto; - -import org.junit.jupiter.api.Test; -import org.lfenergy.compas.sct.commons.util.CsvUtils; -import org.lfenergy.compas.sct.commons.util.SettingLDEPFCsvHelper; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Objects; -import static org.assertj.core.api.Assertions.assertThat; - -class LDEPFSettingsTest { - - @Test - void getLDEPFSettings_should_return_settings() { - //Given - String fileName = "LDEPF_Setting_file.csv"; - InputStream inputStream = Objects.requireNonNull(CsvUtils.class.getClassLoader().getResourceAsStream(fileName), "Resource not found: " + fileName); - InputStreamReader reader = new InputStreamReader(inputStream); - LDEPFSettings ldepfSettings = new SettingLDEPFCsvHelper(reader); - // When - // Then - assertThat(ldepfSettings.getSettings()).hasSize(161); - } -} \ No newline at end of file diff --git a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ExtRefServiceTest.java b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ExtRefServiceTest.java index 9ccf3e0af..cefa16fe1 100644 --- a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ExtRefServiceTest.java +++ b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ExtRefServiceTest.java @@ -10,20 +10,21 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.lfenergy.compas.scl2007b4.model.*; -import org.lfenergy.compas.sct.commons.dto.ControlBlockNetworkSettings; -import org.lfenergy.compas.sct.commons.dto.ControlBlockTarget; -import org.lfenergy.compas.sct.commons.dto.SclReport; -import org.lfenergy.compas.sct.commons.dto.SclReportItem; +import org.lfenergy.compas.sct.commons.dto.*; import org.lfenergy.compas.sct.commons.exception.ScdException; import org.lfenergy.compas.sct.commons.scl.ied.DataSetAdapter; import org.lfenergy.compas.sct.commons.scl.ied.LDeviceAdapter; import org.lfenergy.compas.sct.commons.testhelpers.FCDARecord; import org.lfenergy.compas.sct.commons.testhelpers.MarshallerWrapper; import org.lfenergy.compas.sct.commons.testhelpers.SclTestMarshaller; +import org.lfenergy.compas.sct.commons.util.CsvUtils; +import org.lfenergy.compas.sct.commons.util.SettingLDEPFCsvHelper; +import java.io.InputStream; +import java.io.InputStreamReader; import java.math.BigDecimal; -import java.util.List; -import java.util.Optional; +import java.math.BigInteger; +import java.util.*; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; @@ -542,4 +543,85 @@ void filterDuplicatedExtRefs_should_not_remove_not_duplicated_extrefs() { .hasSize(6); } + @Test + void manageBindingForLDEPF_should_return_no_report_when_all_extRefInSameBay_update_successfully() { + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml"); + var digitalSetting1 = LDEPFSettingsSupplier.LDEPFSetting.builder() + .channelDigitalNum("10") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + .lnClass("PTRC").lnInst("0").lnPrefix(null) + .doName("Str").doInst("0").daName("general") + .build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting1); + // When + SclReport sclReport = ExtRefService.manageBindingForLDEPF(scd, settingsSupplier); + // Then + assertThat(sclReport.getSclReportItems()).isEmpty(); + TExtRef extRef1 = findExtRef(sclReport, "IED_NAME1", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 10_1_BOOLEEN_1_general_1"); + assertThat(extRef1.getIedName()).isEqualTo("IED_NAME1"); + assertExtRefIsBoundAccordingTOLDEPF(extRef1, digitalSetting1); + + TExtRef extRef2 = findExtRef(sclReport, "IED_NAME2", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 10_1_BOOLEEN_1_general_1"); + assertThat(extRef2.getIedName()).isEqualTo("IED_NAME2"); + assertExtRefIsBoundAccordingTOLDEPF(extRef2, digitalSetting1); + + TExtRef extRef3 = findExtRef(sclReport, "IED_NAME3", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 10_1_BOOLEEN_1_general_1"); + assertThat(extRef3.getIedName()).isEqualTo("IED_NAME1"); + assertExtRefIsBoundAccordingTOLDEPF(extRef3, digitalSetting1); + } + + @Test + void manageBindingForLDEPF_should_return_no_report_when_extRef_withIedTypeBCUOrBPU_update_successfully() { + String fileName = "LDEPF_Setting_file.csv"; + InputStream inputStream = Objects.requireNonNull(CsvUtils.class.getClassLoader().getResourceAsStream(fileName), "Resource not found: " + fileName); + InputStreamReader reader = new InputStreamReader(inputStream); + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extref_with_BCU_BPU.xml"); + LDEPFSettingsSupplier settingsSupplier = new SettingLDEPFCsvHelper(reader); + // When + SclReport sclReport = ExtRefService.manageBindingForLDEPF(scd, settingsSupplier); + // Then + assertThat(sclReport.getSclReportItems()).isEmpty(); + TExtRef extRef1 = findExtRef(sclReport, "IED_NAME1", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 1_1_BOOLEEN_1_general_1"); + assertThat(extRef1.getIedName()).isEqualTo("IED_NAME1"); + + TExtRef extRef2 = findExtRef(sclReport, "IED_NAME2", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 15_1_BOOLEEN_1_general_1"); + assertThat(extRef2.getIedName()).isEqualTo("IED_NAME2"); + } + + @Test + void manageBindingForLDEPF_should_return_report_when_manyIedSourceFound() { + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml"); + var digitalSetting = LDEPFSettingsSupplier.LDEPFSetting.builder() + .channelDigitalNum("12") + .channelAnalogNum(null) + .rteIedType("BCU").iedRedundancy("None").iedInstance(BigInteger.valueOf(1)) + .ldInst("LDPX") + .lnClass("PTRC").lnInst("0").lnPrefix(null) + .doName("Str").doInst("0").daName("general") + .build(); + LDEPFSettingsSupplier settingsSupplier = () -> List.of(digitalSetting); + // When + SclReport sclReport = ExtRefService.manageBindingForLDEPF(scd, settingsSupplier); + // Then + assertThat(sclReport.getSclReportItems()).hasSize(2); + assertThat(sclReport.getSclReportItems()) + .extracting(SclReportItem::getMessage) + .isEqualTo(List.of("There is more than one IED source to bind the signal /IED@name=IED_NAME1/LDevice@inst=LDEPF/LN0/ExtRef@desc=DYN_LDEPF_DIGITAL CHANNEL 12_1_BOOLEEN_1_general_1", + "There is more than one IED source to bind the signal /IED@name=IED_NAME2/LDevice@inst=LDEPF/LN0/ExtRef@desc=DYN_LDEPF_DIGITAL CHANNEL 12_1_BOOLEEN_1_general_1")); + TExtRef extRef1 = findExtRef(sclReport, "IED_NAME1", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 12_1_BOOLEEN_1_general_1"); + assertThat(extRef1.isSetIedName()).isFalse(); + TExtRef extRef2 = findExtRef(sclReport, "IED_NAME2", "LDEPF", "DYN_LDEPF_DIGITAL CHANNEL 12_1_BOOLEEN_1_general_1"); + assertThat(extRef2.isSetIedName()).isFalse(); + } + + private void assertExtRefIsBoundAccordingTOLDEPF(TExtRef extRef, LDEPFSettingsSupplier.LDEPFSetting setting) { + assertThat(extRef.getLdInst()).isEqualTo(setting.ldInst()); + assertThat(extRef.getLnClass()).contains(setting.lnClass()); + assertThat(extRef.getLnInst()).isEqualTo(setting.lnInst()); + assertThat(extRef.getPrefix()).isEqualTo(setting.lnPrefix()); + assertThat(extRef.getDoName()).isEqualTo(setting.doName()); + } + } diff --git a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapterTest.java b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapterTest.java index a24685dd6..701797d93 100644 --- a/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapterTest.java +++ b/sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/ied/IEDAdapterTest.java @@ -10,6 +10,7 @@ import org.junit.jupiter.params.provider.MethodSource; import org.lfenergy.compas.scl2007b4.model.*; import org.lfenergy.compas.sct.commons.dto.DTO; +import org.lfenergy.compas.sct.commons.dto.ExtRefInfo.ExtRefBayReference; import org.lfenergy.compas.sct.commons.dto.ExtRefSignalInfo; import org.lfenergy.compas.sct.commons.dto.SclReportItem; import org.lfenergy.compas.sct.commons.exception.ScdException; @@ -20,16 +21,16 @@ import org.lfenergy.compas.sct.commons.util.MonitoringLnClassEnum; import org.mockito.Mockito; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.*; +import static org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter.MOD_DO_TYPE_NAME; +import static org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter.STVAL_DA_TYPE_NAME; import static org.lfenergy.compas.sct.commons.testhelpers.SclHelper.*; +import static org.lfenergy.compas.sct.commons.util.CommonConstants.LDEVICE_LDEPF; import static org.mockito.Mockito.mock; class IEDAdapterTest { @@ -419,6 +420,69 @@ void manageMonitoringLns_should_update_ln_when_2_extRef_and_dai_updatable(String .containsExactly("LD_Name/LLN0.CB_Name_1", "LD_Name/LLN0.CB_Name_2"); } + @Test + void getExtRefBuyReferenceForActifLDEPF_should_return_existingExtRef_when_LDEPF_active_and_bay_exists() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extrefbayRef.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + IEDAdapter iedAdapter = sclRootAdapter.getIEDAdapterByName("IED_NAME1"); + // When + List sclReportItems = new ArrayList<>(); + List extRefBayReferences = iedAdapter.getExtRefBayReferenceForActifLDEPF(sclReportItems); + // Then + assertThat(extRefBayReferences).hasSize(1); + assertThat(sclReportItems).isEmpty(); + } + + @Test + void getExtRefBayReferenceForActifLDEPF_should_return_fatal_errors_when_NoPrivateBuyNorIcdHeader() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extrefbayRef.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + IEDAdapter iedAdapter = sclRootAdapter.getIEDAdapterByName("IED_NAME1"); + iedAdapter.getCurrentElem().getPrivate().clear(); + // When + List sclReportItems = new ArrayList<>(); + List extRefBayReferences = iedAdapter.getExtRefBayReferenceForActifLDEPF(sclReportItems); + // Then + assertThat(extRefBayReferences).isEmpty(); + assertThat(sclReportItems).hasSize(2); + assertThat(sclReportItems) + .extracting(SclReportItem::getMessage) + .contains("The IED has no Private Bay", "The IED has no Private compas:ICDHeader"); + } + + @Test + void getExtRefBayReferenceForActifLDEPF_should_return_fatal_errors_when_DOI_Mod_notExists() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extrefbayRef.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + IEDAdapter iedAdapter = sclRootAdapter.getIEDAdapterByName("IED_NAME3"); + // When + List sclReportItems = new ArrayList<>(); + List extRefBayReferences = iedAdapter.getExtRefBayReferenceForActifLDEPF(sclReportItems); + // Then + assertThat(extRefBayReferences).isEmpty(); + assertThat(sclReportItems).hasSize(1); + assertThat(sclReportItems) + .extracting(SclReportItem::getMessage) + .containsExactly("There is no DOI@name="+MOD_DO_TYPE_NAME+"/DAI@name="+STVAL_DA_TYPE_NAME + "/Val for LDevice@inst"+LDEVICE_LDEPF); + } + + @Test + void getExtRefBayReferenceForActifLDEPF_should_return_existingExtRef_when_LDEPF_NotActive() { + // Given + SCL scd = SclTestMarshaller.getSCLFromFile("/scd-ldepf/scd_ldepf_extrefbayRef.xml"); + SclRootAdapter sclRootAdapter = new SclRootAdapter(scd); + IEDAdapter iedAdapter = sclRootAdapter.getIEDAdapterByName("IED_NAME2"); + // When + List sclReportItems = new ArrayList<>(); + List extRefBayReferences = iedAdapter.getExtRefBayReferenceForActifLDEPF(sclReportItems); + // Then + assertThat(extRefBayReferences).isEmpty(); + assertThat(sclReportItems).isEmpty(); + } + private static Stream provideLnClassAndDoType() { return Stream.of( Arguments.of("Case GOOSE : ln LGOS", MonitoringLnClassEnum.LGOS, DO_GOCBREF, TServiceType.GOOSE), diff --git a/sct-commons/src/test/resources/LDEPF_Setting_file.csv b/sct-commons/src/test/resources/LDEPF_Setting_file.csv index 4f3f5d981..63d49fb48 100644 --- a/sct-commons/src/test/resources/LDEPF_Setting_file.csv +++ b/sct-commons/src/test/resources/LDEPF_Setting_file.csv @@ -2,165 +2,165 @@ # # SPDX-License-Identifier: Apache-2.0 -#RTE-IEDType,IED.redundancy,IED.instance,Channel.ShortLabel,Channel.MREP,Channel.LevMod.q,Channel.LevMod,BAP.Variant,BAP.Ignored Value,LD.inst,LN.prefix,LN.name,LN.inst,DO.name,DO.inst,SDO.name,DA.name,DA.type,DA.bType,BDA.name,SBDA.name,Channel.Analog.num,Channel.Digital.num,Opt -BCU,None,1,MR.PX1,X,Other,Positive or Rising,8,N/A,LDPX,,PTRC,0,Str,0,,general,,BOOLEAN,,,,1,P0 -BCU,None,1,DT.PX1,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,general,,BOOLEAN,,,,2,P0 -BCU,None,1,MR.PX1.ZONE 1,,??,Other,NA,N/A,LDPX,,PDIS,1,Op,0,,general,,BOOLEAN,,,,3,P1 -BCU,None,1,MR.PX1.ZONE 2,,??,Other,NA,N/A,LDPX,,PDIS,2,Op,0,,general,,BOOLEAN,,,,4,P1 -BCU,None,1,MR.PX1.ZONE 3,,??,Other,NA,N/A,LDPX,,PDIS,3,Op,0,,general,,BOOLEAN,,,,5,P1 -BCU,None,1,MR.PX1.ZONE 4,,??,Other,NA,N/A,LDPX,,PDIS,4,Op,0,,general,,BOOLEAN,,,,6,P2 -BCU,None,1,MR.PX1.ZONE 5,,??,Other,NA,N/A,LDPX,,PDIS,5,Op,0,,general,,BOOLEAN,,,,7,P2 -BCU,None,1,MR.PX1.ZONE 6,,??,Other,NA,N/A,LDPX,,PDIS,6,Op,0,,general,,BOOLEAN,,,,8,P2 -BCU,None,1,MR.PX1.TERRE,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,neut,,BOOLEAN,,,,9,P0 -BCU,None,1,DT.PX1.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsA,,BOOLEAN,,,,10,P0 -BCU,None,1,DT.PX1.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsB,,BOOLEAN,,,,11,P0 -BCU,None,1,DT.PX1.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsC,,BOOLEAN,,,,12,P0 -BCU,None,1,MR.PX1.AMONT,,??,Other,NA,N/A,LDPX,,PTRC,0,Str,0,,dirGeneral,,BOOLEAN,,,,13,P0 -BCU,None,1,MR.PX1.AVAL,,??,Other,NA,N/A,LDPX,,,,,,,,,,,,,14,P0 -BPU,None,1,MR.PX2,X,Other,Positive or Rising,8,N/A,LDPX,,PTRC,0,Str,0,,general,,BOOLEAN,,,,15,P0 -BPU,None,1,DT.PX2,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,general,,BOOLEAN,,,,16,P0 -BPU,None,1,MR.PX2.ZONE 1,,??,Other,NA,N/A,LDPX,,PDIS,1,Op,0,,general,,BOOLEAN,,,,17,P1 -BPU,None,1,MR.PX2.ZONE 2,,??,Other,NA,N/A,LDPX,,PDIS,2,Op,0,,general,,BOOLEAN,,,,18,P1 -BPU,None,1,MR.PX2.ZONE 3,,??,Other,NA,N/A,LDPX,,PDIS,3,Op,0,,general,,BOOLEAN,,,,19,P1 -BPU,None,1,MR.PX2.ZONE 4,,??,Other,NA,N/A,LDPX,,PDIS,4,Op,0,,general,,BOOLEAN,,,,20,P2 -BPU,None,1,MR.PX2.ZONE 5,,??,Other,NA,N/A,LDPX,,PDIS,5,Op,0,,general,,BOOLEAN,,,,21,P2 -BPU,None,1,MR.PX2.ZONE 6,,??,Other,NA,N/A,LDPX,,PDIS,6,Op,0,,general,,BOOLEAN,,,,22,P2 -BPU,None,1,MR.PX2.TERRE,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,neut,,BOOLEAN,,,,23,P0 -BPU,None,1,DT.PX2.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsA,,BOOLEAN,,,,24,P0 -BPU,None,1,DT.PX2.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsB,,BOOLEAN,,,,25,P0 -BPU,None,1,DT.PX2.PHASE *,,??,Other,NA,N/A,LDPX,,PTRC,0,Op,0,,phsC,,BOOLEAN,,,,26,P0 -BPU,None,1,MR.PX2.AMONT,,??,Other,NA,N/A,LDPX,,PTRC,0,Str,0,,dirGeneral,,BOOLEAN,,,,27,P0 -BPU,None,1,MR.PX2.AVAL,,??,Other,NA,N/A,LDPX,,PTRC,0,,,,,,,,,,28,P0 -BCU,None,1,REC.ACCx.Vy,X,Other,Positive or Rising,8,N/A,LDPX,,PSCH,0,,,,,,,,,,29,P0 -BCU,None,1,REC.AUTx.Vy,X,Other,Positive or Rising,8,N/A,LDPX,,PSCH,0,,,,,,,,,,30,P0 -BCU,None,1,REC.VERx.Vy,X,Other,Positive or Rising,8,N/A,LDPX,,PSCH,0,,,,,,,,,,31,P0 -BCU,None,1,EMI.ACCx.Vy,,??,Other,NA,N/A,LDPX,,PSCH,0,TxPrm,0,,general,,BOOLEAN,,,,32,P0 -BCU,None,1,EMI.AUTx.Vy,,??,Other,NA,N/A,LDPX,,PSCH,0,TxPrm,0,,general,,BOOLEAN,,,,33,P0 -BCU,None,1,EMI.VERx.Vy,,??,Other,NA,N/A,LDPX,,PSCH,0,TxBlk,0,,general,,BOOLEAN,,,,34,P0 -BCU,None,1,MR.PW,X,Other,Positive or Rising,8,N/A,LDPW,,PTRC,0,Str,0,,general,,BOOLEAN,,,,35,P0 -BCU,None,1,MR.PW.AMONT,,??,Other,NA,N/A,LDPW,,PTRC,0,Str,0,,dirGeneral,,BOOLEAN,,,,36,P1 -BCU,None,1,DT.PW,,??,Other,NA,N/A,LDPW,,PTRC,0,Op,0,,general,,BOOLEAN,,,,37,P0 -BCU,None,1,MR.PCDH,X,Other,Positive or Rising,8,N/A,LDPCDH,,PTRC,0,Str,0,,general,,BOOLEAN,,,,38,P0 -BCU,None,1,EMI.AUT.PCDH,,??,Other,NA,N/A,LDPCDH,,PTRC,0,Op,0,,general,,BOOLEAN,,,,39,P0 -BCU,None,1,EMI.TD.PCDH,,??,Other,NA,N/A,LDPCDH,,PSCH,0,TxPrm,0,,general,,BOOLEAN,,,,40,P0 -BCU,None,1,REC.AUT.PCDH,X,Other,Positive or Rising,8,N/A,LDPCDH,,PSCH,0,,,,,,,,,,41,P0 -BCU,None,1,MR.PAP1,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Str,0,,general,,BOOLEAN,,,,42,P0 -BCU,None,1,DT.PAP1,,??,Other,NA,N/A,LDPAP,,PTRC,0,Op,0,,general,,BOOLEAN,,,,43,P0 -BCU,None,1,MR.PAP1.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsA,,BOOLEAN,,,,44,P1 -BCU,None,1,MR.PAP1.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsB,,BOOLEAN,,,,45,P1 -BCU,None,1,MR.PAP1.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsC,,BOOLEAN,,,,46,P1 -BCU,None,1,DT.PAP1.IR,,??,Other,NA,N/A,LDPAP,,PTOC,1,Op,0,,general,,BOOLEAN,,,,47,P1 -BCU,None,1,REC.TDPAP1,X,Other,Positive or Rising,8,N/A,LDTDEC,,PSCH,0,RxTr,0,,general,,BOOLEAN,,,,48,P0 -BCU,None,1,EMI.TDPAP1,,??,Other,NA,N/A,LDTDEC,,PSCH,0,TxTr,0,,general,,BOOLEAN,,,,49,P0 -BCU,None,1,MR.PAP2,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Str,0,,general,,BOOLEAN,,,,50,P0 -BCU,None,1,DT.PAP2,,??,Other,NA,N/A,LDPAP,,PTRC,0,Op,0,,general,,BOOLEAN,,,,51,P0 -BCU,None,1,MR.PAP2.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsA,,BOOLEAN,,,,52,P1 -BCU,None,1,MR.PAP2.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsB,,BOOLEAN,,,,53,P1 -BCU,None,1,MR.PAP2.PHASE *,X,Other,Positive or Rising,8,N/A,LDPAP,,PTRC,0,Op,0,,phsC,,BOOLEAN,,,,54,P1 -BCU,None,1,DT.PAP2.IR,,??,Other,NA,N/A,LDPAP,,PTOC,1,Op,0,,general,,BOOLEAN,,,,55,P1 -PDL1,None,1,MR.PDL1,X,Other,Positive or Rising,8,N/A,LDDIFL,,PTRC,0,Str,0,,general,,BOOLEAN,,,,56,P1 -PDL1,None,1,DT.PDL1,,??,Other,NA,N/A,LDDIFL,,PTRC,0,Op,0,,general,,BOOLEAN,,,,57,P0 -PDL1,None,1,MR.PDL1.PHASE *,,??,Other,NA,N/A,LDDIFL,,PTRC,0,Str,0,,phsA,,BOOLEAN,,,,58,P0 -PDL1,None,1,MR.PDL1.PHASE *,,??,Other,NA,N/A,LDDIFL,,PTRC,0,Str,0,,phsB,,BOOLEAN,,,,59,P0 -PDL1,None,1,MR.PDL1.PHASE *,,??,Other,NA,N/A,LDDIFL,,PTRC,0,Str,0,,phsC,,BOOLEAN,,,,60,P0 -PDL2,None,1,MR.PDL2,X,Other,Positive or Rising,8,N/A,LDDIFL,,PTRC,0,Str,0,,general,,BOOLEAN,,,,61,P1 -PDL2,None,1,DT.PDL2,,??,Other,NA,N/A,LDDIFL,,PTRC,0,Op,0,,general,,BOOLEAN,,,,62,P0 -PDL2,None,1,MR.PDL2.PHASE *,X,Other,Positive or Rising,8,N/A,LDDIFL,,PTRC,0,Str,0,,phsA,,BOOLEAN,,,,63,P0 -PDL2,None,1,MR.PDL2.PHASE *,X,Other,Positive or Rising,8,N/A,LDDIFL,,PTRC,0,Str,0,,phsB,,BOOLEAN,,,,64,P0 -PDL2,None,1,MR.PDL2.PHASE *,X,Other,Positive or Rising,8,N/A,LDDIFL,,PTRC,0,Str,0,,phsC,,BOOLEAN,,,,65,P0 -PDB,None,1,MR.PDB,X,Other,Positive or Rising,8,N/A,LDPDB,,PTRC,0,Str,0,,general,,BOOLEAN,,,,66,P0 -PDB,None,1,DT.PDB,,??,Other,NA,N/A,LDPDB,,PTRC,0,Op,0,,general,,BOOLEAN,,,,67,P0 -PDB,None,1,MR.PDB.PHASE *,,??,Other,NA,N/A,LDPDB,,PTRC,0,Str,0,,phsA,,BOOLEAN,,,,68,P1 -PDB,None,1,MR.PDB.PHASE *,,??,Other,NA,N/A,LDPDB,,PTRC,0,Str,0,,phsB,,BOOLEAN,,,,69,P1 -PDB,None,1,MR.PDB.PHASE *,,??,Other,NA,N/A,LDPDB,,PTRC,0,Str,0,,phsC,,BOOLEAN,,,,70,P1 -BCU,None,1,MR.PMC1,X,Other,Positive or Rising,8,N/A,LDPMC,,PTRC,0,Str,0,,general,,BOOLEAN,,,,71,P0 -BCU,None,1,DT.PMC1,,??,Other,NA,N/A,LDPMC,,PTRC,0,Op,0,,general,,BOOLEAN,,,,72,P0 -BCU,None,1,MR.PMC2,X,Other,Positive or Rising,8,N/A,LDPMC,,PTRC,0,Str,0,,general,,BOOLEAN,,,,73,P0 -BCU,None,1,DT.PMC2,,??,Other,NA,N/A,LDPMC,,PTRC,0,Op,0,,general,,BOOLEAN,,,,74,P0 -BCU,None,1,MR.PMC2,X,Other,Positive or Rising,8,N/A,LDPMC,,PTRC,0,Str,0,,general,,BOOLEAN,,,,75,P0 -BCU,None,1,DT.PMC2,,??,Other,NA,N/A,LDPMC,,PTRC,0,Op,0,,general,,BOOLEAN,,,,76,P0 -CFD,None,1,DET.OPT.DEF.CAB1,X,Other,Positive or Rising,8,N/A,LDDFU,,PSCH,0,Op,0,,general,,BOOLEAN,,,,77,P0 -CFD,None,1,DET.OPT.DEF.CAB2,X,Other,Positive or Rising,8,N/A,LDDFU,,PSCH,0,Op,0,,general,,BOOLEAN,,,,78,P0 -CFD,None,1,DET.OPT.DEF.CAB3,X,Other,Positive or Rising,8,N/A,LDDFU,,PSCH,0,Op,0,,general,,BOOLEAN,,,,79,P0 -BCU,None,1,DT.MAXIL1,,??,Other,NA,N/A,LDMAXIL,,PTRC,0,Op,0,,general,,BOOLEAN,,,,80,P0 -BCU,None,1,MR.MAXIL1,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTRC,0,Str,0,,general,,BOOLEAN,,,,81,P1 -BCU,None,1,MR.MAXIL1.S1P,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,1,Str,0,,general,,BOOLEAN,,,,82,P0 -BCU,None,1,MR.MAXIL1.S1T,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,2,Str,0,,general,,BOOLEAN,,,,83,P0 -BCU,None,1,MR.MAXIL1.S2P,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,3,Str,0,,general,,BOOLEAN,,,,84,P0 -BCU,None,1,DT.MAXIL2,,??,Other,NA,N/A,LDMAXIL,,PTRC,0,Op,0,,general,,BOOLEAN,,,,85,P0 -BCU,None,1,MR.MAXIL2,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTRC,0,Str,0,,general,,BOOLEAN,,,,86,P1 -BCU,None,1,MR.MAXIL2.S1P,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,1,Str,0,,general,,BOOLEAN,,,,87,P0 -BCU,None,1,MR.MAXIL2.S1T,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,2,Str,0,,general,,BOOLEAN,,,,88,P0 -BCU,None,1,MR.MAXIL2.S2P,X,Other,Positive or Rising,8,N/A,LDMAXIL,,PTOC,3,Str,0,,general,,BOOLEAN,,,,89,P0 -BCU,None,1,ADD.DEFAIL.DJ,X,Other,Positive or Rising,8,N/A,LDADD,,RBRF,0,OpEx,0,,general,,BOOLEAN,,,,90,P0 -AUT,None,1,,X,Other,Positive or Rising,8,N/A,,,,,,,,,,,,,,91,P0 -BCU,None,1,AR.ENCLT.RM,X,Other,Positive or Rising,8,N/A,LDREC,,RREC,1,OpCls,0,,general,,BOOLEAN,,,,92,P1 -BCU,None,1,AR.ENCLT.RTR,X,Other,Positive or Rising,8,N/A,LDREC,,RREC,2,OpCls,0,,general,,BOOLEAN,,,,93,P1 -BCU,None,1,AR.ENCLT.TAM,X,Other,Positive or Rising,8,N/A,LDREC,,RREC,3,OpCls,0,,general,,BOOLEAN,,,,94,P1 -BCU,None,1,AR.ENCLT.REBTAM,X,Other,Positive or Rising,8,N/A,LDREC,,RREC,4,OpCls,0,,general,,BOOLEAN,,,,95,P1 -BCU,None,1,AR.ENCLT.RT,X,Other,Positive or Rising,8,N/A,LDRS,,RREC,0,OpCls,0,,general,,BOOLEAN,,,,96,P1 -BCU,None,1,AR.ENCLT.RTS,X,Other,Positive or Rising,8,N/A,LDRTS,,RREC,0,OpCls,0,,general,,BOOLEAN,,,,97,P1 -BCU,None,1,AR.ENCLT.RTS,X,Other,Positive or Rising,8,N/A,LDAMU,,RREC,0,OpCls,0,,general,,BOOLEAN,,,,98,P1 -AUT,None,1,AR.ENCLT,X ,Other,Positive or Rising,8,N/A,LDGRP,,,,,,,,,,,,,99,P0 -BCU,None,1,BCU.FERM.DJ,X,Other,Positive or Rising,8,N/A,LDCMDDJ,,CSWI,1,OpCls,0,,general,,BOOLEAN,,,,100,P1 -BCU,None,1,BCU.OUVERT.DJ,X,Other,Positive or Rising,8,N/A,LDCMDDJ,,CSWI,1,OpOpn,0,,general,,BOOLEAN,,,,101,P1 -SCU-ORG,A,1,SCU.OUV.DJ,X,Other,Positive or Rising,8,N/A,LDDJ,,XCMD,0,OpOpn,0,,general,,BOOLEAN,,,,102,P0 -SCU-ORG,A,1,SCU.FERM.DJ,X,Other,Positive or Rising,8,N/A,LDDJ,,XCMD,0,OpCls,0,,general,,BOOLEAN,,,,103,P0 -BCU,None,1,DPHILB,,??,Other,NA,N/A,LDCMDDJ,,RSYN,1,AngInd,0,,stVal,,BOOLEAN,,,,104,P0 -BCU,None,1,DFLB,,??,Other,NA,N/A,LDCMDDJ,,RSYN,1,HzInd,0,,stVal,,BOOLEAN,,,,105,P0 -BCU,None,1,DULB,,??,Other,NA,N/A,LDCMDDJ,,RSYN,1,VInd,0,,stVal,,BOOLEAN,,,,106,P0 -BCU,None,1,PUL,,??,Other,NA,N/A,LDCMDDJ,,FXOT,1,Op,0,,general,,BOOLEAN,,,,107,P0 -BCU,None,1,PUB,,??,Other,NA,N/A,LDCMDDJ,,FXOT,2,Op,0,,general,,BOOLEAN,,,,108,P0 -BCU,None,1,AUL,,??,Other,NA,N/A,LDCMDDJ,,FXUT,1,Op,0,,general,,BOOLEAN,,,,109,P0 -BCU,None,1,AUB,,??,Other,NA,N/A,LDCMDDJ,,FXUT,2,Op,0,,general,,BOOLEAN,,,,110,P0 -BCU,None,1,CYCLE.ARS.ACTIF,,??,Other,NA,N/A,,,,,,,,,,,,,,111,P1 -BCU,None,1,MQ.U.102,X,??,Other,NA,N/A,LDMQUB1,CB00001002,FXUT,0,Op,0,,general,,BOOLEAN,,,,112,P0 -BCU,None,1,MQ.U.103,X,??,Other,NA,N/A,LDMQUB1,CB00001003,FXUT,0,Op,0,,general,,BOOLEAN,,,,113,P0 -BCU,None,1,MQ.U.104,X,??,Other,NA,N/A,LDMQUB1,CB00001004,FXUT,0,Op,0,,general,,BOOLEAN,,,,114,P0 -BCU,None,1,MQ.U.105,X,??,Other,NA,N/A,LDMQUB1,CB00001005,FXUT,0,Op,0,,general,,BOOLEAN,,,,115,P1 -BCU,None,1,MQ.U.106,X,??,Other,NA,N/A,LDMQUB1,CB00001006,FXUT,0,Op,0,,general,,BOOLEAN,,,,116,P1 -BCU,None,1,MQ.U.202,X,??,Other,NA,N/A,LDMQUB1,CB00002002,FXUT,0,Op,0,,general,,BOOLEAN,,,,117,P1 -BCU,None,1,MQ.U.101,X,??,Other,NA,N/A,LDMQUB1,CB00001001,FXUT,0,Op,0,,general,,BOOLEAN,,,,118,P0 -BCU,None,1,MQ.U.201,X,Other,Positive or Rising,8,N/A,LDMQUB1,CB00002001,FXUT,0,Op,0,,general,,BOOLEAN,,,,119,P0 -BCU,None,1,REC.TDECx.Vy,X,Other,Positive or Rising,8,N/A,LDTDEC,,PSCH,0,RxTr,0,,general,,BOOLEAN,,,,120,P0 -BCU,None,1,EMI.TDECx.Vy,,??,Other,NA,N/A,LDTDEC,,PSCH,0,TxTr,0,,general,,BOOLEAN,,,,121,P0 -BCU,None,1,REC.DESARM.ARS,X,Other,Positive or Rising,8,N/A,LDTDEC,,PSCH,0,RxTr,0,,general,,BOOLEAN,,,,122,P0 -BCU,None,1,EMI.TDECx.Vy,,??,Other,NA,N/A,LDTDEC,,PSCH,0,TxTr,0,,general,,BOOLEAN,,,,123,P0 -BCU,None,1,DT.TDEC,,??,Other,NA,N/A,LDTDEC,,PTRC,0,Op,0,,general,,BOOLEAN,,,,124,P1 -BCU,None,1,EPS.MER,X,Other,Positive or Rising,8,N/A,LDEPS,,RDRE,1,RcdStr,0,,stVal,,BOOLEAN,,,,125,P0 -BCU,None,1,PO.MER,X,Other,Positive or Rising,8,N/A,LDEPF,,RDRE,2,RcdTrg,0,,stVal,,BOOLEAN,,,,126,P0 -BCU,None,1,PRS.MER,X,Other,Positive or Rising,8,N/A,LDPRS,,PTRC,0,Str,0,,general,,BOOLEAN,,,,127,P0 -BCU,None,1,DT.PRS,,??,Other,NA,N/A,LDPRS,,PTRC,0,Op,0,,general,,BOOLEAN,,,,128,P0 -BCU,None,1,ANO.TCT.L,X,Other,Positive or Rising,8,N/A,LDSUTCT,,CALH,1,GrInd,0,,stVal,,BOOLEAN,,,,129,P0 -BCU,None,1,ANO.TCT.B,X,Other,Positive or Rising,8,N/A,LDSUTCT,,CALH,2,GrInd,0,,stVal,,BOOLEAN,,,,130,P0 -BCU,None,1,DT.SUTCT,,??,Other,NA,N/A,LDSUTCT,,PTRC,0,Op,0,,general,,BOOLEAN,,,,131,P0 -BCU,None,1,MR.PSPT,X,Other,Positive or Rising,8,N/A,LDPSPT,,PTRC,0,Str,0,,general,,BOOLEAN,,,,132,P0 -BCU,None,1,DT.PSPT,,??,Other,NA,N/A,LDPSPT,,PTRC,0,Op,0,,general,,BOOLEAN,,,,133,P0 -PDT,None,1,MR.PDT,X,Other,Positive or Rising,8,N/A,LDPDT,,PTRC,0,Str,0,,general,,BOOLEAN,,,,134,P0 -PDT,None,1,DT.PDT,,??,Other,NA,N/A,LDPDT,,PTRC,0,Op,0,,general,,BOOLEAN,,,,135,P0 -PTP,None,1,MR.PTP,X,Other,Positive or Rising,8,N/A,LDPTP,,PTRC,0,Str,0,,general,,BOOLEAN,,,,136,P0 -PTP,None,1,DT.PTP ,,??,Other,NA,N/A,LDPTP,,PTRC,0,Op,0,,general,,BOOLEAN,,,,137,P0 -PDB,None,1,MR.PDLP,X,Other,Positive or Rising,8,N/A,LDPTLP,,PTRC,0,Str,0,,general,,BOOLEAN,,,,138,P0 -PDB,None,1,DT.PDLP,,??,Other,NA,N/A,LDPDLP,,PTRC,0,Op,0,,general,,BOOLEAN,,,,139,P0 -PDB,None,1,MR.PDLC,X,Other,Positive or Rising,8,N/A,LDPDLC,,PTRC,0,Str,0,,general,,BOOLEAN,,,,140,P0 -PDB,None,1,DT.PDLC,,??,Other,NA,N/A,LDPDLC,,PTRC,0,Op,0,,general,,BOOLEAN,,,,141,P0 -BCU,None,1,MR.MAXUL,X,Other,Positive or Rising,8,N/A,LDMAXU,,PTRC,0,Str,0,,general,,BOOLEAN,,,,142,P0 -BCU,None,1,DT.MAXUL,,??,Other,NA,N/A,LDMAXU,,PTRC,0,Op,0,,general,,BOOLEAN,,,,143,P0 -SAMU,A,1,V0,,NA,NA,8,N/A,LDTM1,U01A,TVTR,11,VolSv,0,,instMag,,AnalogueValue,i,,1,,P0 -SAMU,A,1,V4,,NA,NA,8,N/A,LDTM1,U01B,TVTR,12,VolSv,0,,instMag,,AnalogueValue,i,,2,,P0 -SAMU,A,1,V8,,NA,NA,8,N/A,LDTM1,U01C,TVTR,13,VolSv,0,,instMag,,AnalogueValue,i,,3,,P0 -SAMU,A,1,J0,,NA,NA,8,N/A,LDTM1,I01A,TCTR,11,AmpSv,0,,instMag,,AnalogueValue,i,,4,,P0 -SAMU,A,1,J4,,NA,NA,8,N/A,LDTM1,I01B,TCTR,12,AmpSv,0,,instMag,,AnalogueValue,i,,5,,P0 -SAMU,A,1,.J8,,NA,NA,8,N/A,LDTM1,J01C,TCTR,13,AmpSv,0,,instMag,,AnalogueValue,i,,6,,P0 -SAMU,A,1,I0,,NA,NA,8,N/A,LDTM1,I05A,TCTR,51,AmpSv,0,,instMag,,AnalogueValue,i,,7,,P0 -SAMU,A,1,I4,,NA,NA,8,N/A,LDTM1,I05B,TCTR,52,AmpSv,0,,instMag,,AnalogueValue,i,,8,,P0 -SAMU,A,1,I8,,NA,NA,8,N/A,LDTM1,I05C,TCTR,53,AmpSv,0,,instMag,,AnalogueValue,i,,9,,P0 -SAMU,A,1,G,,NA,NA,8,N/A,LDTM1,I06N,TCTR,61,AmpSv,0,,instMag,,AnalogueValue,i,,16,,P0 -SAMU,A,1,U101,,NA,NA,8,N/A,LDPHAS1,,MMXU,101,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,10,,P0 -SAMU,A,1,U102,,NA,NA,8,N/A,LDPHAS1,,MMXU,102,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,11,,P0 -SAMU,A,1,U103,,NA,NA,8,N/A,LDPHAS1,,MMXU,103,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,12,,P0 -SAMU,A,1,U104,,NA,NA,8,N/A,LDPHAS1,,MMXU,104,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,13,,P0 -SAMU,A,1,U105,,NA,NA,8,N/A,LDPHAS1,,MMXU,105,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,14,,P0 -SAMU,A,1,U106,,NA,NA,8,N/A,LDPHAS1,,MMXU,106,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,15,,P0 -SAMU,A,1,U201,,NA,NA,8,N/A,LDPHAS1,,MMXU,201,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,14,,P0 -SAMU,A,1,U202,,NA,NA,8,N/A,LDPHAS1,,MMXU,202,PhV,0,phsA;phsB;phsC,cVal,,AnalogueValue,mag,f,15,,P0 +#RTE-IEDType;IED.redundancy;IED.instance;Channel.ShortLabel;Channel.MREP;Channel.LevMod.q;Channel.LevMod;BAP.Variant;BAP.Ignored Value;LD.inst;LN.prefix;LN.class;LN.inst;DO.name;DO.inst;SDO.name;DA.name;DA.type;DA.bType;BDA.name;SBDA.name;Channel.Analog.num;Channel.Digital.num;Opt +BCU;None;1;MR.PX1;X;Other;Positive or Rising;8;N/A;LDPX;;PTRC;0;Str;0;;general;;BOOLEAN;;;;1;P0 +BCU;None;1;DT.PX1;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;general;;BOOLEAN;;;;2;P0 +BCU;None;1;MR.PX1.ZONE 1;;??;Other;NA;N/A;LDPX;;PDIS;1;Op;0;;general;;BOOLEAN;;;;3;P1 +BCU;None;1;MR.PX1.ZONE 2;;??;Other;NA;N/A;LDPX;;PDIS;2;Op;0;;general;;BOOLEAN;;;;4;P1 +BCU;None;1;MR.PX1.ZONE 3;;??;Other;NA;N/A;LDPX;;PDIS;3;Op;0;;general;;BOOLEAN;;;;5;P1 +BCU;None;1;MR.PX1.ZONE 4;;??;Other;NA;N/A;LDPX;;PDIS;4;Op;0;;general;;BOOLEAN;;;;6;P2 +BCU;None;1;MR.PX1.ZONE 5;;??;Other;NA;N/A;LDPX;;PDIS;5;Op;0;;general;;BOOLEAN;;;;7;P2 +BCU;None;1;MR.PX1.ZONE 6;;??;Other;NA;N/A;LDPX;;PDIS;6;Op;0;;general;;BOOLEAN;;;;8;P2 +BCU;None;1;MR.PX1.TERRE;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;neut;;BOOLEAN;;;;9;P0 +BCU;None;1;DT.PX1.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsA;;BOOLEAN;;;;10;P0 +BCU;None;1;DT.PX1.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsB;;BOOLEAN;;;;11;P0 +BCU;None;1;DT.PX1.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsC;;BOOLEAN;;;;12;P0 +BCU;None;1;MR.PX1.AMONT;;??;Other;NA;N/A;LDPX;;PTRC;0;Str;0;;dirGeneral;;BOOLEAN;;;;13;P0 +BCU;None;1;MR.PX1.AVAL;;??;Other;NA;N/A;LDPX;;;;;;;;;;;;;14;P0 +BPU;None;1;MR.PX2;X;Other;Positive or Rising;8;N/A;LDPX;;PTRC;0;Str;0;;general;;BOOLEAN;;;;15;P0 +BPU;None;1;DT.PX2;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;general;;BOOLEAN;;;;16;P0 +BPU;None;1;MR.PX2.ZONE 1;;??;Other;NA;N/A;LDPX;;PDIS;1;Op;0;;general;;BOOLEAN;;;;17;P1 +BPU;None;1;MR.PX2.ZONE 2;;??;Other;NA;N/A;LDPX;;PDIS;2;Op;0;;general;;BOOLEAN;;;;18;P1 +BPU;None;1;MR.PX2.ZONE 3;;??;Other;NA;N/A;LDPX;;PDIS;3;Op;0;;general;;BOOLEAN;;;;19;P1 +BPU;None;1;MR.PX2.ZONE 4;;??;Other;NA;N/A;LDPX;;PDIS;4;Op;0;;general;;BOOLEAN;;;;20;P2 +BPU;None;1;MR.PX2.ZONE 5;;??;Other;NA;N/A;LDPX;;PDIS;5;Op;0;;general;;BOOLEAN;;;;21;P2 +BPU;None;1;MR.PX2.ZONE 6;;??;Other;NA;N/A;LDPX;;PDIS;6;Op;0;;general;;BOOLEAN;;;;22;P2 +BPU;None;1;MR.PX2.TERRE;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;neut;;BOOLEAN;;;;23;P0 +BPU;None;1;DT.PX2.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsA;;BOOLEAN;;;;24;P0 +BPU;None;1;DT.PX2.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsB;;BOOLEAN;;;;25;P0 +BPU;None;1;DT.PX2.PHASE *;;??;Other;NA;N/A;LDPX;;PTRC;0;Op;0;;phsC;;BOOLEAN;;;;26;P0 +BPU;None;1;MR.PX2.AMONT;;??;Other;NA;N/A;LDPX;;PTRC;0;Str;0;;dirGeneral;;BOOLEAN;;;;27;P0 +BPU;None;1;MR.PX2.AVAL;;??;Other;NA;N/A;LDPX;;PTRC;0;;;;;;;;;;28;P0 +BCU;None;1;REC.ACCx.Vy;X;Other;Positive or Rising;8;N/A;LDPX;;PSCH;0;;;;;;;;;;29;P0 +BCU;None;1;REC.AUTx.Vy;X;Other;Positive or Rising;8;N/A;LDPX;;PSCH;0;;;;;;;;;;30;P0 +BCU;None;1;REC.VERx.Vy;X;Other;Positive or Rising;8;N/A;LDPX;;PSCH;0;;;;;;;;;;31;P0 +BCU;None;1;EMI.ACCx.Vy;;??;Other;NA;N/A;LDPX;;PSCH;0;TxPrm;0;;general;;BOOLEAN;;;;32;P0 +BCU;None;1;EMI.AUTx.Vy;;??;Other;NA;N/A;LDPX;;PSCH;0;TxPrm;0;;general;;BOOLEAN;;;;33;P0 +BCU;None;1;EMI.VERx.Vy;;??;Other;NA;N/A;LDPX;;PSCH;0;TxBlk;0;;general;;BOOLEAN;;;;34;P0 +BCU;None;1;MR.PW;X;Other;Positive or Rising;8;N/A;LDPW;;PTRC;0;Str;0;;general;;BOOLEAN;;;;35;P0 +BCU;None;1;MR.PW.AMONT;;??;Other;NA;N/A;LDPW;;PTRC;0;Str;0;;dirGeneral;;BOOLEAN;;;;36;P1 +BCU;None;1;DT.PW;;??;Other;NA;N/A;LDPW;;PTRC;0;Op;0;;general;;BOOLEAN;;;;37;P0 +BCU;None;1;MR.PCDH;X;Other;Positive or Rising;8;N/A;LDPCDH;;PTRC;0;Str;0;;general;;BOOLEAN;;;;38;P0 +BCU;None;1;EMI.AUT.PCDH;;??;Other;NA;N/A;LDPCDH;;PTRC;0;Op;0;;general;;BOOLEAN;;;;39;P0 +BCU;None;1;EMI.TD.PCDH;;??;Other;NA;N/A;LDPCDH;;PSCH;0;TxPrm;0;;general;;BOOLEAN;;;;40;P0 +BCU;None;1;REC.AUT.PCDH;X;Other;Positive or Rising;8;N/A;LDPCDH;;PSCH;0;;;;;;;;;;41;P0 +BCU;None;1;MR.PAP1;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Str;0;;general;;BOOLEAN;;;;42;P0 +BCU;None;1;DT.PAP1;;??;Other;NA;N/A;LDPAP;;PTRC;0;Op;0;;general;;BOOLEAN;;;;43;P0 +BCU;None;1;MR.PAP1.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsA;;BOOLEAN;;;;44;P1 +BCU;None;1;MR.PAP1.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsB;;BOOLEAN;;;;45;P1 +BCU;None;1;MR.PAP1.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsC;;BOOLEAN;;;;46;P1 +BCU;None;1;DT.PAP1.IR;;??;Other;NA;N/A;LDPAP;;PTOC;1;Op;0;;general;;BOOLEAN;;;;47;P1 +BCU;None;1;REC.TDPAP1;X;Other;Positive or Rising;8;N/A;LDTDEC;;PSCH;0;RxTr;0;;general;;BOOLEAN;;;;48;P0 +BCU;None;1;EMI.TDPAP1;;??;Other;NA;N/A;LDTDEC;;PSCH;0;TxTr;0;;general;;BOOLEAN;;;;49;P0 +BCU;None;1;MR.PAP2;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Str;0;;general;;BOOLEAN;;;;50;P0 +BCU;None;1;DT.PAP2;;??;Other;NA;N/A;LDPAP;;PTRC;0;Op;0;;general;;BOOLEAN;;;;51;P0 +BCU;None;1;MR.PAP2.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsA;;BOOLEAN;;;;52;P1 +BCU;None;1;MR.PAP2.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsB;;BOOLEAN;;;;53;P1 +BCU;None;1;MR.PAP2.PHASE *;X;Other;Positive or Rising;8;N/A;LDPAP;;PTRC;0;Op;0;;phsC;;BOOLEAN;;;;54;P1 +BCU;None;1;DT.PAP2.IR;;??;Other;NA;N/A;LDPAP;;PTOC;1;Op;0;;general;;BOOLEAN;;;;55;P1 +PDL1;None;1;MR.PDL1;X;Other;Positive or Rising;8;N/A;LDDIFL;;PTRC;0;Str;0;;general;;BOOLEAN;;;;56;P1 +PDL1;None;1;DT.PDL1;;??;Other;NA;N/A;LDDIFL;;PTRC;0;Op;0;;general;;BOOLEAN;;;;57;P0 +PDL1;None;1;MR.PDL1.PHASE *;;??;Other;NA;N/A;LDDIFL;;PTRC;0;Str;0;;phsA;;BOOLEAN;;;;58;P0 +PDL1;None;1;MR.PDL1.PHASE *;;??;Other;NA;N/A;LDDIFL;;PTRC;0;Str;0;;phsB;;BOOLEAN;;;;59;P0 +PDL1;None;1;MR.PDL1.PHASE *;;??;Other;NA;N/A;LDDIFL;;PTRC;0;Str;0;;phsC;;BOOLEAN;;;;60;P0 +PDL2;None;1;MR.PDL2;X;Other;Positive or Rising;8;N/A;LDDIFL;;PTRC;0;Str;0;;general;;BOOLEAN;;;;61;P1 +PDL2;None;1;DT.PDL2;;??;Other;NA;N/A;LDDIFL;;PTRC;0;Op;0;;general;;BOOLEAN;;;;62;P0 +PDL2;None;1;MR.PDL2.PHASE *;X;Other;Positive or Rising;8;N/A;LDDIFL;;PTRC;0;Str;0;;phsA;;BOOLEAN;;;;63;P0 +PDL2;None;1;MR.PDL2.PHASE *;X;Other;Positive or Rising;8;N/A;LDDIFL;;PTRC;0;Str;0;;phsB;;BOOLEAN;;;;64;P0 +PDL2;None;1;MR.PDL2.PHASE *;X;Other;Positive or Rising;8;N/A;LDDIFL;;PTRC;0;Str;0;;phsC;;BOOLEAN;;;;65;P0 +PDB;None;1;MR.PDB;X;Other;Positive or Rising;8;N/A;LDPDB;;PTRC;0;Str;0;;general;;BOOLEAN;;;;66;P0 +PDB;None;1;DT.PDB;;??;Other;NA;N/A;LDPDB;;PTRC;0;Op;0;;general;;BOOLEAN;;;;67;P0 +PDB;None;1;MR.PDB.PHASE *;;??;Other;NA;N/A;LDPDB;;PTRC;0;Str;0;;phsA;;BOOLEAN;;;;68;P1 +PDB;None;1;MR.PDB.PHASE *;;??;Other;NA;N/A;LDPDB;;PTRC;0;Str;0;;phsB;;BOOLEAN;;;;69;P1 +PDB;None;1;MR.PDB.PHASE *;;??;Other;NA;N/A;LDPDB;;PTRC;0;Str;0;;phsC;;BOOLEAN;;;;70;P1 +BCU;None;1;MR.PMC1;X;Other;Positive or Rising;8;N/A;LDPMC;;PTRC;0;Str;0;;general;;BOOLEAN;;;;71;P0 +BCU;None;1;DT.PMC1;;??;Other;NA;N/A;LDPMC;;PTRC;0;Op;0;;general;;BOOLEAN;;;;72;P0 +BCU;None;1;MR.PMC2;X;Other;Positive or Rising;8;N/A;LDPMC;;PTRC;0;Str;0;;general;;BOOLEAN;;;;73;P0 +BCU;None;1;DT.PMC2;;??;Other;NA;N/A;LDPMC;;PTRC;0;Op;0;;general;;BOOLEAN;;;;74;P0 +BCU;None;1;MR.PMC2;X;Other;Positive or Rising;8;N/A;LDPMC;;PTRC;0;Str;0;;general;;BOOLEAN;;;;75;P0 +BCU;None;1;DT.PMC2;;??;Other;NA;N/A;LDPMC;;PTRC;0;Op;0;;general;;BOOLEAN;;;;76;P0 +CFD;None;1;DET.OPT.DEF.CAB1;X;Other;Positive or Rising;8;N/A;LDDFU;;PSCH;0;Op;0;;general;;BOOLEAN;;;;77;P0 +CFD;None;1;DET.OPT.DEF.CAB2;X;Other;Positive or Rising;8;N/A;LDDFU;;PSCH;0;Op;0;;general;;BOOLEAN;;;;78;P0 +CFD;None;1;DET.OPT.DEF.CAB3;X;Other;Positive or Rising;8;N/A;LDDFU;;PSCH;0;Op;0;;general;;BOOLEAN;;;;79;P0 +BCU;None;1;DT.MAXIL1;;??;Other;NA;N/A;LDMAXIL;;PTRC;0;Op;0;;general;;BOOLEAN;;;;80;P0 +BCU;None;1;MR.MAXIL1;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTRC;0;Str;0;;general;;BOOLEAN;;;;81;P1 +BCU;None;1;MR.MAXIL1.S1P;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;1;Str;0;;general;;BOOLEAN;;;;82;P0 +BCU;None;1;MR.MAXIL1.S1T;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;2;Str;0;;general;;BOOLEAN;;;;83;P0 +BCU;None;1;MR.MAXIL1.S2P;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;3;Str;0;;general;;BOOLEAN;;;;84;P0 +BCU;None;1;DT.MAXIL2;;??;Other;NA;N/A;LDMAXIL;;PTRC;0;Op;0;;general;;BOOLEAN;;;;85;P0 +BCU;None;1;MR.MAXIL2;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTRC;0;Str;0;;general;;BOOLEAN;;;;86;P1 +BCU;None;1;MR.MAXIL2.S1P;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;1;Str;0;;general;;BOOLEAN;;;;87;P0 +BCU;None;1;MR.MAXIL2.S1T;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;2;Str;0;;general;;BOOLEAN;;;;88;P0 +BCU;None;1;MR.MAXIL2.S2P;X;Other;Positive or Rising;8;N/A;LDMAXIL;;PTOC;3;Str;0;;general;;BOOLEAN;;;;89;P0 +BCU;None;1;ADD.DEFAIL.DJ;X;Other;Positive or Rising;8;N/A;LDADD;;RBRF;0;OpEx;0;;general;;BOOLEAN;;;;90;P0 +AUT;None;1;;X;Other;Positive or Rising;8;N/A;;;;;;;;;;;;;;91;P0 +BCU;None;1;AR.ENCLT.RM;X;Other;Positive or Rising;8;N/A;LDREC;;RREC;1;OpCls;0;;general;;BOOLEAN;;;;92;P1 +BCU;None;1;AR.ENCLT.RTR;X;Other;Positive or Rising;8;N/A;LDREC;;RREC;2;OpCls;0;;general;;BOOLEAN;;;;93;P1 +BCU;None;1;AR.ENCLT.TAM;X;Other;Positive or Rising;8;N/A;LDREC;;RREC;3;OpCls;0;;general;;BOOLEAN;;;;94;P1 +BCU;None;1;AR.ENCLT.REBTAM;X;Other;Positive or Rising;8;N/A;LDREC;;RREC;4;OpCls;0;;general;;BOOLEAN;;;;95;P1 +BCU;None;1;AR.ENCLT.RT;X;Other;Positive or Rising;8;N/A;LDRS;;RREC;0;OpCls;0;;general;;BOOLEAN;;;;96;P1 +BCU;None;1;AR.ENCLT.RTS;X;Other;Positive or Rising;8;N/A;LDRTS;;RREC;0;OpCls;0;;general;;BOOLEAN;;;;97;P1 +BCU;None;1;AR.ENCLT.RTS;X;Other;Positive or Rising;8;N/A;LDAMU;;RREC;0;OpCls;0;;general;;BOOLEAN;;;;98;P1 +AUT;None;1;AR.ENCLT;X ;Other;Positive or Rising;8;N/A;LDGRP;;;;;;;;;;;;;99;P0 +BCU;None;1;BCU.FERM.DJ;X;Other;Positive or Rising;8;N/A;LDCMDDJ;;CSWI;1;OpCls;0;;general;;BOOLEAN;;;;100;P1 +BCU;None;1;BCU.OUVERT.DJ;X;Other;Positive or Rising;8;N/A;LDCMDDJ;;CSWI;1;OpOpn;0;;general;;BOOLEAN;;;;101;P1 +SCU-ORG;A;1;SCU.OUV.DJ;X;Other;Positive or Rising;8;N/A;LDDJ;;XCMD;0;OpOpn;0;;general;;BOOLEAN;;;;102;P0 +SCU-ORG;A;1;SCU.FERM.DJ;X;Other;Positive or Rising;8;N/A;LDDJ;;XCMD;0;OpCls;0;;general;;BOOLEAN;;;;103;P0 +BCU;None;1;DPHILB;;??;Other;NA;N/A;LDCMDDJ;;RSYN;1;AngInd;0;;stVal;;BOOLEAN;;;;104;P0 +BCU;None;1;DFLB;;??;Other;NA;N/A;LDCMDDJ;;RSYN;1;HzInd;0;;stVal;;BOOLEAN;;;;105;P0 +BCU;None;1;DULB;;??;Other;NA;N/A;LDCMDDJ;;RSYN;1;VInd;0;;stVal;;BOOLEAN;;;;106;P0 +BCU;None;1;PUL;;??;Other;NA;N/A;LDCMDDJ;;FXOT;1;Op;0;;general;;BOOLEAN;;;;107;P0 +BCU;None;1;PUB;;??;Other;NA;N/A;LDCMDDJ;;FXOT;2;Op;0;;general;;BOOLEAN;;;;108;P0 +BCU;None;1;AUL;;??;Other;NA;N/A;LDCMDDJ;;FXUT;1;Op;0;;general;;BOOLEAN;;;;109;P0 +BCU;None;1;AUB;;??;Other;NA;N/A;LDCMDDJ;;FXUT;2;Op;0;;general;;BOOLEAN;;;;110;P0 +BCU;None;1;CYCLE.ARS.ACTIF;;??;Other;NA;N/A;;;;;;;;;;;;;;111;P1 +BCU;None;1;MQ.U.102;X;??;Other;NA;N/A;LDMQUB1;CB00001002;FXUT;0;Op;0;;general;;BOOLEAN;;;;112;P0 +BCU;None;1;MQ.U.103;X;??;Other;NA;N/A;LDMQUB1;CB00001003;FXUT;0;Op;0;;general;;BOOLEAN;;;;113;P0 +BCU;None;1;MQ.U.104;X;??;Other;NA;N/A;LDMQUB1;CB00001004;FXUT;0;Op;0;;general;;BOOLEAN;;;;114;P0 +BCU;None;1;MQ.U.105;X;??;Other;NA;N/A;LDMQUB1;CB00001005;FXUT;0;Op;0;;general;;BOOLEAN;;;;115;P1 +BCU;None;1;MQ.U.106;X;??;Other;NA;N/A;LDMQUB1;CB00001006;FXUT;0;Op;0;;general;;BOOLEAN;;;;116;P1 +BCU;None;1;MQ.U.202;X;??;Other;NA;N/A;LDMQUB1;CB00002002;FXUT;0;Op;0;;general;;BOOLEAN;;;;117;P1 +BCU;None;1;MQ.U.101;X;??;Other;NA;N/A;LDMQUB1;CB00001001;FXUT;0;Op;0;;general;;BOOLEAN;;;;118;P0 +BCU;None;1;MQ.U.201;X;Other;Positive or Rising;8;N/A;LDMQUB1;CB00002001;FXUT;0;Op;0;;general;;BOOLEAN;;;;119;P0 +BCU;None;1;REC.TDECx.Vy;X;Other;Positive or Rising;8;N/A;LDTDEC;;PSCH;0;RxTr;0;;general;;BOOLEAN;;;;120;P0 +BCU;None;1;EMI.TDECx.Vy;;??;Other;NA;N/A;LDTDEC;;PSCH;0;TxTr;0;;general;;BOOLEAN;;;;121;P0 +BCU;None;1;REC.DESARM.ARS;X;Other;Positive or Rising;8;N/A;LDTDEC;;PSCH;0;RxTr;0;;general;;BOOLEAN;;;;122;P0 +BCU;None;1;EMI.TDECx.Vy;;??;Other;NA;N/A;LDTDEC;;PSCH;0;TxTr;0;;general;;BOOLEAN;;;;123;P0 +BCU;None;1;DT.TDEC;;??;Other;NA;N/A;LDTDEC;;PTRC;0;Op;0;;general;;BOOLEAN;;;;124;P1 +BCU;None;1;EPS.MER;X;Other;Positive or Rising;8;N/A;LDEPS;;RDRE;1;RcdStr;0;;stVal;;BOOLEAN;;;;125;P0 +BCU;None;1;PO.MER;X;Other;Positive or Rising;8;N/A;LDEPF;;RDRE;2;RcdTrg;0;;stVal;;BOOLEAN;;;;126;P0 +BCU;None;1;PRS.MER;X;Other;Positive or Rising;8;N/A;LDPRS;;PTRC;0;Str;0;;general;;BOOLEAN;;;;127;P0 +BCU;None;1;DT.PRS;;??;Other;NA;N/A;LDPRS;;PTRC;0;Op;0;;general;;BOOLEAN;;;;128;P0 +BCU;None;1;ANO.TCT.L;X;Other;Positive or Rising;8;N/A;LDSUTCT;;CALH;1;GrInd;0;;stVal;;BOOLEAN;;;;129;P0 +BCU;None;1;ANO.TCT.B;X;Other;Positive or Rising;8;N/A;LDSUTCT;;CALH;2;GrInd;0;;stVal;;BOOLEAN;;;;130;P0 +BCU;None;1;DT.SUTCT;;??;Other;NA;N/A;LDSUTCT;;PTRC;0;Op;0;;general;;BOOLEAN;;;;131;P0 +BCU;None;1;MR.PSPT;X;Other;Positive or Rising;8;N/A;LDPSPT;;PTRC;0;Str;0;;general;;BOOLEAN;;;;132;P0 +BCU;None;1;DT.PSPT;;??;Other;NA;N/A;LDPSPT;;PTRC;0;Op;0;;general;;BOOLEAN;;;;133;P0 +PDT;None;1;MR.PDT;X;Other;Positive or Rising;8;N/A;LDPDT;;PTRC;0;Str;0;;general;;BOOLEAN;;;;134;P0 +PDT;None;1;DT.PDT;;??;Other;NA;N/A;LDPDT;;PTRC;0;Op;0;;general;;BOOLEAN;;;;135;P0 +PTP;None;1;MR.PTP;X;Other;Positive or Rising;8;N/A;LDPTP;;PTRC;0;Str;0;;general;;BOOLEAN;;;;136;P0 +PTP;None;1;DT.PTP ;;??;Other;NA;N/A;LDPTP;;PTRC;0;Op;0;;general;;BOOLEAN;;;;137;P0 +PDB;None;1;MR.PDLP;X;Other;Positive or Rising;8;N/A;LDPTLP;;PTRC;0;Str;0;;general;;BOOLEAN;;;;138;P0 +PDB;None;1;DT.PDLP;;??;Other;NA;N/A;LDPDLP;;PTRC;0;Op;0;;general;;BOOLEAN;;;;139;P0 +PDB;None;1;MR.PDLC;X;Other;Positive or Rising;8;N/A;LDPDLC;;PTRC;0;Str;0;;general;;BOOLEAN;;;;140;P0 +PDB;None;1;DT.PDLC;;??;Other;NA;N/A;LDPDLC;;PTRC;0;Op;0;;general;;BOOLEAN;;;;141;P0 +BCU;None;1;MR.MAXUL;X;Other;Positive or Rising;8;N/A;LDMAXU;;PTRC;0;Str;0;;general;;BOOLEAN;;;;142;P0 +BCU;None;1;DT.MAXUL;;??;Other;NA;N/A;LDMAXU;;PTRC;0;Op;0;;general;;BOOLEAN;;;;143;P0 +SAMU;A;1;V0;;NA;NA;8;N/A;LDTM1;U01A;TVTR;11;VolSv;0;;instMag;;AnalogueValue;i;;1;;P0 +SAMU;A;1;V4;;NA;NA;8;N/A;LDTM1;U01B;TVTR;12;VolSv;0;;instMag;;AnalogueValue;i;;2;;P0 +SAMU;A;1;V8;;NA;NA;8;N/A;LDTM1;U01C;TVTR;13;VolSv;0;;instMag;;AnalogueValue;i;;3;;P0 +SAMU;A;1;J0;;NA;NA;8;N/A;LDTM1;I01A;TCTR;11;AmpSv;0;;instMag;;AnalogueValue;i;;4;;P0 +SAMU;A;1;J4;;NA;NA;8;N/A;LDTM1;I01B;TCTR;12;AmpSv;0;;instMag;;AnalogueValue;i;;5;;P0 +SAMU;A;1;.J8;;NA;NA;8;N/A;LDTM1;J01C;TCTR;13;AmpSv;0;;instMag;;AnalogueValue;i;;6;;P0 +SAMU;A;1;I0;;NA;NA;8;N/A;LDTM1;I05A;TCTR;51;AmpSv;0;;instMag;;AnalogueValue;i;;7;;P0 +SAMU;A;1;I4;;NA;NA;8;N/A;LDTM1;I05B;TCTR;52;AmpSv;0;;instMag;;AnalogueValue;i;;8;;P0 +SAMU;A;1;I8;;NA;NA;8;N/A;LDTM1;I05C;TCTR;53;AmpSv;0;;instMag;;AnalogueValue;i;;9;;P0 +SAMU;A;1;G;;NA;NA;8;N/A;LDTM1;I06N;TCTR;61;AmpSv;0;;instMag;;AnalogueValue;i;;16;;P0 +SAMU;A;1;U101;;NA;NA;8;N/A;LDPHAS1;;MMXU;101;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;10;;P0 +SAMU;A;1;U102;;NA;NA;8;N/A;LDPHAS1;;MMXU;102;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;11;;P0 +SAMU;A;1;U103;;NA;NA;8;N/A;LDPHAS1;;MMXU;103;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;12;;P0 +SAMU;A;1;U104;;NA;NA;8;N/A;LDPHAS1;;MMXU;104;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;13;;P0 +SAMU;A;1;U105;;NA;NA;8;N/A;LDPHAS1;;MMXU;105;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;14;;P0 +SAMU;A;1;U106;;NA;NA;8;N/A;LDPHAS1;;MMXU;106;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;15;;P0 +SAMU;A;1;U201;;NA;NA;8;N/A;LDPHAS1;;MMXU;201;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;14;;P0 +SAMU;A;1;U202;;NA;NA;8;N/A;LDPHAS1;;MMXU;202;PhV;0;phsA;phsB;phsC;cVal;;AnalogueValue;mag;f;15;;P0 diff --git a/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extref_with_BCU_BPU.xml b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extref_with_BCU_BPU.xml new file mode 100644 index 000000000..5a5985a67 --- /dev/null +++ b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extref_with_BCU_BPU.xml @@ -0,0 +1,163 @@ + + + + + + + SCD + +
+ + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + off + + + + + + + + + off + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + off + blocked + test + test/blocked + + + \ No newline at end of file diff --git a/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extrefbayRef.xml b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extrefbayRef.xml new file mode 100644 index 000000000..a64652c3c --- /dev/null +++ b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_extrefbayRef.xml @@ -0,0 +1,126 @@ + + + + + + + SCD + +
+ + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + off + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + on + off + blocked + test + test/blocked + + + \ No newline at end of file diff --git a/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml new file mode 100644 index 000000000..0d504ae4c --- /dev/null +++ b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_iedSources_in_different_bay.xml @@ -0,0 +1,187 @@ + + + + + + + SCD + +
+ + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + off + + + + + + + + + off + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + off + blocked + test + test/blocked + + + \ No newline at end of file diff --git a/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml new file mode 100644 index 000000000..97c6afe45 --- /dev/null +++ b/sct-commons/src/test/resources/scd-ldepf/scd_ldepf_manyIedSources_in_same_bay.xml @@ -0,0 +1,112 @@ + + + + + + + SCD + +
+ + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + + on + off + blocked + test + test/blocked + + + \ No newline at end of file