Skip to content

Commit 1442308

Browse files
samirromdhaniAliouDIAITE
authored andcommitted
[68][164] Activation used LDevice and Deactivation unused LDevice (#163)
Signed-off-by: Aliou DIAITE <[email protected]> Signed-off-by: Samir Romdhani <[email protected]> Signed-off-by: Aliou DIAITE <[email protected]>
1 parent 3d8c418 commit 1442308

File tree

11 files changed

+36
-10
lines changed

11 files changed

+36
-10
lines changed

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclRootAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.lfenergy.compas.sct.commons.scl.sstation.SubstationAdapter;
1919

2020
import java.util.List;
21+
import java.util.Optional;
2122
import java.util.stream.Collectors;
2223

2324
/**

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/CommunicationAdapter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,11 @@ public boolean amChildElementRef() {
5858
return currentElem == parentAdapter.getCurrentElem().getCommunication();
5959
}
6060

61-
<<<<<<< HEAD
6261
@Override
6362
protected String elementXPath() {
6463
return "Communication";
6564
}
6665

67-
=======
68-
>>>>>>> update docs and init javadocs (#157)
6966
/**
7067
* Add Subnetwork node in Communication one.
7168
* For that :

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/ConnectedAPAdapter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import org.lfenergy.compas.scl2007b4.model.SCL;
88
import org.lfenergy.compas.scl2007b4.model.TConnectedAP;
9-
import org.lfenergy.compas.scl2007b4.model.TPrivate;
109
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter;
1110
import org.lfenergy.compas.sct.commons.util.Utils;
1211

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/DAAdapter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ protected boolean amChildElementRef() {
5858
return parentAdapter.getCurrentElem().getSDOOrDA().contains(currentElem);
5959
}
6060

61+
@Override
62+
protected String elementXPath() {
63+
return String.format("DA[name=%s and type=%s]",
64+
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null),
65+
Utils.xpathAttributeFilter("type", currentElem.isSetType() ? currentElem.getType() : null));
66+
}
67+
6168
/**
6269
* Updates DA Type Name
6370
* @param daTypeName DA Type Name to update

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/DOAdapter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ protected boolean amChildElementRef() {
5454
return parentAdapter.getCurrentElem().getDO().contains(currentElem);
5555
}
5656

57+
@Override
58+
protected String elementXPath() {
59+
return String.format("DO[%s and %s]",
60+
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null),
61+
Utils.xpathAttributeFilter("type", currentElem.isSetType() ? currentElem.getType() : null));
62+
}
63+
5764
/**
5865
* Gets linked DataTypeTemplateAdapter as parent
5966
* @return <em>DataTypeTemplateAdapter</em> object

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/DataTypeTemplateAdapter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.lfenergy.compas.sct.commons.exception.ScdException;
1414
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter;
1515
import org.lfenergy.compas.sct.commons.scl.SclRootAdapter;
16-
import org.lfenergy.compas.sct.commons.scl.ied.IEDAdapter;
1716

1817
import java.util.*;
1918
import java.util.stream.Collectors;

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/LNodeTypeAdapter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ protected boolean amChildElementRef() {
7272
return parentAdapter.getCurrentElem().getLNodeType().contains(currentElem);
7373
}
7474

75+
@Override
76+
protected String elementXPath() {
77+
return String.format("LNodeType[%s and %s]",
78+
Utils.xpathAttributeFilter("id", currentElem.isSetId() ? currentElem.getId() : null),
79+
Utils.xpathAttributeFilter("lnClass", currentElem.isSetLnClass() ? currentElem.getLnClass() : null));
80+
}
81+
7582
/**
7683
* Compares current LNodeType and given LNodeType
7784
* @param tlNodeType LNodeType to compare with

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/DOIAdapter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ protected boolean amChildElementRef() {
5757
return parentAdapter.getCurrentElem().getDOI().contains(currentElem);
5858
}
5959

60+
@Override
61+
protected String elementXPath() {
62+
return String.format("DOI[%s]",
63+
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null));
64+
}
65+
6066
/**
6167
* Gets SDI by name from current DOI
6268
* @param sName name of SDI to get

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/LN0Adapter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package org.lfenergy.compas.sct.commons.scl.ied;
66

77

8-
98
import org.apache.commons.lang3.tuple.Pair;
109
import org.lfenergy.compas.scl2007b4.model.*;
1110
import org.lfenergy.compas.sct.commons.dto.*;
@@ -88,17 +87,14 @@ protected boolean amChildElementRef() {
8887
return currentElem == parentAdapter.getCurrentElem().getLN0();
8988
}
9089

91-
/**
92-
* Gets current LN0 class type
93-
* @return <em>LN0.class</em>
94-
*/
9590
@Override
9691
protected String elementXPath() {
9792
return String.format("LN[lnClass=\"LLN0\" and %s and %s]",
9893
Utils.xpathAttributeFilter("inst", currentElem.isSetInst() ? currentElem.getInst() : null),
9994
Utils.xpathAttributeFilter("lnType", currentElem.isSetLnType() ? currentElem.getLnType() : null));
10095
}
10196

97+
10298
/**
10399
* Gets current LN0 class type
104100
* @return <em>LN0.class</em>

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/LNAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public String getPrefix() {
114114
return currentElem.getPrefix();
115115
}
116116

117+
117118
/**
118119
* Check if node is child of the reference node
119120
* @return link parent child existence

0 commit comments

Comments
 (0)