Commit abc80b54 authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '42-remove-explicitlinkresolver' into 'master'

Resolve "remove ExplicitLinkResolver"

Closes #42

See merge request RiseClipseGroup/RiseClipseMetamodel_SCL2003!38
parents f213adfa c0839273
......@@ -1288,3 +1288,5 @@ _UI_SDO_ReferredBySDI_feature = Referred By SDI
_UI_DAI_RefersToAbstractDataAttribute_feature = Refers To Abstract Data Attribute
_UI_SDI_RefersToSDO_feature = Refers To SDO
_UI_SDI_RefersToAbstractDataAttribute_feature = Refers To Abstract Data Attribute
_UI_IRiseClipseConsole_type = IRise Clipse Console
_UI_SclObject_explicitLinksBuilt_feature = Explicit Links Built
......@@ -38,7 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* @generated
*/
public class BaseElementItemProvider
extends ExplicitLinkResolverItemProvider {
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
......@@ -37,7 +37,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* <!-- end-user-doc -->
* @generated
*/
public class ClientLNItemProvider extends ExplicitLinkResolverItemProvider {
public class ClientLNItemProvider extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
......@@ -38,7 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* @generated
*/
public class DataTypeTemplatesItemProvider
extends ExplicitLinkResolverItemProvider {
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
/**
* Copyright (c) 2018 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl.provider;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.ExplicitLinkResolver;
/**
* This is the item provider adapter for a {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.ExplicitLinkResolver} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ExplicitLinkResolverItemProvider
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExplicitLinkResolverItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
ExplicitLinkResolver explicitLinkResolver = (ExplicitLinkResolver)object;
return getString("_UI_ExplicitLinkResolver_type") + " " + explicitLinkResolver.getLineNumber();
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
......@@ -38,7 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* @generated
*/
public class FCDAItemProvider
extends ExplicitLinkResolverItemProvider {
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
......@@ -38,7 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* @generated
*/
public class IEDNameItemProvider
extends ExplicitLinkResolverItemProvider {
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
......@@ -38,7 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* @generated
*/
public class KDCItemProvider
extends ExplicitLinkResolverItemProvider {
extends SclObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
......
......@@ -77,6 +77,7 @@ public class SclObjectItemProvider
super.getPropertyDescriptors(object);
addLineNumberPropertyDescriptor(object);
addExplicitLinksBuiltPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -104,6 +105,28 @@ public class SclObjectItemProvider
}
/**
* This adds a property descriptor for the Explicit Links Built feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addExplicitLinksBuiltPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_SclObject_explicitLinksBuilt_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_SclObject_explicitLinksBuilt_feature", "_UI_SclObject_type"),
SclPackage.eINSTANCE.getSclObject_ExplicitLinksBuilt(),
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -129,6 +152,7 @@ public class SclObjectItemProvider
switch (notification.getFeatureID(SclObject.class)) {
case SclPackage.SCL_OBJECT__LINE_NUMBER:
case SclPackage.SCL_OBJECT__EXPLICIT_LINKS_BUILT:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
......
......@@ -43,7 +43,7 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BaseElement" abstract="true" eSuperTypes="#//ExplicitLinkResolver">
<eClassifiers xsi:type="ecore:EClass" name="BaseElement" abstract="true" eSuperTypes="#//SclObject">
<eStructuralFeatures xsi:type="ecore:EReference" name="Private" ordered="false"
upperBound="-1" eType="#//Private" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//Private/ParentBaseElement"/>
......@@ -451,7 +451,7 @@
eType="#//SDO" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//SDO/ParentDOType"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DataTypeTemplates" eSuperTypes="#//ExplicitLinkResolver">
<eClassifiers xsi:type="ecore:EClass" name="DataTypeTemplates" eSuperTypes="#//SclObject">
<eStructuralFeatures xsi:type="ecore:EReference" name="DAType" ordered="false"
upperBound="-1" eType="#//DAType" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//DAType/ParentDataTypeTemplates"/>
......@@ -694,7 +694,7 @@
eType="#//IssuerName" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//IssuerName/ParentCertificate"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ClientLN" eSuperTypes="#//ExplicitLinkResolver #//AgLNRef">
<eClassifiers xsi:type="ecore:EClass" name="ClientLN" eSuperTypes="#//SclObject #//AgLNRef">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="apRef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ParentRptEnabled" ordered="false"
......@@ -949,7 +949,7 @@
eType="#//Control" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//Control/ReferredByExtRef"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FCDA" eSuperTypes="#//ExplicitLinkResolver">
<eClassifiers xsi:type="ecore:EClass" name="FCDA" eSuperTypes="#//SclObject">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="daName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="doName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
......@@ -1089,7 +1089,7 @@
eType="#//IEDName" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//IEDName/RefersToIED"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IEDName" eSuperTypes="#//ExplicitLinkResolver">
<eClassifiers xsi:type="ecore:EClass" name="IEDName" eSuperTypes="#//SclObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="simple"/>
</eAnnotations>
......@@ -1134,7 +1134,7 @@
eType="#//Certificate" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//Certificate/IssuerName"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="KDC" eSuperTypes="#//ExplicitLinkResolver">
<eClassifiers xsi:type="ecore:EClass" name="KDC" eSuperTypes="#//SclObject">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="apName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="iedName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
......@@ -2121,8 +2121,6 @@
<eLiterals name="buffered" value="1"/>
<eLiterals name="both" value="2"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ExplicitLinkResolver" abstract="true"
eSuperTypes="#//SclObject"/>
<eClassifiers xsi:type="ecore:EClass" name="AbstractDataObject" abstract="true"
eSuperTypes="#//UnNaming">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
......@@ -2137,9 +2135,16 @@
eOpposite="#//ExtRef/RefersToAbstractDataObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SclObject" abstract="true">
<eOperations name="buildExplicitLinks" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eParameters name="console" eType="#//IRiseClipseConsole"/>
<eParameters name="forceUpdate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lineNumber" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" transient="true"
defaultValueLiteral="-1"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="explicitLinksBuilt" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" transient="true"
defaultValueLiteral="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="UnNaming" abstract="true" eSuperTypes="#//BaseElement #//AgDesc"/>
<eClassifiers xsi:type="ecore:EClass" name="ServiceYesNo" eSuperTypes="#//SclObject"/>
......@@ -2373,4 +2378,6 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="virtual" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
unsettable="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IRiseClipseConsole" instanceClassName="fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole"
abstract="true" interface="true"/>
</ecore:EPackage>
......@@ -1015,7 +1015,6 @@
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//VoltageLevel/ParentSubstation"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//VoltageLevel/Voltage"/>
</genClasses>
<genClasses image="false" ecoreClass="SCL.ecore#//ExplicitLinkResolver"/>
<genClasses image="false" ecoreClass="SCL.ecore#//AbstractDataObject">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//AbstractDataObject/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//AbstractDataObject/type"/>
......@@ -1024,6 +1023,11 @@
</genClasses>
<genClasses image="false" ecoreClass="SCL.ecore#//SclObject">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//SclObject/lineNumber"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//SclObject/explicitLinksBuilt"/>
<genOperations ecoreOperation="SCL.ecore#//SclObject/buildExplicitLinks">
<genParameters ecoreParameter="SCL.ecore#//SclObject/buildExplicitLinks/console"/>
<genParameters ecoreParameter="SCL.ecore#//SclObject/buildExplicitLinks/forceUpdate"/>
</genOperations>
</genClasses>
<genClasses image="false" ecoreClass="SCL.ecore#//UnNaming"/>
<genClasses ecoreClass="SCL.ecore#//ServiceYesNo"/>
......@@ -1139,5 +1143,6 @@
<genClasses image="false" ecoreClass="SCL.ecore#//AgVirtual">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//AgVirtual/virtual"/>
</genClasses>
<genClasses image="false" ecoreClass="SCL.ecore#//IRiseClipseConsole"/>
</genPackages>
</genmodel:GenModel>
......@@ -40,7 +40,7 @@ import org.eclipse.emf.ecore.util.FeatureMap;
* @model abstract="true"
* @generated
*/
public interface BaseElement extends ExplicitLinkResolver {
public interface BaseElement extends SclObject {
/**
* Returns the value of the '<em><b>Private</b></em>' containment reference list.
* The list contents are of type {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Private}.
......
......@@ -36,7 +36,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* @model
* @generated
*/
public interface ClientLN extends ExplicitLinkResolver, AgLNRef {
public interface ClientLN extends SclObject, AgLNRef {
/**
* Returns the value of the '<em><b>Ap Ref</b></em>' attribute.
* <!-- begin-user-doc -->
......
......@@ -40,7 +40,7 @@ import org.eclipse.emf.common.util.EList;
* @model
* @generated
*/
public interface DataTypeTemplates extends ExplicitLinkResolver {
public interface DataTypeTemplates extends SclObject {
/**
* Returns the value of the '<em><b>DA Type</b></em>' containment reference list.
* The list contents are of type {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DAType}.
......
/**
* Copyright (c) 2018 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Explicit Link Resolver</b></em>'.
* <!-- end-user-doc -->
*
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getExplicitLinkResolver()
* @model abstract="true"
* @generated
*/
public interface ExplicitLinkResolver extends SclObject {
void resolveLinks();
} // ExplicitLinkResolver
......@@ -45,7 +45,7 @@ import org.eclipse.emf.common.util.EList;
* @model
* @generated
*/
public interface FCDA extends ExplicitLinkResolver {
public interface FCDA extends SclObject {
/**
* Returns the value of the '<em><b>Da Name</b></em>' attribute.
* <!-- begin-user-doc -->
......
......@@ -43,7 +43,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* @model extendedMetaData="kind='simple'"
* @generated
*/
public interface IEDName extends ExplicitLinkResolver {
public interface IEDName extends SclObject {
/**
* Returns the value of the '<em><b>Ap Ref</b></em>' attribute.
* <!-- begin-user-doc -->
......
......@@ -37,7 +37,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* @model
* @generated
*/
public interface KDC extends ExplicitLinkResolver {
public interface KDC extends SclObject {
/**
* Returns the value of the '<em><b>Ap Name</b></em>' attribute.
* <!-- begin-user-doc -->
......
......@@ -18,6 +18,7 @@
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import org.eclipse.emf.ecore.EObject;
/**
......@@ -30,6 +31,7 @@ import org.eclipse.emf.ecore.EObject;
* </p>
* <ul>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.SclObject#getLineNumber <em>Line Number</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.SclObject#isExplicitLinksBuilt <em>Explicit Links Built</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getSclObject()
......@@ -64,4 +66,35 @@ public interface SclObject extends EObject {
*/
void setLineNumber( int value );
/**
* Returns the value of the '<em><b>Explicit Links Built</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Explicit Links Built</em>' attribute.
* @see #setExplicitLinksBuilt(boolean)
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getSclObject_ExplicitLinksBuilt()
* @model default="false" required="true" transient="true"
* @generated
*/
boolean isExplicitLinksBuilt();
/**
* Sets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.SclObject#isExplicitLinksBuilt <em>Explicit Links Built</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Explicit Links Built</em>' attribute.
* @see #isExplicitLinksBuilt()
* @generated
*/
void setExplicitLinksBuilt(boolean value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.scl.IRiseClipseConsole"
* @generated
*/
boolean buildExplicitLinks(IRiseClipseConsole console, boolean forceUpdate);
} // SclObject
......@@ -47,7 +47,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SDI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.Val;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.ValKindEnum;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclUtilities;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
/**
......@@ -1380,9 +1380,9 @@ public abstract class AbstractDataAttributeImpl extends UnNamingImpl implements
}
@Override
protected void doResolveLinks() {
protected void doBuildExplicitLinks( IRiseClipseConsole console ) {
// see Issue #13
super.doResolveLinks();
super.doBuildExplicitLinks( console );
// desc Some descriptive text for the attribute
// name The attribute name; the type tAttributeEnum restricts to the attribute names from IEC 61850-7-3, plus new ones starting with lower case letters
......@@ -1396,10 +1396,9 @@ public abstract class AbstractDataAttributeImpl extends UnNamingImpl implements
// valKind Determines how the value shall be interpreted if any is given
if( getType() == null ) return;
DataTypeTemplates dtt = get_DataTypeTemplates();
DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) return;
IRiseClipseConsole console = AbstractRiseClipseConsole.getConsole();
String messagePrefix = "while resolving link from AbstractDataAttribute on line " + getLineNumber() + ": ";
if( "Enum".equals( getBType() ) ) {
......@@ -1414,12 +1413,8 @@ public abstract class AbstractDataAttributeImpl extends UnNamingImpl implements
.collect( Collectors.toList() );
String mess = "EnumType( id = " + getType() + " )";
if( res.isEmpty() ) {
console.error( messagePrefix + "cannot find " + mess );
return;
}
if( res.size() > 1 ) {
console.error( messagePrefix + "found several " + mess );
if( res.size() != 1 ) {
SclUtilities.displayNotFoundError( console, messagePrefix, mess, res.size() );
return;
}
setRefersToEnumType( res.get( 0 ) );
......@@ -1437,12 +1432,8 @@ public abstract class AbstractDataAttributeImpl extends UnNamingImpl implements
.collect( Collectors.toList() );
String mess = "DAType( id = " + getType() + " )";
if( res.isEmpty() ) {
console.error( messagePrefix + "cannot find " + mess );
return;
}
if( res.size() > 1 ) {
console.error( messagePrefix + "found several " + mess );
if( res.size() != 1 ) {
SclUtilities.displayNotFoundError( console, messagePrefix, mess, res.size() );
return;
}
setRefersToDAType( res.get( 0 ) );
......
......@@ -33,8 +33,9 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.Log;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.ReportControl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclUtilities;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseFatalException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
......@@ -1055,13 +1056,11 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
@Override
public LDevice getParentLDevice() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
throw new RiseClipseFatalException( "AnyLN.getParentLDevice() called", null );
}
/**
......@@ -1413,19 +1412,18 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
}
@Override
protected void doResolveLinks() {
protected void doBuildExplicitLinks( IRiseClipseConsole console ) {
// see Issue #13
super.doResolveLinks();
super.doBuildExplicitLinks( console );
// lnType The instantiable type definition of this logical node, reference to a LNodeType definition
// lnClass The LN class according to IEC 61850-7-x
// inst The LN instance number identifying this LN – an unsigned integer
if( getLnType() == null ) return;
DataTypeTemplates dtt = get_DataTypeTemplates();
DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) return;
IRiseClipseConsole console = AbstractRiseClipseConsole.getConsole();
String messagePrefix = "while resolving link from AnyLN on line " + getLineNumber() + ": ";
List< LNodeType > res = //shallowSearchObjects( dtt.getLNodeType(), s );
......@@ -1436,12 +1434,8 @@ public abstract class AnyLNImpl extends UnNamingImpl implements AnyLN {
.collect( Collectors.toList() );
String mess = "LNodeType( id = " + getLnType() + " )";
if( res.isEmpty() ) {
console.error( messagePrefix + "cannot find " + mess );
return;
}
if( res.size() > 1 ) {
console.error( messagePrefix + "found several " + mess );
if( res.size() != 1 ) {
SclUtilities.displayNotFoundError( console, messagePrefix, mess, res.size() );
return;
}
setRefersToLNodeType( res.get( 0 ) );
......
......@@ -21,20 +21,17 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AgDesc;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AgLDRef;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AgLNRef;
import java.util.List;
import java.util.stream.Collectors;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.Association;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AssociationKindEnum;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.IED;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.Server;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclUtilities;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
......@@ -1167,9 +1164,9 @@ public class AssociationImpl extends BaseElementImpl implements Association {
}
@Override
protected void doResolveLinks() {
protected void doBuildExplicitLinks( IRiseClipseConsole console ) {
// see Issue #13