Skip to content

Commit

Permalink
Merge pull request #53 from riseclipse/52-add-an-attribute-to-fcda-cl…
Browse files Browse the repository at this point in the history
…ass-that-stores-the-order-number-of-a-fcda-inside-a-dataset

52 add an attribute to fcda class that stores the order number of a fcda inside a dataset
  • Loading branch information
marcadetd authored Jul 11, 2024
2 parents 42efbb6 + 67f5bb5 commit fcf9eb4
Show file tree
Hide file tree
Showing 31 changed files with 509 additions and 376 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1307,3 +1307,4 @@ _UI_LN_RefersToControlWithIEDName_feature = Refers To ControlWithIEDName
_UI_AgUuid_type = Ag Uuid
_UI_AgUuid_uuid_feature = Uuid
_UI_AgUuid_templateUuid_feature = Template Uuid
_UI_FCDA_ordNb_feature = Ord Nb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public List< IItemPropertyDescriptor > getPropertyDescriptors( Object object ) {
addLnInstPropertyDescriptor( object );
addPrefixPropertyDescriptor( object );
addRefersToAbstractDataAttributePropertyDescriptor( object );
addOrdNbPropertyDescriptor( object );
}
return itemPropertyDescriptors;
}
Expand Down Expand Up @@ -265,6 +266,27 @@ protected void addRefersToAbstractDataAttributePropertyDescriptor( Object object
null ) );
}

/**
* This adds a property descriptor for the Ord Nb feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addOrdNbPropertyDescriptor( Object object ) {
itemPropertyDescriptors.add(
createItemPropertyDescriptor( ( ( ComposeableAdapterFactory ) adapterFactory ).getRootAdapterFactory(),
getResourceLocator(),
getString( "_UI_FCDA_ordNb_feature" ),
getString( "_UI_PropertyDescriptor_description", "_UI_FCDA_ordNb_feature", "_UI_FCDA_type" ),
SclPackage.eINSTANCE.getFCDA_OrdNb(),
false,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null ) );
}

/**
* This returns FCDA.gif.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -326,6 +348,7 @@ public void notifyChanged( Notification notification ) {
case SclPackage.FCDA__LN_CLASS:
case SclPackage.FCDA__LN_INST:
case SclPackage.FCDA__PREFIX:
case SclPackage.FCDA__ORD_NB:
fireNotifyChanged( new ViewerNotification( notification, notification.getNotifier(), false, true ) );
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,8 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="ReferredByControl" ordered="false"
upperBound="-1" eType="#//Control" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//Control/RefersToDataSet"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="FCDA" ordered="false" upperBound="-1"
eType="#//FCDA" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//FCDA/ParentDataSet"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="FCDA" upperBound="-1" eType="#//FCDA"
unsettable="true" containment="true" resolveProxies="false" eOpposite="#//FCDA/ParentDataSet"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
</eClassifiers>
Expand Down Expand Up @@ -941,6 +940,8 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="RefersToAbstractDataAttribute"
ordered="false" upperBound="-1" eType="#//AbstractDataAttribute" transient="true"
unsettable="true" resolveProxies="false" eOpposite="#//AbstractDataAttribute/ReferredByFCDA"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ordNb" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
changeable="false" volatile="true" transient="true" defaultValueLiteral="-1"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FileHandling" eSuperTypes="#//SclObject">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ftp" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//FCDA/prefix"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//FCDA/ParentDataSet"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//FCDA/RefersToAbstractDataAttribute"/>
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//FCDA/ordNb"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//FileHandling">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//FileHandling/ftp"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
** are made available under the terms of the Eclipse Public License v2.0
** which accompanies this distribution, and is available at
** https://www.eclipse.org/legal/epl-v20.html
**
**
** This file is part of the RiseClipse tool
**
**
** Contributors:
** Computer Science Department, CentraleSupélec
** EDF R&D
Expand Down Expand Up @@ -122,7 +122,7 @@ public interface DataSet extends UnNaming {
* @see #unsetFCDA()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getDataSet_FCDA()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getParentDataSet
* @model opposite="ParentDataSet" containment="true" unsettable="true" ordered="false"
* @model opposite="ParentDataSet" containment="true" unsettable="true"
* @generated
*/
EList< FCDA > getFCDA();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
** are made available under the terms of the Eclipse Public License v2.0
** which accompanies this distribution, and is available at
** https://www.eclipse.org/legal/epl-v20.html
**
**
** This file is part of the RiseClipse tool
**
**
** Contributors:
** Computer Science Department, CentraleSupélec
** EDF R&D
Expand Down Expand Up @@ -41,6 +41,7 @@
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getPrefix <em>Prefix</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getParentDataSet <em>Parent Data Set</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getRefersToAbstractDataAttribute <em>Refers To Abstract Data Attribute</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getOrdNb <em>Ord Nb</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getFCDA()
Expand Down Expand Up @@ -537,4 +538,16 @@ public interface FCDA extends SclObject {
*/
boolean isSetRefersToAbstractDataAttribute();

/**
* Returns the value of the '<em><b>Ord Nb</b></em>' attribute.
* The default value is <code>"-1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Ord Nb</em>' attribute.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getFCDA_OrdNb()
* @model default="-1" transient="true" changeable="false" volatile="true"
* @generated
*/
int getOrdNb();

} // FCDA
Original file line number Diff line number Diff line change
Expand Up @@ -11433,14 +11433,23 @@ public interface SclPackage extends EPackage {
*/
int FCDA__REFERS_TO_ABSTRACT_DATA_ATTRIBUTE = SCL_OBJECT_FEATURE_COUNT + 9;

/**
* The feature id for the '<em><b>Ord Nb</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FCDA__ORD_NB = SCL_OBJECT_FEATURE_COUNT + 10;

/**
* The number of structural features of the '<em>FCDA</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FCDA_FEATURE_COUNT = SCL_OBJECT_FEATURE_COUNT + 10;
int FCDA_FEATURE_COUNT = SCL_OBJECT_FEATURE_COUNT + 11;

/**
* The operation id for the '<em>Build Explicit Links</em>' operation.
Expand Down Expand Up @@ -28590,6 +28599,17 @@ public interface SclPackage extends EPackage {
*/
EReference getFCDA_RefersToAbstractDataAttribute();

/**
* Returns the meta object for the attribute '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getOrdNb <em>Ord Nb</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Ord Nb</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.FCDA#getOrdNb()
* @see #getFCDA()
* @generated
*/
EAttribute getFCDA_OrdNb();

/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.FileHandling <em>File Handling</em>}'.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,8 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
//@formatter:off

