Skip to content

Commit

Permalink
Add subsystems to the RosSystem model
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-nhg committed Sep 5, 2023
1 parent 3154341 commit a21d697
Show file tree
Hide file tree
Showing 37 changed files with 7,840 additions and 6,900 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions plugins/de.fraunhofer.ipa.rossystem.edit/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,5 @@ _UI_RosActionConnection_to_feature = To
_UI_RosServiceClientReference_type = Ros Service Client Reference
_UI_RosServiceClientReference_from_feature = From
_UI_System_fromFile_feature = From File
_UI_SubSystem_type = Sub System
_UI_SubSystem_system_feature = System
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,29 @@ public Adapter createRosActionConnectionAdapter() {
}

/**
* This keeps track of the one adapter used for all {@link system.SubSystem} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SubSystemItemProvider subSystemItemProvider;

/**
* This creates an adapter for a {@link system.SubSystem}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createSubSystemAdapter() {
if (subSystemItemProvider == null) {
subSystemItemProvider = new SubSystemItemProvider(this);
}

return subSystemItemProvider;
}

/**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -632,6 +655,7 @@ public void dispose() {
if (rosTopicConnectionItemProvider != null) rosTopicConnectionItemProvider.dispose();
if (rosServiceConnectionItemProvider != null) rosServiceConnectionItemProvider.dispose();
if (rosActionConnectionItemProvider != null) rosActionConnectionItemProvider.dispose();
if (subSystemItemProvider != null) subSystemItemProvider.dispose();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
*/
package system.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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;

import system.RossystemPackage;

