Skip to content

Commit

Permalink
Rossystem metamodel: add ComponentRef to reference rosnode in process…
Browse files Browse the repository at this point in the history
…; uncapitalize index
  • Loading branch information
ipa-rwu committed May 10, 2023
1 parent 3437f51 commit d1ce353
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 45 deletions.
56 changes: 32 additions & 24 deletions plugins/de.fraunhofer.ipa.rossystem/model/rossystem.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,76 @@
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="system" nsURI="http://www.ipa.fraunhofer.de/rossystem" nsPrefix="system">
<eClassifiers xsi:type="ecore:EClass" name="System">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Processes" upperBound="-1"
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="processes" upperBound="-1"
eType="#//Process" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Components" upperBound="-1"
<eStructuralFeatures xsi:type="ecore:EReference" name="components" upperBound="-1"
eType="#//Component" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Connections" upperBound="-1"
<eStructuralFeatures xsi:type="ecore:EReference" name="connections" upperBound="-1"
eType="#//Connection" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Parameter" upperBound="-1"
eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Parameter"
derived="true" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="parameter" upperBound="-1"
eType="#//RosParameter" derived="true" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Rossystem" eSuperTypes="#//System"/>
<eClassifiers xsi:type="ecore:EClass" name="Process">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Threads" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Nodes" upperBound="-1"
eType="#//RosNode"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="threads" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
eType="#//Component" containment="true"/>

This comment has been minimized.

Copy link
@ipa-nhg

ipa-nhg May 16, 2023

Member

contaiment here should be false, you want to do a reference of defined components, you don't want to create it new within the process definition

</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Component" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="Connection" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="RosNode" eSuperTypes="#//Component">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Node"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Node"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rosinterfaces" upperBound="-1"
eType="#//RosInterface" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rosparameters" upperBound="-1"
eType="#//RosParameter" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosInterface">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Reference" lowerBound="1"
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="reference" lowerBound="1"
eType="#//InterfaceReference" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="InterfaceReference"/>
<eClassifiers xsi:type="ecore:EClass" name="RosPublisherReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Publisher"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Publisher"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosSubscriberReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Subscriber"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Subscriber"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosServiceServerReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ServiceServer"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ServiceServer"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosServerClientReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ServiceClient"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ServiceClient"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosActionServerReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ActionServer"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ActionServer"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosActionClientReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ActionClient"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ActionClient"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosParameterReference" eSuperTypes="#//InterfaceReference">
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Parameter"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Parameter"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosParameter">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="value" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//ParameterValue"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="From" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Parameter"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="ecore:EClass ../../de.fraunhofer.ipa.ros/model/ros.ecore#//Parameter"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RosConnection" eSuperTypes="#//Connection">
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="#//RosInterface"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//RosInterface"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SystemRef">

This comment has been minimized.

Copy link
@ipa-nhg

ipa-nhg May 16, 2023

Member

why we need this? where do we need to reference a System?

<eStructuralFeatures xsi:type="ecore:EReference" name="systemRef" lowerBound="1"
eType="#//System"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ComponentRef" eSuperTypes="#//Component">

This comment has been minimized.

Copy link
@ipa-nhg

ipa-nhg May 16, 2023

Member

This is not needed, it just adds complexity. If for the process you define the components as not containment (d1ce353#r113516155) you can perfectly build your grammar.

<eStructuralFeatures xsi:type="ecore:EReference" name="componentRef" lowerBound="1"
eType="#//Component"/>
</eClassifiers>
</ecore:EPackage>
49 changes: 28 additions & 21 deletions plugins/de.fraunhofer.ipa.rossystem/model/rossystem.genmodel
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,66 @@
<foreignModel>rossystem.ecore</foreignModel>
<genPackages prefix="Rossystem" disposableProviderFactory="true" ecorePackage="rossystem.ecore#/">
<genClasses ecoreClass="rossystem.ecore#//System">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//System/Name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/Processes"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/Components"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/Connections"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/Parameter"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//System/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/processes"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/components"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/connections"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//System/parameter"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//Rossystem"/>
<genClasses ecoreClass="rossystem.ecore#//Process">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//Process/Name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//Process/Threads"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//Process/Nodes"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//Process/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//Process/threads"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//Process/nodes"/>
</genClasses>
<genClasses image="false" ecoreClass="rossystem.ecore#//Component"/>
<genClasses image="false" ecoreClass="rossystem.ecore#//Connection"/>
<genClasses ecoreClass="rossystem.ecore#//RosNode">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosNode/Name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosNode/From"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosNode/name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosNode/from"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosNode/rosinterfaces"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosNode/rosparameters"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosInterface">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosInterface/Name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosInterface/Reference"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosInterface/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosInterface/reference"/>
</genClasses>
<genClasses image="false" ecoreClass="rossystem.ecore#//InterfaceReference"/>
<genClasses ecoreClass="rossystem.ecore#//RosPublisherReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosPublisherReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosPublisherReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosSubscriberReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosSubscriberReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosSubscriberReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosServiceServerReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosServiceServerReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosServiceServerReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosServerClientReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosServerClientReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosServerClientReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosActionServerReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosActionServerReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosActionServerReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosActionClientReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosActionClientReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosActionClientReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosParameterReference">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosParameterReference/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosParameterReference/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosParameter">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosParameter/Name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute rossystem.ecore#//RosParameter/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosParameter/value"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosParameter/From"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosParameter/from"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//RosConnection">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosConnection/from"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//RosConnection/to"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//SystemRef">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//SystemRef/systemRef"/>
</genClasses>
<genClasses ecoreClass="rossystem.ecore#//ComponentRef">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference rossystem.ecore#//ComponentRef/componentRef"/>
</genClasses>
</genPackages>
</genmodel:GenModel>

0 comments on commit d1ce353

Please sign in to comment.