console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AbstractDataAttributeImpl.doBuildExplicitLinks()" );

Expand All @@ -1549,18 +1551,18 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
if( !( "Enum".equals( getBType() ) || "Struct".equals( getBType() ) ) ) {
return;
}
// String messagePrefix = "while resolving link from AbstractDataAttribute: ";
// String messagePrefix = "while resolving link from AbstractDataAttribute: ";

if( ( getType() == null ) || getType().isEmpty() ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "type is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "type is missing" );
return;
}

DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
return;
}

Expand All @@ -1575,9 +1577,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " EnumType( id = ", getType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " EnumType( id = ", getType(), " )" );
return;
}
setRefersToEnumType( res.get( 0 ) );
Expand All @@ -1596,16 +1598,18 @@ else if( "Struct".equals( getBType() ) ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " DAType( id = ", getType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " DAType( id = ", getType(), " )" );
return;
}
setRefersToDAType( res.get( 0 ) );
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AbstractDataAttribute refers to EnumType( id = ", getType(), " ) on line ",
getRefersToDAType().getLineNumber() );
}

//@formatter:on
}

} //AbstractDataAttributeImpl
Original file line number Diff line number Diff line change
Expand Up @@ -1511,17 +1511,17 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// lnClass The LN class according to IEC 61850-7-x
// inst The LN instance number identifying this LN – an unsigned integer

// String messagePrefix = "while resolving link from AnyLN on line: ";
// String messagePrefix = "while resolving link from AnyLN on line: ";

if( ( getLnType() == null ) || getLnType().isEmpty() ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnType is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnType is missing" );
return;
}
DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
return;
}

Expand All @@ -1532,9 +1532,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " LNodeType( id = ", getLnType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " LNodeType( id = ", getLnType(), " )" );
return;
}
setRefersToLNodeType( res.get( 0 ) );
Expand All @@ -1543,9 +1543,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
" ) on line ", getRefersToLNodeType().getLineNumber() );

if( ( getLnClass() != null ) && !getLnClass().equals( getRefersToLNodeType().getLnClass() ) ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass in LNodeType( id = ", getLnType(), " ) is ",
// getRefersToLNodeType().getLnClass(), " and not ", getLnClass() );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass in LNodeType( id = ", getLnType(), " ) is ",
// getRefersToLNodeType().getLnClass(), " and not ", getLnClass() );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,8 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
//@formatter:off

console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AssociationImpl.doBuildExplicitLinks()" );

Expand All @@ -1317,28 +1319,28 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from Association: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "iedName is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "iedName is missing " );
return;
}
if( ( getLdInst() == null ) || getLdInst().isEmpty() ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "ldInst is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "ldInst is missing " );
return;
}
if( ( getLnClass() == null ) || getLnClass().isEmpty() ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass is missing " );
return;
}

// find an IED with
// IED.name == Association.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
// " IED( name = ", getIedName(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
// " IED( name = ", getIedName(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1349,9 +1351,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// LDevice.name == Association.ldInst
Pair< LDevice, Integer > lDevice = SclUtilities.getLDevice( ied.getLeft(), getLdInst() );
if( lDevice.getLeft() == null ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
// " LDevice( inst = ", getLdInst(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
// " LDevice( inst = ", getLdInst(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1369,14 +1371,16 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
}
mess += " )";
if( anyLN.getLeft() == null ) {
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
return;
}
setRefersToAnyLN( anyLN.getLeft() );
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"Association refers to ", mess, " on line ",
getRefersToAnyLN().getLineNumber() );

//@formatter:on
}

} //AssociationImpl
Loading

0 comments on commit fcf9eb4

Please sign in to comment.