/**
* This is the item provider adapter for a {@link system.SubSystem} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class SubSystemItemProvider extends ComponentItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubSystemItemProvider(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);

addSystemPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}

/**
* This adds a property descriptor for the System feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSystemPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_SubSystem_system_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_SubSystem_system_feature", "_UI_SubSystem_type"),
RossystemPackage.Literals.SUB_SYSTEM__SYSTEM,
true,
false,
true,
null,
null,
null));
}

/**
* This returns SubSystem.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/SubSystem"));
}

/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
return getString("_UI_SubSystem_type");
}


/**
* 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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
(RossystemPackage.Literals.SYSTEM__COMPONENTS,
RossystemFactory.eINSTANCE.createRosNode()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.SYSTEM__COMPONENTS,
RossystemFactory.eINSTANCE.createSubSystem()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.SYSTEM__CONNECTIONS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ private static void init(ImmutableMap.Builder<AbstractElement, String> builder,
builder.put(grammarAccess.getArraySpecRefAccess().getGroup(), "rule__ArraySpecRef__Group__0");
builder.put(grammarAccess.getRosSystemAccess().getNameAssignment_0(), "rule__RosSystem__NameAssignment_0");
builder.put(grammarAccess.getRosSystemAccess().getFromFileAssignment_3_1(), "rule__RosSystem__FromFileAssignment_3_1");
builder.put(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_0_2(), "rule__RosSystem__ProcessesAssignment_4_0_2");
builder.put(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_1_2(), "rule__RosSystem__ComponentsAssignment_4_1_2");
builder.put(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_0_2(), "rule__RosSystem__ComponentsAssignment_4_0_2");
builder.put(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_1_2(), "rule__RosSystem__ProcessesAssignment_4_1_2");
builder.put(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_2_2(), "rule__RosSystem__ComponentsAssignment_4_2_2");
builder.put(grammarAccess.getRosSystemAccess().getParameterAssignment_4_3_2(), "rule__RosSystem__ParameterAssignment_4_3_2");
builder.put(grammarAccess.getRosSystemAccess().getConnectionsAssignment_4_4_2(), "rule__RosSystem__ConnectionsAssignment_4_4_2");
builder.put(grammarAccess.getSubSystemAccess().getSystemAssignment(), "rule__SubSystem__SystemAssignment");
builder.put(grammarAccess.getProcessAccess().getNameAssignment_1(), "rule__Process__NameAssignment_1");
builder.put(grammarAccess.getProcessAccess().getComponentsAssignment_4_2(), "rule__Process__ComponentsAssignment_4_2");
builder.put(grammarAccess.getProcessAccess().getComponentsAssignment_4_3_1(), "rule__Process__ComponentsAssignment_4_3_1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ import de.fraunhofer.ipa.rossystem.services.RosSystemGrammarAccess;
tokenNameToValue.put("Float64_1", "'float64[]'");
tokenNameToValue.put("FromFile", "'fromFile:'");
tokenNameToValue.put("Processes", "'processes:'");
tokenNameToValue.put("SubSystem", "'subSystem:'");
tokenNameToValue.put("Interfaces", "'interfaces:'");
tokenNameToValue.put("Parameters", "'parameters:'");
tokenNameToValue.put("SubSystems", "'subSystems:'");
tokenNameToValue.put("ParameterAny", "'ParameterAny'");
tokenNameToValue.put("Connections", "'connections:'");
tokenNameToValue.put("GlobalNamespace", "'GlobalNamespace'");
Expand Down Expand Up @@ -184,6 +184,31 @@ finally {
restoreStackSize(stackSize);
}

// Entry rule entryRuleSubSystem
entryRuleSubSystem
:
{ before(grammarAccess.getSubSystemRule()); }
ruleSubSystem
{ after(grammarAccess.getSubSystemRule()); }
EOF
;

// Rule SubSystem
ruleSubSystem
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getSubSystemAccess().getSystemAssignment()); }
(rule__SubSystem__SystemAssignment)
{ after(grammarAccess.getSubSystemAccess().getSystemAssignment()); }
)
;
finally {
restoreStackSize(stackSize);
}

// Entry rule entryRuleProcess
entryRuleProcess
:
Expand Down Expand Up @@ -3113,9 +3138,9 @@ rule__RosSystem__Group_4_0__0__Impl
}
:
(
{ before(grammarAccess.getRosSystemAccess().getProcessesKeyword_4_0_0()); }
Processes
{ after(grammarAccess.getRosSystemAccess().getProcessesKeyword_4_0_0()); }
{ before(grammarAccess.getRosSystemAccess().getSubSystemsKeyword_4_0_0()); }
SubSystems
{ after(grammarAccess.getRosSystemAccess().getSubSystemsKeyword_4_0_0()); }
)
;
finally {
Expand Down Expand Up @@ -3167,9 +3192,9 @@ rule__RosSystem__Group_4_0__2__Impl
}
:
(
{ before(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_0_2()); }
(rule__RosSystem__ProcessesAssignment_4_0_2)*
{ after(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_0_2()); }
{ before(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_0_2()); }
(rule__RosSystem__ComponentsAssignment_4_0_2)*
{ after(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_0_2()); }
)
;
finally {
Expand Down Expand Up @@ -3221,9 +3246,9 @@ rule__RosSystem__Group_4_1__0__Impl
}
:
(
{ before(grammarAccess.getRosSystemAccess().getNodesKeyword_4_1_0()); }
Nodes
{ after(grammarAccess.getRosSystemAccess().getNodesKeyword_4_1_0()); }
{ before(grammarAccess.getRosSystemAccess().getProcessesKeyword_4_1_0()); }
Processes
{ after(grammarAccess.getRosSystemAccess().getProcessesKeyword_4_1_0()); }
)
;
finally {
Expand Down Expand Up @@ -3275,9 +3300,9 @@ rule__RosSystem__Group_4_1__2__Impl
}
:
(
{ before(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_1_2()); }
(rule__RosSystem__ComponentsAssignment_4_1_2)*
{ after(grammarAccess.getRosSystemAccess().getComponentsAssignment_4_1_2()); }
{ before(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_1_2()); }
(rule__RosSystem__ProcessesAssignment_4_1_2)*
{ after(grammarAccess.getRosSystemAccess().getProcessesAssignment_4_1_2()); }
)
;
finally {
Expand Down Expand Up @@ -3329,9 +3354,9 @@ rule__RosSystem__Group_4_2__0__Impl
}
:
(
{ before(grammarAccess.getRosSystemAccess().getSubSystemKeyword_4_2_0()); }
SubSystem
{ after(grammarAccess.getRosSystemAccess().getSubSystemKeyword_4_2_0()); }
{ before(grammarAccess.getRosSystemAccess().getNodesKeyword_4_2_0()); }
Nodes
{ after(grammarAccess.getRosSystemAccess().getNodesKeyword_4_2_0()); }
)
;
finally {
Expand Down Expand Up @@ -10793,30 +10818,30 @@ finally {
restoreStackSize(stackSize);
}

rule__RosSystem__ProcessesAssignment_4_0_2
rule__RosSystem__ComponentsAssignment_4_0_2
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getRosSystemAccess().getProcessesProcessParserRuleCall_4_0_2_0()); }
ruleProcess
{ after(grammarAccess.getRosSystemAccess().getProcessesProcessParserRuleCall_4_0_2_0()); }
{ before(grammarAccess.getRosSystemAccess().getComponentsSubSystemParserRuleCall_4_0_2_0()); }
ruleSubSystem
{ after(grammarAccess.getRosSystemAccess().getComponentsSubSystemParserRuleCall_4_0_2_0()); }
)
;
finally {
restoreStackSize(stackSize);
}

rule__RosSystem__ComponentsAssignment_4_1_2
rule__RosSystem__ProcessesAssignment_4_1_2
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getRosSystemAccess().getComponentsRosNodeParserRuleCall_4_1_2_0()); }
ruleRosNode
{ after(grammarAccess.getRosSystemAccess().getComponentsRosNodeParserRuleCall_4_1_2_0()); }
{ before(grammarAccess.getRosSystemAccess().getProcessesProcessParserRuleCall_4_1_2_0()); }
ruleProcess
{ after(grammarAccess.getRosSystemAccess().getProcessesProcessParserRuleCall_4_1_2_0()); }
)
;
finally {
Expand All @@ -10829,9 +10854,9 @@ rule__RosSystem__ComponentsAssignment_4_2_2
}
:
(
{ before(grammarAccess.getRosSystemAccess().getComponentsRosSystemParserRuleCall_4_2_2_0()); }
ruleRosSystem
{ after(grammarAccess.getRosSystemAccess().getComponentsRosSystemParserRuleCall_4_2_2_0()); }
{ before(grammarAccess.getRosSystemAccess().getComponentsRosNodeParserRuleCall_4_2_2_0()); }
ruleRosNode
{ after(grammarAccess.getRosSystemAccess().getComponentsRosNodeParserRuleCall_4_2_2_0()); }
)
;
finally {
Expand Down Expand Up @@ -10868,6 +10893,25 @@ finally {
restoreStackSize(stackSize);
}

rule__SubSystem__SystemAssignment
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getSubSystemAccess().getSystemSystemCrossReference_0()); }
(
{ before(grammarAccess.getSubSystemAccess().getSystemSystemEStringParserRuleCall_0_1()); }
ruleEString
{ after(grammarAccess.getSubSystemAccess().getSystemSystemEStringParserRuleCall_0_1()); }
)
{ after(grammarAccess.getSubSystemAccess().getSystemSystemCrossReference_0()); }
)
;
finally {
restoreStackSize(stackSize);
}

rule__Process__NameAssignment_1
@init {
int stackSize = keepStackSize();
Expand Down
Loading

0 comments on commit a21d697

Please sign in to comment.