Skip to content

Commit

Permalink
[68][164] Activation used LDevice and Deactivation unused LDevice (#163)
Browse files Browse the repository at this point in the history
Signed-off-by: Aliou DIAITE <aliou.diaite@rte-france.com>
Signed-off-by: Samir Romdhani <samir.romdhani@rte-france.com>
Signed-off-by: Aliou DIAITE <aliou.diaite@rte-france.com>
  • Loading branch information
samirromdhani authored and AliouDIAITE committed Oct 24, 2022
1 parent 3d8c418 commit 1442308
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.lfenergy.compas.sct.commons.scl.sstation.SubstationAdapter;

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,11 @@ public boolean amChildElementRef() {
return currentElem == parentAdapter.getCurrentElem().getCommunication();
}

<<<<<<< HEAD
@Override
protected String elementXPath() {
return "Communication";
}

=======
>>>>>>> update docs and init javadocs (#157)
/**
* Add Subnetwork node in Communication one.
* For that :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import org.lfenergy.compas.scl2007b4.model.SCL;
import org.lfenergy.compas.scl2007b4.model.TConnectedAP;
import org.lfenergy.compas.scl2007b4.model.TPrivate;
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter;
import org.lfenergy.compas.sct.commons.util.Utils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ protected boolean amChildElementRef() {
return parentAdapter.getCurrentElem().getSDOOrDA().contains(currentElem);
}

@Override
protected String elementXPath() {
return String.format("DA[name=%s and type=%s]",
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null),
Utils.xpathAttributeFilter("type", currentElem.isSetType() ? currentElem.getType() : null));
}

/**
* Updates DA Type Name
* @param daTypeName DA Type Name to update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ protected boolean amChildElementRef() {
return parentAdapter.getCurrentElem().getDO().contains(currentElem);
}

@Override
protected String elementXPath() {
return String.format("DO[%s and %s]",
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null),
Utils.xpathAttributeFilter("type", currentElem.isSetType() ? currentElem.getType() : null));
}

/**
* Gets linked DataTypeTemplateAdapter as parent
* @return <em>DataTypeTemplateAdapter</em> object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.lfenergy.compas.sct.commons.exception.ScdException;
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter;
import org.lfenergy.compas.sct.commons.scl.SclRootAdapter;
import org.lfenergy.compas.sct.commons.scl.ied.IEDAdapter;

import java.util.*;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ protected boolean amChildElementRef() {
return parentAdapter.getCurrentElem().getLNodeType().contains(currentElem);
}

@Override
protected String elementXPath() {
return String.format("LNodeType[%s and %s]",
Utils.xpathAttributeFilter("id", currentElem.isSetId() ? currentElem.getId() : null),
Utils.xpathAttributeFilter("lnClass", currentElem.isSetLnClass() ? currentElem.getLnClass() : null));
}

/**
* Compares current LNodeType and given LNodeType
* @param tlNodeType LNodeType to compare with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ protected boolean amChildElementRef() {
return parentAdapter.getCurrentElem().getDOI().contains(currentElem);
}

@Override
protected String elementXPath() {
return String.format("DOI[%s]",
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null));
}

/**
* Gets SDI by name from current DOI
* @param sName name of SDI to get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package org.lfenergy.compas.sct.commons.scl.ied;



import org.apache.commons.lang3.tuple.Pair;
import org.lfenergy.compas.scl2007b4.model.*;
import org.lfenergy.compas.sct.commons.dto.*;
Expand Down Expand Up @@ -88,17 +87,14 @@ protected boolean amChildElementRef() {
return currentElem == parentAdapter.getCurrentElem().getLN0();
}

/**
* Gets current LN0 class type
* @return <em>LN0.class</em>
*/
@Override
protected String elementXPath() {
return String.format("LN[lnClass=\"LLN0\" and %s and %s]",
Utils.xpathAttributeFilter("inst", currentElem.isSetInst() ? currentElem.getInst() : null),
Utils.xpathAttributeFilter("lnType", currentElem.isSetLnType() ? currentElem.getLnType() : null));
}


/**
* Gets current LN0 class type
* @return <em>LN0.class</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public String getPrefix() {
return currentElem.getPrefix();
}


/**
* Check if node is child of the reference node
* @return link parent child existence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ protected boolean amChildElementRef() {
return SDIAdapter.class.cast(parentAdapter).getCurrentElem().getSDIOrDAI().contains(currentElem);
}

@Override
protected String elementXPath() {
return String.format("SDI[%s]",
Utils.xpathAttributeFilter("name", currentElem.isSetName() ? currentElem.getName() : null));
}

/**
* Gets in current SDI specific SDI by its name
* @param sName name of SDI to get
Expand Down

0 comments on commit 1442308

Please sign in to comment.