Skip to content
Snippets Groups Projects
Commit ece90cce authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

Merge branch '61-getnamespace-code-in-anylnimpl-removed-by-last-emf-generation' into 'master'

Resolve "getNamespace() code in AnyLNImpl removed by last EMF generation"

Closes #61

See merge request !57
parents 1b8b377f 5b13c5bf
No related branches found
No related tags found
1 merge request!57Resolve "getNamespace() code in AnyLNImpl removed by last EMF generation"
Pipeline #4559 passed
...@@ -23,6 +23,9 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl.impl; ...@@ -23,6 +23,9 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN; import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.Association; import fr.centralesupelec.edf.riseclipse.iec61850.scl.Association;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.ClientLN; import fr.centralesupelec.edf.riseclipse.iec61850.scl.ClientLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DA;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DAI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataSet; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataSet;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataTypeTemplates; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataTypeTemplates;
...@@ -1113,13 +1116,86 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN { ...@@ -1113,13 +1116,86 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated NOT
*/ */
@Override @Override
public String getNamespace() { public String getNamespace() {
// TODO: implement this method List< DOI > namPltDoi =
// Ensure that you remove @generated or mark it @generated NOT getDOI()
throw new UnsupportedOperationException(); .stream()
.filter( doi -> "NamPlt".equals( doi.getName() ))
.collect( Collectors.toList() );
if( namPltDoi.size() == 1 ) {
List< DAI > lnNsDai =
namPltDoi
.get( 0 )
.getDAI()
.stream()
.filter( dai -> "lnNs".equals( dai.getName() ))
.collect( Collectors.toList() );
if( lnNsDai.size() == 1 ) {
if(( lnNsDai.get( 0 ).getVal().size() == 1 )
&& ( lnNsDai.get( 0 ).getVal().get( 0 ).getValue() != null )
&& ( lnNsDai.get( 0 ).getVal().get( 0 ).getValue().length() != 0 )) {
return lnNsDai.get( 0 ).getVal().get( 0 ).getValue();
}
if(( lnNsDai.get( 0 ).getRefersToAbstractDataAttribute() != null )
&& ( lnNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().size() == 1 )
&& ( lnNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue() != null )
&& ( lnNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue().length() != 0 )) {
return lnNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue();
}
}
if( namPltDoi.get( 0 ).getRefersToDO() != null ) {
List< DA > lnNsDa =
namPltDoi
.get( 0 )
.getRefersToDO()
.getRefersToDOType()
.getDA()
.stream()
.filter( da -> "lnNs".equals( da.getName() ))
.collect( Collectors.toList() );
if( lnNsDa.size() == 1 ) {
if(( lnNsDa.get( 0 ).getVal().size() == 1 )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue() != null )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue().length() != 0 )) {
return lnNsDa.get( 0 ).getVal().get( 0 ).getValue();
}
}
}
}
if( getRefersToLNodeType() != null ) {
List< DO > namPltDo =
getRefersToLNodeType()
.getDO()
.stream()
.filter( doi -> "NamPlt".equals( doi.getName() ))
.collect( Collectors.toList() );
if( namPltDo.size() == 1 ) {
if( namPltDo.get( 0 ).getRefersToDOType() != null ) {
List< DA > lnNsDa =
namPltDo
.get( 0 )
.getRefersToDOType()
.getDA()
.stream()
.filter( da -> "lnNs".equals( da.getName() ))
.collect( Collectors.toList() );
if( lnNsDa.size() == 1 ) {
if(( lnNsDa.get( 0 ).getVal().size() == 1 )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue() != null )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue().length() != 0 )) {
return lnNsDa.get( 0 ).getVal().get( 0 ).getValue();
}
}
}
}
}
if( getParentLDevice() == null ) return null;
return getParentLDevice().getNamespace();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment