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

resolve conflict

parents 4034449b 3090ab92
No related branches found
No related tags found
1 merge request!8Resolve "add needed stuff to allow for loading NSD files with RiseClipseEditor"
...@@ -21,10 +21,14 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd.util; ...@@ -21,10 +21,14 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd.util;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream;
import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DocumentRoot; import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DocumentRoot;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClass;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClasses;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS; import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole; import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole; import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
...@@ -227,4 +231,30 @@ public class NsdResourceSetImpl extends RiseClipseResourceSet { ...@@ -227,4 +231,30 @@ public class NsdResourceSetImpl extends RiseClipseResourceSet {
* Name: uniqueServiceCDC Selector: nsd:ServiceCDC Field: @cdc @variant * Name: uniqueServiceCDC Selector: nsd:ServiceCDC Field: @cdc @variant
* Within an ServiceNS, there shall not be two ServiceCDC sub-elements with same name and (if defined) variant. * Within an ServiceNS, there shall not be two ServiceCDC sub-elements with same name and (if defined) variant.
*/ */
public Stream< LNClass > getLNClassStream() {
if( nsdResources.isEmpty() ) {
return null;
}
Stream< LNClass > lnClassStream = null;
Iterator< NS > it = nsdResources.values().iterator();
while( it.hasNext() ) {
LNClasses lnClasses = it.next().getLNClasses();
if( lnClasses != null ) {
if( lnClassStream == null ) {
lnClassStream = lnClasses.getLNClass().stream();
}
else {
// Warning: Resource leak: 'lnClassStream' is not closed at this location ??
//lnClassStream = Stream.concat( lnClassStream, lnClasses.getLNClass().stream() );
Stream< LNClass > tmp = Stream.concat( lnClassStream, lnClasses.getLNClass().stream() );
lnClassStream = tmp;
}
}
}
return lnClassStream;
}
} }
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