Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RosSystem: Uncapitalize indexes and fix process description #196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* generated by Xtext 2.30.0
*/
package de.fraunhofer.ipa.ros.tests

import com.google.inject.Inject
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.extensions.InjectionExtension
import org.eclipse.xtext.testing.util.ParseHelper
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.^extension.ExtendWith
import ros.Namespace

@ExtendWith(InjectionExtension)
@InjectWith(BasicsInjectorProvider)
class BasicsParsingTest {
@Inject
ParseHelper<Namespace> parseHelper

@Test
def void loadModel() {
val result = parseHelper.parse('''
Hello Xtext!
''')
Assertions.assertNotNull(result)
val errors = result.eResource.errors
Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''')
}
}
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.
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.
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.
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.
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.
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.
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.
22 changes: 22 additions & 0 deletions plugins/de.fraunhofer.ipa.rossystem.edit/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,25 @@ _UI_System_Processes_feature = Processes
_UI_System_Components_feature = Components
_UI_System_Connections_feature = Connections
_UI_System_Parameter_feature = Parameter
_UI_Rossystem_type = Rossystem
_UI_System_name_feature = Name
_UI_System_processes_feature = Processes
_UI_System_components_feature = Components
_UI_System_connections_feature = Connections
_UI_System_parameter_feature = Parameter
_UI_Process_name_feature = Name
_UI_Process_threads_feature = Threads
_UI_Process_components_feature = Components
_UI_RosNode_name_feature = Name
_UI_RosNode_from_feature = From
_UI_RosInterface_name_feature = Name
_UI_RosInterface_reference_feature = Reference
_UI_RosPublisherReference_from_feature = From
_UI_RosSubscriberReference_from_feature = From
_UI_RosServiceServerReference_from_feature = From
_UI_RosServerClientReference_from_feature = From
_UI_RosActionServerReference_from_feature = From
_UI_RosActionClientReference_from_feature = From
_UI_RosParameterReference_from_feature = From
_UI_RosParameter_name_feature = Name
_UI_RosParameter_from_feature = From
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {

addNamePropertyDescriptor(object);
addThreadsPropertyDescriptor(object);
addNodesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand All @@ -77,8 +76,8 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Process_Name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Process_Name_feature", "_UI_Process_type"),
getString("_UI_Process_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Process_name_feature", "_UI_Process_type"),
RossystemPackage.Literals.PROCESS__NAME,
true,
false,
Expand All @@ -99,8 +98,8 @@ protected void addThreadsPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Process_Threads_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Process_Threads_feature", "_UI_Process_type"),
getString("_UI_Process_threads_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Process_threads_feature", "_UI_Process_type"),
RossystemPackage.Literals.PROCESS__THREADS,
true,
false,
Expand All @@ -110,28 +109,6 @@ protected void addThreadsPropertyDescriptor(Object object) {
null));
}

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

/**
* This returns Process.gif.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosActionClientReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosActionClientReference_From_feature", "_UI_RosActionClientReference_type"),
getString("_UI_RosActionClientReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosActionClientReference_from_feature", "_UI_RosActionClientReference_type"),
RossystemPackage.Literals.ROS_ACTION_CLIENT_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosActionServerReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosActionServerReference_From_feature", "_UI_RosActionServerReference_type"),
getString("_UI_RosActionServerReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosActionServerReference_from_feature", "_UI_RosActionServerReference_type"),
RossystemPackage.Literals.ROS_ACTION_SERVER_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -23,6 +24,7 @@
import org.eclipse.emf.edit.provider.ViewerNotification;

import system.RosInterface;
import system.RossystemFactory;
import system.RossystemPackage;

/**
Expand Down Expand Up @@ -61,7 +63,6 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
super.getPropertyDescriptors(object);

addNamePropertyDescriptor(object);
addReferencePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand All @@ -77,8 +78,8 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosInterface_Name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosInterface_Name_feature", "_UI_RosInterface_type"),
getString("_UI_RosInterface_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosInterface_name_feature", "_UI_RosInterface_type"),
RossystemPackage.Literals.ROS_INTERFACE__NAME,
true,
false,
Expand All @@ -89,28 +90,36 @@ protected void addNamePropertyDescriptor(Object object) {
}

/**
* This adds a property descriptor for the Reference feature.
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addReferencePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosInterface_Reference_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosInterface_Reference_feature", "_UI_RosInterface_type"),
RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
true,
false,
true,
null,
null,
null));
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE);
}
return childrenFeatures;
}

/**
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.

return super.getChildFeature(object, child);
}

/**
* This returns RosInterface.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -151,6 +160,9 @@ public void notifyChanged(Notification notification) {
case RossystemPackage.ROS_INTERFACE__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case RossystemPackage.ROS_INTERFACE__REFERENCE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
Expand All @@ -165,6 +177,46 @@ public void notifyChanged(Notification notification) {
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createInterfaceReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosPublisherReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosSubscriberReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosServiceServerReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosServerClientReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosActionServerReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosActionClientReference()));

newChildDescriptors.add
(createChildParameter
(RossystemPackage.Literals.ROS_INTERFACE__REFERENCE,
RossystemFactory.eINSTANCE.createRosParameterReference()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosNode_Name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosNode_Name_feature", "_UI_RosNode_type"),
getString("_UI_RosNode_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosNode_name_feature", "_UI_RosNode_type"),
RossystemPackage.Literals.ROS_NODE__NAME,
true,
false,
Expand All @@ -87,8 +87,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosNode_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosNode_From_feature", "_UI_RosNode_type"),
getString("_UI_RosNode_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosNode_from_feature", "_UI_RosNode_type"),
RossystemPackage.Literals.ROS_NODE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosParameter_Name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameter_Name_feature", "_UI_RosParameter_type"),
getString("_UI_RosParameter_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameter_name_feature", "_UI_RosParameter_type"),
RossystemPackage.Literals.ROS_PARAMETER__NAME,
true,
false,
Expand All @@ -103,8 +103,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosParameter_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameter_From_feature", "_UI_RosParameter_type"),
getString("_UI_RosParameter_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameter_from_feature", "_UI_RosParameter_type"),
RossystemPackage.Literals.ROS_PARAMETER__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosParameterReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameterReference_From_feature", "_UI_RosParameterReference_type"),
getString("_UI_RosParameterReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosParameterReference_from_feature", "_UI_RosParameterReference_type"),
RossystemPackage.Literals.ROS_PARAMETER_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosPublisherReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosPublisherReference_From_feature", "_UI_RosPublisherReference_type"),
getString("_UI_RosPublisherReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosPublisherReference_from_feature", "_UI_RosPublisherReference_type"),
RossystemPackage.Literals.ROS_PUBLISHER_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosServerClientReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosServerClientReference_From_feature", "_UI_RosServerClientReference_type"),
getString("_UI_RosServerClientReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosServerClientReference_from_feature", "_UI_RosServerClientReference_type"),
RossystemPackage.Literals.ROS_SERVER_CLIENT_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosServiceServerReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosServiceServerReference_From_feature", "_UI_RosServiceServerReference_type"),
getString("_UI_RosServiceServerReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosServiceServerReference_from_feature", "_UI_RosServiceServerReference_type"),
RossystemPackage.Literals.ROS_SERVICE_SERVER_REFERENCE__FROM,
true,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ protected void addFromPropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RosSubscriberReference_From_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosSubscriberReference_From_feature", "_UI_RosSubscriberReference_type"),
getString("_UI_RosSubscriberReference_from_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RosSubscriberReference_from_feature", "_UI_RosSubscriberReference_type"),
RossystemPackage.Literals.ROS_SUBSCRIBER_REFERENCE__FROM,
true,
false,
Expand Down
Loading