Skip to content

Commit

Permalink
suppression des interfaces et quelques retours
Browse files Browse the repository at this point in the history
Signed-off-by: gleizesDor <115622893+gleizesDor@users.noreply.github.com>
  • Loading branch information
gleizesDor committed Nov 24, 2023
1 parent af5e275 commit 1a59232
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
import org.lfenergy.compas.scl2007b4.model.TAnyLN;
import org.lfenergy.compas.scl2007b4.model.TDataSet;
import org.lfenergy.compas.scl2007b4.model.TLN;
import org.lfenergy.compas.sct.commons.api.DataSetReader;

import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class DataSetService implements DataSetReader {
public class DataSetService {

public Stream<TDataSet> getDataSets(TAnyLN tAnyLN) {
return switch (tAnyLN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import org.lfenergy.compas.scl2007b4.model.TDO;
import org.lfenergy.compas.scl2007b4.model.TLNodeType;
import org.lfenergy.compas.sct.commons.api.DoReader;

import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class DoService implements DoReader {
public class DoService {

public Stream<TDO> getDos(TLNodeType tlNodeType) {
return tlNodeType.getDO().stream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import org.lfenergy.compas.scl2007b4.model.TDataTypeTemplates;
import org.lfenergy.compas.scl2007b4.model.TDOType;
import org.lfenergy.compas.sct.commons.api.DoTypeReader;

import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class DoTypeService implements DoTypeReader {
public class DoTypeService {

public Stream<TDOType> getDoTypes(TDataTypeTemplates tDataTypeTemplates) {
return tDataTypeTemplates.getDOType().stream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import org.lfenergy.compas.scl2007b4.model.SCL;
import org.lfenergy.compas.scl2007b4.model.TIED;
import org.lfenergy.compas.sct.commons.api.IedReader;

import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class IedService implements IedReader {
public class IedService {

public Stream<TIED> getFilteredIeds(SCL scd, Predicate<TIED> iedPredicate) {
return scd.getIED().stream().filter(iedPredicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
package org.lfenergy.compas.sct.commons;

import org.lfenergy.compas.scl2007b4.model.*;
import org.lfenergy.compas.sct.commons.api.LdeviceReader;
import org.lfenergy.compas.sct.commons.util.ActiveStatus;

import java.util.Objects;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class LdeviceService implements LdeviceReader {
public class LdeviceService {

public Stream<TLDevice> getLdevices(TIED tied) {
if (!tied.isSetAccessPoint()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package org.lfenergy.compas.sct.commons;

import org.lfenergy.compas.scl2007b4.model.*;
import org.lfenergy.compas.sct.commons.api.LnReader;
import org.lfenergy.compas.sct.commons.util.ActiveStatus;

import java.util.Collection;
Expand All @@ -15,7 +14,7 @@
import static org.lfenergy.compas.sct.commons.util.CommonConstants.MOD_DO_NAME;
import static org.lfenergy.compas.sct.commons.util.CommonConstants.STVAL_DA_NAME;

public class LnService implements LnReader {
public class LnService {

public Stream<TAnyLN> getAnylns(TLDevice tlDevice) {
return Stream.concat(Stream.of(tlDevice.getLN0()), tlDevice.getLN().stream());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import org.lfenergy.compas.scl2007b4.model.TDataTypeTemplates;
import org.lfenergy.compas.scl2007b4.model.TLNodeType;
import org.lfenergy.compas.sct.commons.api.LnodeTypeReader;

import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class LnodeTypeService implements LnodeTypeReader {
public class LnodeTypeService {

public Stream<TLNodeType> getLnodeTypes(TDataTypeTemplates tDataTypeTemplates) {
return tDataTypeTemplates.getLNodeType().stream();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static LNodeDTO from(TAnyLN tAnyLN, LogicalNodeOptions options, String ie
};
String inst = lnKey.getInst();
String lnClass = lnKey.getLnClass();
String prefix = lnKey.getPrefix().orElse("");
String prefix = lnKey.getPrefix();
String lnType = tAnyLN.getLnType();
LNodeDTO lNodeDTO = new LNodeDTO(inst, lnClass, prefix, lnType);
if (options.isWithExtRef()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ public Stream<ControlBlock> getControlBlocksByDataSetRef(String dataSetRef, TSer

if (isLN0()) {
LN0 ln0 = (LN0) currentElem;
//GOOSE et SMV
if (serviceType == null || serviceType == TServiceType.GOOSE) {
streamGSEControl = ln0.getGSEControl()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.lfenergy.compas.scl2007b4.model.LN0;
import org.lfenergy.compas.scl2007b4.model.TLN;

import java.util.Optional;

@Getter
@EqualsAndHashCode
public class LnKey {
Expand All @@ -18,21 +17,21 @@ public class LnKey {
@EqualsAndHashCode.Exclude
private final String lnType;
private final String lnClass;
/** empty pour les LN0 */
private final Optional<String> prefix;
/** empty for LN0 */
private final String prefix;

public LnKey(LN0 ln0) {
this.inst = ln0.getInst();
this.lnType = ln0.getLnType();
this.lnClass = ln0.getLnClass().get(0);
this.prefix = Optional.empty();
this.prefix = StringUtils.EMPTY;
}

public LnKey(TLN tln) {
this.inst = tln.getInst();
this.lnType = tln.getLnType();
this.lnClass = tln.getLnClass().get(0);
this.prefix = Optional.of(tln.getPrefix());
this.prefix = tln.getPrefix();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public static boolean isValidDataTypeTemplate(AbstractLNAdapter<?> lnAdapter,LDE
.filter(lNodeTypeAdapter -> {
try {
lNodeTypeAdapter.checkDoAndDaTypeName(doTypeName, daTypeName);
} catch (Exception ex) {
} catch (ScdException ex) {
return false;
}
return true;
Expand Down

0 comments on commit 1a59232

Please sign in to comment.