Le serveur gitlab sera inaccessible le mercredi 19 février 2020 de 13h à 14h pour une intervention de maintenance programmée.

Commit 36edb76f authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '26-update-to-new-console-handling-changes-in-main' into 'master'

Resolve "update to new console handling changes in Main"

Closes #26

See merge request !25
parents 0d2eed15 4fca782f
Pipeline #7733 passed with stages
in 30 seconds
......@@ -23,20 +23,18 @@ import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceFactoryImpl;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseModelLoader;
public class NsdModelLoader extends AbstractRiseClipseModelLoader {
public NsdModelLoader( IRiseClipseConsole console ) {
super( console );
public NsdModelLoader() {
reset();
}
// @Override
public void reset() {
super.reset( new NsdResourceSetImpl( false, console ) );
super.reset( new NsdResourceSetImpl( false ));
// Register the appropriate resource factory to handle all file
// extensions.
......@@ -55,7 +53,7 @@ public class NsdModelLoader extends AbstractRiseClipseModelLoader {
public Resource loadWithoutValidation( String name ) {
Object eValidator = EValidator.Registry.INSTANCE.remove( NsdPackage.eINSTANCE );
Resource resource = load( name );
Resource resource = load( name, AbstractRiseClipseConsole.getConsole() );
if( eValidator != null ) {
EValidator.Registry.INSTANCE.put( NsdPackage.eINSTANCE, eValidator );
......
......@@ -29,8 +29,8 @@ public class NsdResourceSetFactory implements IRiseClipseResourceSetFactory {
* @see fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory#createResourceSet()
*/
@Override
public IRiseClipseResourceSet createResourceSet( boolean strictContent, IRiseClipseConsole console ) {
return new NsdResourceSetImpl( strictContent, console );
public IRiseClipseResourceSet createResourceSet( boolean strictContent ) {
return new NsdResourceSetImpl( strictContent );
}
}
......@@ -76,8 +76,8 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
private Map< NsIdentification, List< ServiceNS > > nsdAdditions = new HashMap<>();
private Map< NsIdentification, NsIdentification > equivalentNamespaces = new HashMap<>();
public NsdResourceSetImpl( boolean strictContent, IRiseClipseConsole console ) {
super( strictContent, console );
public NsdResourceSetImpl( boolean strictContent ) {
super( strictContent );
setEquivalentNamespace(
new NsIdentification( "IEC 61850-7-2", 2007, "B", 1 ),
......@@ -180,7 +180,7 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
nsdAdditions.put( nsId, new ArrayList<>() );
}
nsdAdditions.get( nsId ).add( serviceNSResources.get( serviceNsId ));
applyServiceNs( serviceNSResources.get( serviceNsId ), nsdResources.get( nsId ), nsId );
applyServiceNs( serviceNSResources.get( serviceNsId ), nsdResources.get( nsId ), nsId, console );
}
}
}
......@@ -191,7 +191,7 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
}
private void applyServiceNs( ServiceNS serviceNS, NS ns, NsIdentification nsIdentification ) {
private void applyServiceNs( ServiceNS serviceNS, NS ns, NsIdentification nsIdentification, IRiseClipseConsole console ) {
// A ServiceTypeRealization gives a new definition to an existing (only basic ? never constructed ?) type
for( ConstructedAttribute typeRealization : serviceNS.getServiceTypeRealizations().getServiceTypeRealization() ) {
BasicType basic = findBasicType( typeRealization.getName(), nsIdentification, console );
......@@ -264,7 +264,7 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
*/
private void buildExplicitLinks( IRiseClipseConsole console ) {
for( Resource resource : getResources() ) {
if( resource instanceof NsdResourceImpl ) {
if(( resource instanceof NsdResourceImpl ) && ( ! resource.getContents().isEmpty() )) {
DocumentRoot root = (DocumentRoot) resource.getContents().get( 0 );
if( root.getNS() != null ) {
root.getNS().buildExplicitLinks( console, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment