-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from com-pas/276-evolution-some-source-ied-ar…
- Loading branch information
Showing
21 changed files
with
2,146 additions
and
787 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// SPDX-FileCopyrightText: 2023 RTE FRANCE | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.lfenergy.compas.sct.commons.dto; | ||
|
||
import com.opencsv.bean.CsvBindByPosition; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.lfenergy.compas.scl2007b4.model.TCompasFlowKind; | ||
import org.lfenergy.compas.scl2007b4.model.TExtRef; | ||
import org.lfenergy.compas.sct.commons.util.Utils; | ||
|
||
import java.math.BigInteger; | ||
|
||
/** | ||
* A representation of settings made for LDEPF LDevice | ||
* | ||
* @see <a href="https://github.com/com-pas/compas-sct/issues/256" target="_blank">Issue !256</a> | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class LDEPFSettingData { | ||
|
||
@CsvBindByPosition(position = 0) | ||
private TCompasFlowKind bayScope; | ||
@CsvBindByPosition(position = 1) | ||
private String iedType; | ||
@CsvBindByPosition(position = 2) | ||
private String iedRedundancy; | ||
@CsvBindByPosition(position = 3) | ||
private BigInteger iedInstance; | ||
@CsvBindByPosition(position = 4) | ||
private String channelShortLabel; | ||
@CsvBindByPosition(position = 5) | ||
private String channelMREP; | ||
@CsvBindByPosition(position = 6) | ||
private String channelLevModQ; | ||
@CsvBindByPosition(position = 7) | ||
private String channelLevModLevMod; | ||
@CsvBindByPosition(position = 8) | ||
private String bapVariant; | ||
@CsvBindByPosition(position = 9) | ||
private String bapIgnoredValue; | ||
@CsvBindByPosition(position = 10) | ||
private String ldInst; | ||
@CsvBindByPosition(position = 11) | ||
private String lnPrefix; | ||
@CsvBindByPosition(position = 12) | ||
private String lnClass; | ||
@CsvBindByPosition(position = 13) | ||
private String lnInst; | ||
@CsvBindByPosition(position = 14) | ||
private String doName; | ||
@CsvBindByPosition(position = 15) | ||
private String doInst; | ||
@CsvBindByPosition(position = 16) | ||
private String sdoName; | ||
@CsvBindByPosition(position = 17) | ||
private String daName; | ||
@CsvBindByPosition(position = 18) | ||
private String daType; | ||
@CsvBindByPosition(position = 19) | ||
private String dabType; | ||
@CsvBindByPosition(position = 20) | ||
private String bdaName; | ||
@CsvBindByPosition(position = 21) | ||
private String sbdaName; | ||
@CsvBindByPosition(position = 22) | ||
private Integer channelAnalogNum; | ||
@CsvBindByPosition(position = 23) | ||
private Integer channelDigitalNum; | ||
@CsvBindByPosition(position = 24) | ||
private String opt; | ||
|
||
/** | ||
* verify if an Extref matches the Analog type or not. | ||
*/ | ||
private Boolean isAnalogTypeMatchDesc(TExtRef extRef) { | ||
return getChannelAnalogNum() != null && getChannelDigitalNum() == null | ||
&& extRef.getDesc().startsWith("DYN_LDEPF_ANALOG CHANNEL " + getChannelAnalogNum()+"_1_AnalogueValue") | ||
&& extRef.getDesc().endsWith("_" + getDaName() + "_1"); | ||
} | ||
|
||
/** | ||
* verify if an Extref matches the Digital type or not. | ||
*/ | ||
private Boolean isDigitalTypeMatchDesc(TExtRef extRef) { | ||
return getChannelDigitalNum() != null && getChannelAnalogNum() == null | ||
&& extRef.getDesc().startsWith("DYN_LDEPF_DIGITAL CHANNEL " + getChannelDigitalNum()+"_1_BOOLEEN") | ||
&& extRef.getDesc().endsWith("_" + getDaName() + "_1"); | ||
} | ||
|
||
/** | ||
* verify if an Extref matches the LDEPFSettingData or not. | ||
*/ | ||
public Boolean isMatchExtRef(TExtRef extRef) { | ||
return extRef.isSetDesc() && (isAnalogTypeMatchDesc(extRef) || isDigitalTypeMatchDesc(extRef)) | ||
&& extRef.isSetPLN() && Utils.lnClassEquals(extRef.getPLN(), getLnClass()) | ||
&& extRef.isSetPDO() && extRef.getPDO().equals(getDoName()); | ||
} | ||
|
||
} |
131 changes: 0 additions & 131 deletions
131
sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/LDEPFSettingsSupplier.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
sct-commons/src/main/java/org/lfenergy/compas/sct/commons/util/ILDEPFSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-FileCopyrightText: 2023 RTE FRANCE | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.lfenergy.compas.sct.commons.util; | ||
|
||
import org.lfenergy.compas.scl2007b4.model.*; | ||
import org.lfenergy.compas.sct.commons.dto.LDEPFSettingData; | ||
import org.lfenergy.compas.sct.commons.scl.SclRootAdapter; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
|
||
/** | ||
* This interface showcases the LDEPF parameters for the LDEPF LDevice. | ||
*/ | ||
public interface ILDEPFSettings { | ||
|
||
/** | ||
* Provides the matching setting for an ExtRef. | ||
* @param extRef The ExtRef object | ||
* @return the matching LDEPFSettingDTO for an ExtRef | ||
*/ | ||
Optional<LDEPFSettingData> getLDEPFSettingDataMatchExtRef(TExtRef extRef); | ||
|
||
/** | ||
* Provides valid IED sources with LDEPF configuration.<br/> | ||
* Example of LDEPF configuration include:<br/> | ||
* 1. COMPAS-Bay verification that should be closed to the provided Flow Kind<br/> | ||
* 2. COMPAS-ICDHeader verification that should match the provided parameters, see {@link Utils#isIcdHeaderMatch}<br/> | ||
* 3. Active LDevice source object that should match the provided parameters, see {@link Utils#getActiveSourceLDevice}<br/> | ||
* 4. Active LNode source object that should match the provided parameters, see {@link Utils#getActiveLNodeSource}<br/> | ||
* 5. Valid DataTypeTemplate Object hierarchy that should match the DO/DA/BDA parameters, see {@link Utils#isValidDataTypeTemplate}<br/> | ||
* @param sclRootAdapter SCL | ||
* @param compasBay TCompasBay | ||
* @param setting LDEPFSetting | ||
* @return the IED sources matching the LDEPFSetting | ||
*/ | ||
List<TIED> getIedSources(SclRootAdapter sclRootAdapter, TCompasBay compasBay, LDEPFSettingData setting); | ||
|
||
} |
Oops, something went wrong.