Skip to content

Commit

Permalink
feat(#362): RSR-812 - Use generated JAXB class for configuration of C…
Browse files Browse the repository at this point in the history
…ommunication of Control Blocks

Signed-off-by: massifben <105049157+massifben@users.noreply.github.com>
  • Loading branch information
massifben committed Dec 6, 2023
1 parent b890c75 commit 08f1e98
Show file tree
Hide file tree
Showing 11 changed files with 699 additions and 635 deletions.
17 changes: 17 additions & 0 deletions sct-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,23 @@
<clearOutputDir>false</clearOutputDir>
</configuration>
</execution>
<execution>
<id>cbcom</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/src/main/resources/xsd/RCONF_CB_COM_Config_file_v1.xsd</source>
</sources>
<xjbSources>
<xjbSource>${project.basedir}/src/main/resources/binding_configuration.xjb</xjbSource>
</xjbSources>
<packageName>org.lfenergy.compas.sct.commons.model.cbcom</packageName>
<noPackageLevelAnnotations>true</noPackageLevelAnnotations>
<clearOutputDir>false</clearOutputDir>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import org.lfenergy.compas.scl2007b4.model.SCL;
import org.lfenergy.compas.scl2007b4.model.TExtRef;
import org.lfenergy.compas.sct.commons.dto.ControlBlockNetworkSettings;
import org.lfenergy.compas.sct.commons.dto.FcdaForDataSetsCreation;
import org.lfenergy.compas.sct.commons.dto.SclReportItem;
import org.lfenergy.compas.sct.commons.model.cbcom.CBCom;
import org.lfenergy.compas.sct.commons.util.Utils;

import java.util.List;
Expand All @@ -22,7 +22,7 @@
* <ol>
* <li>{@link ControlBlockEditor#createDataSetAndControlBlocks(SCL, Set) <em>Create DataSet and ControlBlock based on the <b>TExtRef</b></em>}</li>
* <li>{@link ControlBlockEditor#createDataSetAndControlBlocks(SCL, String, Set) <em>Create DataSet and ControlBlock based on the <b>TExtRef</b> in given <b>IED</b></em>}</li>
* <li>{@link ControlBlockEditor#createDataSetAndControlBlocks(SCL, String,String, Set) <em>Create DataSet and ControlBlock based on the <b>TExtRef</b> in given <b>IED</b> and <b>LDevice</b></em>}</li>
* <li>{@link ControlBlockEditor#createDataSetAndControlBlocks(SCL, String, String, Set) <em>Create DataSet and ControlBlock based on the <b>TExtRef</b> in given <b>IED</b> and <b>LDevice</b></em>}</li>
* <li>{@link ControlBlockEditor#configureNetworkForAllControlBlocks <em>Configure the network for the <b>ControlBlocks</b></em>}</li>
* <li>{@link ControlBlockEditor#removeAllControlBlocksAndDatasetsAndExtRefSrcBindings <em>Removes all ControlBlocks and DataSets for all LNs in <b>SCL</b></em>}</li>
* <li>{@link ControlBlockEditor#analyzeDataGroups(SCL)} <em>Checks Control Blocks, DataSets and FCDA number limitation into Access Points </em>}</li>
Expand Down Expand Up @@ -85,17 +85,11 @@ public interface ControlBlockEditor {
* - the Communication/SubNetwork/ConnectedAP/GSE element, for the GSEControl blocks
* - the Communication/SubNetwork/ConnectedAP/SMV element, for the SampledValueControl blocks
*
* @param scd input SCD object. The object will be modified with the new DataGSESet and SMV elements
* @param controlBlockNetworkSettings a method tha gives the network configuration information for a given ControlBlock
* @param rangesPerCbType provide NetworkRanges for GSEControl and SampledValueControl. NetworkRanges contains :
* start-end app APPID range (long value), start-end MAC-Addresses (Mac-Addresses values: Ex: "01-0C-CD-01-01-FF")
* @param scd input SCD object. The object will be modified with the new GSE and SMV elements
* @param cbCom communication settings to configure Control Block Communication
* @return list of encountered errors
* @see Utils#macAddressToLong(String) for the expected MAC address format
* @see ControlBlockNetworkSettings
* @see ControlBlockNetworkSettings.RangesPerCbType
* @see ControlBlockNetworkSettings.NetworkRanges
*/
List<SclReportItem> configureNetworkForAllControlBlocks(SCL scd, ControlBlockNetworkSettings controlBlockNetworkSettings,
ControlBlockNetworkSettings.RangesPerCbType rangesPerCbType);
List<SclReportItem> configureNetworkForAllControlBlocks(SCL scd, CBCom cbCom);

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import lombok.Getter;
import org.lfenergy.compas.scl2007b4.model.*;
import org.lfenergy.compas.sct.commons.model.cbcom.TCBType;

import java.util.Arrays;
import java.util.Objects;
Expand Down Expand Up @@ -40,4 +41,20 @@ public static ControlBlockEnum from(Class<? extends TControl> tControlClass) {
.orElseThrow(() -> new IllegalArgumentException("Unsupported TControl class : " + tControlClass.getSimpleName()));
}

public static ControlBlockEnum from(TCBType tcbType) {
return switch (tcbType){
case GOOSE -> GSE;
case SV -> SAMPLED_VALUE;
default -> throw new IllegalArgumentException("Unsupported TCBType: " + tcbType);
};
}

public TCBType toTCBType(){
return switch (this){
case GSE -> TCBType.GOOSE;
case SAMPLED_VALUE -> TCBType.SV;
default -> throw new IllegalArgumentException("Cannot convert ControlBlockEnum " + this + " to TCBType");
};
}

}

This file was deleted.

Loading

0 comments on commit 08f1e98

Please sign in to comment.