Commit 1ce3df3e authored by Dominique Marcadet's avatar Dominique Marcadet

Modify doResolveLinks() methods

Main changes:
- avoid possible NPE,
- use standards EMF getters,
- use @NonNull
- add some methods for common access
parent 8c3459ef
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8
...@@ -14,5 +14,6 @@ Export-Package: fr.centralesupelec.edf.riseclipse.iec61850.scl, ...@@ -14,5 +14,6 @@ Export-Package: fr.centralesupelec.edf.riseclipse.iec61850.scl,
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport, org.eclipse.emf.ecore.xmi;visibility:=reexport,
fr.centralesupelec.edf.riseclipse.main fr.centralesupelec.edf.riseclipse.main,
org.eclipse.jdt.annotation
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
...@@ -23,6 +23,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.Association; ...@@ -23,6 +23,7 @@ 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.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.ExtRef; import fr.centralesupelec.edf.riseclipse.iec61850.scl.ExtRef;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA; import fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.IEDName; import fr.centralesupelec.edf.riseclipse.iec61850.scl.IEDName;
...@@ -46,6 +47,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; ...@@ -46,6 +47,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseEList; import org.eclipse.emf.ecore.util.EObjectWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jdt.annotation.NonNull;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -1318,9 +1320,9 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN { ...@@ -1318,9 +1320,9 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
// lnClass The LN class according to IEC 61850-7-x // lnClass The LN class according to IEC 61850-7-x
// inst The LN instance number identifying this LN – an unsigned integer // inst The LN instance number identifying this LN – an unsigned integer
// Resolve only if attribute has been read if( getLnType() == null ) return;
// Cannot use isSetLnType() Here DataTypeTemplates dtt = get_DataTypeTemplates();
if( !lnTypeESet ) return; if( dtt == null ) return;
// find an LNodeType with // find an LNodeType with
// LNodeType.id == AnyLN.lnType // LNodeType.id == AnyLN.lnType
...@@ -1328,7 +1330,7 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN { ...@@ -1328,7 +1330,7 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
@Override @Override
public Boolean caseLNodeType( LNodeType object ) { public Boolean caseLNodeType( LNodeType object ) {
return object.getId().equals( getLnType() ); return getLnType().equals( object.getId() );
} }
@Override @Override
...@@ -1338,21 +1340,21 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN { ...@@ -1338,21 +1340,21 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
}; };
List< LNodeType > res = shallowSearchObjects( getSCLRoot().getDataTypeTemplates().getLNodeType(), s ); List< LNodeType > res = shallowSearchObjects( dtt.getLNodeType(), s );
String mess = "LNodeType( id = " + getLnType() + ", lnClass = " + getLnClass() + " ) for AnyLN on line " String mess = "LNodeType( id = " + getLnType() + ", lnClass = " + getLnClass() + " ) for AnyLN on line "
+ getLineNumber() + " ( inst = " + getInst() + " )"; + getLineNumber() + " ( inst = " + getInst() + " )";
if( res.isEmpty() ) { if( res.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess );
return;
} }
else if( res.size() > 1 ) { if( res.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess );
return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess ); setRefersToLNodeType( res.get( 0 ) );
setRefersToLNodeType( res.get( 0 ) ); if( ( getLnClass() != null ) && ! getLnClass().equals( refersToLNodeType.getLnClass() ) ) {
if( ( lnClass != null ) && !lnClass.equals( refersToLNodeType.getLnClass() ) ) { AbstractRiseClipseConsole.getConsole().error( "lnClass in " + mess + " is not " + lnClass );
AbstractRiseClipseConsole.getConsole().error( "lnClass in " + mess + " is not " + lnClass );
}
} }
} }
......
...@@ -988,8 +988,11 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -988,8 +988,11 @@ public class AssociationImpl extends BaseElementImpl implements Association {
// prefix The LN prefix // prefix The LN prefix
// lnInst The instance number of the client LN // lnInst The instance number of the client LN
// Resolve only if attribute has been read if( getIedName() == null ) return;
if( !isSetIedName() ) return; if( getLdInst() == null ) return;
if( getLnClass() == null ) return;
List< IED > ieds = get_IEDs();
if( ieds == null ) return;
// find an IED with // find an IED with
// IED.name == Association.iedName // IED.name == Association.iedName
...@@ -997,7 +1000,7 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -997,7 +1000,7 @@ public class AssociationImpl extends BaseElementImpl implements Association {
@Override @Override
public Boolean caseIED( IED object ) { public Boolean caseIED( IED object ) {
return object.getName().equals( getIedName() ); return getIedName().equals( object.getName() );
} }
@Override @Override
...@@ -1008,20 +1011,18 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1008,20 +1011,18 @@ public class AssociationImpl extends BaseElementImpl implements Association {
}; };
IED ied = null; IED ied = null;
List< IED > res = shallowSearchObjects( getSCLRoot().getIED(), s ); List< IED > res = shallowSearchObjects( ieds, s );
String mess = "IED( name = " + getIedName() + " ) for Association on line " + getLineNumber() + " )"; String mess = "IED( name = " + getIedName() + " ) for Association on line " + getLineNumber() + " )";
if( res.isEmpty() ) { if( res.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess );
return; return;
} }
else if( res.size() > 1 ) { if( res.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess ); ied = res.get( 0 );
ied = res.get( 0 );
}
// The following is copy/paste from ExtRef/FCDA // The following is copy/paste from ExtRef/FCDA
// TODO: factor out ? // TODO: factor out ?
...@@ -1032,7 +1033,7 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1032,7 +1033,7 @@ public class AssociationImpl extends BaseElementImpl implements Association {
@Override @Override
public Boolean caseLDevice( LDevice object ) { public Boolean caseLDevice( LDevice object ) {
return object.getInst().equals( getLdInst() ); return getLdInst().equals( object.getInst() );
} }
@Override @Override
...@@ -1050,14 +1051,12 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1050,14 +1051,12 @@ public class AssociationImpl extends BaseElementImpl implements Association {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 );
return; return;
} }
else if( res1.size() > 1 ) { if( res1.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess2 );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess2 ); lDevice = res1.get( 0 );
lDevice = res1.get( 0 );
}
if( "LLN0".equals( getLnClass() ) ) { if( "LLN0".equals( getLnClass() ) ) {
if( lDevice.getLN0() == null ) { if( lDevice.getLN0() == null ) {
...@@ -1066,16 +1065,12 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1066,16 +1065,12 @@ public class AssociationImpl extends BaseElementImpl implements Association {
+ " )" ); + " )" );
return; return;
} }
else { setRefersToAnyLN( lDevice.getLN0() );
setRefersToAnyLN( lDevice.getLN0() );
}
} }
else { else {
// Resolve only if attribute has been read if( getLnInst() == null ) return;
if( !lnClassESet ) return;
if( !lnInstESet ) return;
// prefix is optional // prefix is optional
//if( ! prefixESet ) return; //if( getPrefix() == null ) return;
// find inside an LN with // find inside an LN with
// LN.lnClass == Association.lnClass // LN.lnClass == Association.lnClass
...@@ -1085,9 +1080,9 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1085,9 +1080,9 @@ public class AssociationImpl extends BaseElementImpl implements Association {
@Override @Override
public Boolean caseLN( LN object ) { public Boolean caseLN( LN object ) {
if( object.getLnClass().equals( getLnClass() ) && object.getInst().equals( getLnInst() ) ) { if( getLnClass().equals( object.getLnClass() ) && getLnInst().equals( object.getInst() ) ) {
if( object.getPrefix() == null ) return getPrefix() == null; if( getPrefix() == null ) return object.getPrefix() == null;
return object.getPrefix().equals( getPrefix() ); return getPrefix().equals( object.getPrefix() );
} }
return false; return false;
} }
...@@ -1106,14 +1101,12 @@ public class AssociationImpl extends BaseElementImpl implements Association { ...@@ -1106,14 +1101,12 @@ public class AssociationImpl extends BaseElementImpl implements Association {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 );
return; return;
} }
else if( res2.size() > 1 ) { if( res2.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess3 );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess3 ); setRefersToAnyLN( res2.get( 0 ) );
setRefersToAnyLN( res2.get( 0 ) );
}
} }
} }
......
...@@ -22,6 +22,7 @@ import java.util.List; ...@@ -22,6 +22,7 @@ import java.util.List;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.BDA; import fr.centralesupelec.edf.riseclipse.iec61850.scl.BDA;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DAType; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DAType;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataTypeTemplates;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.EnumType; import fr.centralesupelec.edf.riseclipse.iec61850.scl.EnumType;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage; import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclSwitch; import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclSwitch;
...@@ -225,8 +226,9 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA { ...@@ -225,8 +226,9 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA {
// TODO: put in AbstractDataType // TODO: put in AbstractDataType
// Resolve only if attribute has been read if( getType() == null ) return;
if( !typeESet ) return; DataTypeTemplates dtt = get_DataTypeTemplates();
if( dtt == null ) return;
if( "Enum".equals( getBType() ) ) { if( "Enum".equals( getBType() ) ) {
...@@ -236,7 +238,7 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA { ...@@ -236,7 +238,7 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA {
@Override @Override
public Boolean caseEnumType( EnumType object ) { public Boolean caseEnumType( EnumType object ) {
return object.getId().equals( getType() ); return getType().equals( object.getId() );
} }
@Override @Override
...@@ -246,18 +248,18 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA { ...@@ -246,18 +248,18 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA {
}; };
List< EnumType > res = shallowSearchObjects( getSCLRoot().getDataTypeTemplates().getEnumType(), s ); List< EnumType > res = shallowSearchObjects( dtt.getEnumType(), s );
String mess = "EnumType( id = " + getType() + " ) for BDA on line " + getLineNumber() + " )"; String mess = "EnumType( id = " + getType() + " ) for BDA on line " + getLineNumber() + " )";
if( res.isEmpty() ) { if( res.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess );
return;
} }
else if( res.size() > 1 ) { if( res.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess );
return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess ); setRefersToEnumType( res.get( 0 ) );
setRefersToEnumType( res.get( 0 ) );
}
} }
else if( "Struct".equals( getBType() ) ) { else if( "Struct".equals( getBType() ) ) {
...@@ -267,7 +269,7 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA { ...@@ -267,7 +269,7 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA {
@Override @Override
public Boolean caseDAType( DAType object ) { public Boolean caseDAType( DAType object ) {
return object.getId().equals( getType() ); return getType().equals( object.getId() );
} }
@Override @Override
...@@ -277,19 +279,19 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA { ...@@ -277,19 +279,19 @@ public class BDAImpl extends AbstractDataAttributeImpl implements BDA {
}; };
List< DAType > res = shallowSearchObjects( getSCLRoot().getDataTypeTemplates().getDAType(), s ); List< DAType > res = shallowSearchObjects( dtt.getDAType(), s );
String mess = "DAType( id = " + getType() + " ) for BDA on line " + getLineNumber() + " )"; String mess = "DAType( id = " + getType() + " ) for BDA on line " + getLineNumber() + " )";
if( res.isEmpty() ) { if( res.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess );
return;
} }
else if( res.size() > 1 ) { if( res.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess );
return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess ); // TODO
// TODO //daType = res.get( 0 );
//daType = res.get( 0 );
}
} }
} }
} //BDAImpl } //BDAImpl
...@@ -988,8 +988,11 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -988,8 +988,11 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
// lnInst The instance id of this LN instance of below LN class in the IED // lnInst The instance id of this LN instance of below LN class in the IED
// desc optional descriptive text, e.g. about purpose of the client // desc optional descriptive text, e.g. about purpose of the client
// Resolve only if attribute has been read if( getIedName() == null ) return;
if( ! isSetIedName() ) return; if( getLdInst() == null ) return;
if( getLnClass() == null ) return;
List< IED > ieds = get_IEDs();
if( ieds == null ) return;
// find an IED with // find an IED with
// IED.name == ClientLN.iedName // IED.name == ClientLN.iedName
...@@ -997,7 +1000,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -997,7 +1000,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
@Override @Override
public Boolean caseIED( IED object ) { public Boolean caseIED( IED object ) {
return object.getName().equals( getIedName() ); return getIedName().equals( object.getName() );
} }
@Override @Override
...@@ -1008,20 +1011,18 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1008,20 +1011,18 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
}; };
IED ied = null; IED ied = null;
List< IED > res = shallowSearchObjects( getSCLRoot().getIED(), s ); List< IED > res = shallowSearchObjects( ieds, s );
String mess = "IED( name = " + getIedName() + " ) for ClientLN on line " + getLineNumber() + " )"; String mess = "IED( name = " + getIedName() + " ) for ClientLN on line " + getLineNumber() + " )";
if( res.isEmpty() ) { if( res.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess );
return; return;
} }
else if( res.size() > 1 ) { if( res.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess ); ied = res.get( 0 );
ied = res.get( 0 );
}
// The following is copy/paste from ExtRef/FCDA // The following is copy/paste from ExtRef/FCDA
// TODO: factor out ? // TODO: factor out ?
...@@ -1032,7 +1033,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1032,7 +1033,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
@Override @Override
public Boolean caseLDevice( LDevice object ) { public Boolean caseLDevice( LDevice object ) {
return object.getInst().equals( getLdInst() ); return getLdInst().equals( object.getInst() );
} }
@Override @Override
...@@ -1050,14 +1051,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1050,14 +1051,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 );
return; return;
} }
else if( res1.size() > 1 ) { if( res1.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess2 );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess2 ); lDevice = res1.get( 0 );
lDevice = res1.get( 0 );
}
if( "LLN0".equals( getLnClass() ) ) { if( "LLN0".equals( getLnClass() ) ) {
if( lDevice.getLN0() == null ) { if( lDevice.getLN0() == null ) {
...@@ -1065,16 +1064,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1065,16 +1064,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
+ " ( in ied = " + ied.getName() + " )" ); + " ( in ied = " + ied.getName() + " )" );
return; return;
} }
else { setRefersToAnyLN( lDevice.getLN0() );
setRefersToAnyLN( lDevice.getLN0() );
}
} }
else { else {
// Resolve only if attribute has been read if( getLnInst() == null ) return;
if( !lnClassESet ) return;
if( !lnInstESet ) return;
// prefix is optional // prefix is optional
//if( ! prefixESet ) return; //if( getPrefix() == null ) return;
// find inside an LN with // find inside an LN with
// LN.lnClass == ClientLN.lnClass // LN.lnClass == ClientLN.lnClass
...@@ -1084,7 +1079,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1084,7 +1079,7 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
@Override @Override
public Boolean caseLN( LN object ) { public Boolean caseLN( LN object ) {
if( object.getLnClass().equals( getLnClass() ) && object.getInst().equals( getLnInst() ) ) { if( getLnClass().equals( object.getLnClass() ) && getLnInst().equals( object.getInst() ) ) {
if( object.getPrefix() == null ) return getPrefix() == null; if( object.getPrefix() == null ) return getPrefix() == null;
return object.getPrefix().equals( getPrefix() ); return object.getPrefix().equals( getPrefix() );
} }
...@@ -1105,14 +1100,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN { ...@@ -1105,14 +1100,12 @@ public class ClientLNImpl extends ExplicitLinkResolverImpl implements ClientLN {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 ); AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 );
return; return;
} }
else if( res2.size() > 1 ) { if( res2.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 ); AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 );
return; return;
} }
else { //AbstractRiseClipseConsole.getConsole().info( "found " + mess3 );
//AbstractRiseClipseConsole.getConsole().info( "found " + mess3 ); setRefersToAnyLN( res2.get( 0 ) );
setRefersToAnyLN( res2.get( 0 ) );
}
} }
} }
......
...@@ -937,9 +937,10 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP { ...@@ -937,9 +937,10 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP {
// apName a name identifying this access point within the IED // apName a name identifying this access point within the IED
// desc some descriptive text for this access point at this subnetwork // desc some descriptive text for this access point at this subnetwork
// Resolve only if attribute has been read if( getIedName() == null ) return;
// Cannot use isSetApName() Here if( getApName() == null ) return;
if( !apNameESet ) return; List< IED > ieds = get_IEDs();
if( ieds == null ) return;
// find an IED with // find an IED with
// IED.name == ConnectedAP.iedName // IED.name == ConnectedAP.iedName
...@@ -947,7 +948,7 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP { ...@@ -947,7 +948,7 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP {
@Override @Override
public Boolean caseIED( IED object ) { public Boolean caseIED( IED object ) {
return object.getName().equals( getIedName() ); return getIedName().equals( object.getName() );
} }
@Override @Override
...@@ -957,7 +958,7 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP { ...@@ -957,7 +958,7 @@ public class ConnectedAPImpl extends UnNamingImpl implements ConnectedAP {
}; };
List< IED > res1 = shallowSearchObjects( getSCLRoot().getIED(), s1 ); List< IED > res1 = shallowSearchObjects( ieds, s1 );
IED ied = null;