Browse Source

Bugfix: TimeEvents execute at the same time for source state with same names

Andreas Mülder 13 years ago
parent
commit
e29acd82a7

+ 3 - 1
plugins/org.yakindu.sct.model.sexec/src/org/yakindu/sct/model/sexec/transformation/StructureMapping.xtend

@@ -19,12 +19,14 @@ import org.yakindu.sct.model.stext.stext.EventDefinition
 import org.yakindu.sct.model.stext.stext.OperationDefinition
 import org.yakindu.sct.model.stext.stext.VariableDefinition
 import org.yakindu.sct.model.sgraph.Vertex
+import org.eclipse.xtext.naming.IQualifiedNameProvider
 
 
 class StructureMapping {
 	 
 	@Inject extension SexecElementMapping mapping
 	@Inject extension StatechartExtensions sct
+	@Inject extension IQualifiedNameProvider
 	
 	
 	//==========================================================================
@@ -156,7 +158,7 @@ class StructureMapping {
 		val result = new ArrayList<TimeEvent>();
 		for (tes : timeEventSpecs ) {
 			val timeEvent = tes.createDerivedEvent
-			timeEvent.name = state.name + "_time_event_" + timeEventSpecs.indexOf(tes);
+			timeEvent.name = state.fullyQualifiedName + "_time_event_" + timeEventSpecs.indexOf(tes);
 			state.statechart.create.timeEventScope.declarations.add(timeEvent);
 			result.add(timeEvent);
 			

BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StructureMapping.java._trace


+ 7 - 2
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java

@@ -9,6 +9,8 @@ import java.util.List;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.naming.IQualifiedNameProvider;
+import org.eclipse.xtext.naming.QualifiedName;
 import org.eclipse.xtext.xbase.lib.Functions.Function1;
 import org.eclipse.xtext.xbase.lib.IterableExtensions;
 import org.eclipse.xtext.xbase.lib.ListExtensions;
@@ -49,6 +51,9 @@ public class StructureMapping {
   @Inject
   private StatechartExtensions sct;
   
+  @Inject
+  private IQualifiedNameProvider _iQualifiedNameProvider;
+  
   /**
    * maps all required scope defined in the statechart to the execution flow.
    * This includes creating the scopes and adding all relevant declarations. Empty scopes wont be mapped.
@@ -255,8 +260,8 @@ public class StructureMapping {
       for (final TimeEventSpec tes : timeEventSpecs) {
         {
           final TimeEvent timeEvent = this.mapping.createDerivedEvent(tes);
-          String _name = state.getName();
-          String _plus = (_name + "_time_event_");
+          QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(state);
+          String _plus = (_fullyQualifiedName + "_time_event_");
           int _indexOf = timeEventSpecs.indexOf(tes);
           String _plus_1 = (_plus + Integer.valueOf(_indexOf));
           timeEvent.setName(_plus_1);