Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-02-08 09:29:51 +0000
committerHenrik Rentz-Reichert2013-02-08 09:30:41 +0000
commita6e700137dfd6408042e1cc13d845c7a9fa9f89b (patch)
treec11d7021958a607ec61873e0e328dc4b6bda4bc7 /plugins/org.eclipse.etrice.core.room
parent320cff5ef39f5e3771a3124af49ed3a0764e36d5 (diff)
downloadorg.eclipse.etrice-a6e700137dfd6408042e1cc13d845c7a9fa9f89b.tar.gz
org.eclipse.etrice-a6e700137dfd6408042e1cc13d845c7a9fa9f89b.tar.xz
org.eclipse.etrice-a6e700137dfd6408042e1cc13d845c7a9fa9f89b.zip
[core.room, abstractexec, generator] moved method from genmodel to RoomHelpers
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room')
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java
index a224b2ad8..11d88e2e3 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java
@@ -31,6 +31,7 @@ import org.eclipse.etrice.core.room.Annotation;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.Binding;
import org.eclipse.etrice.core.room.ChoicePoint;
+import org.eclipse.etrice.core.room.ChoicepointTerminal;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.DataType;
import org.eclipse.etrice.core.room.DetailCode;
@@ -61,10 +62,15 @@ import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.core.room.StateGraph;
import org.eclipse.etrice.core.room.StateGraphItem;
+import org.eclipse.etrice.core.room.StateGraphNode;
+import org.eclipse.etrice.core.room.StateTerminal;
import org.eclipse.etrice.core.room.StructureClass;
+import org.eclipse.etrice.core.room.SubStateTrPointTerminal;
import org.eclipse.etrice.core.room.SubSystemClass;
import org.eclipse.etrice.core.room.TrPoint;
+import org.eclipse.etrice.core.room.TrPointTerminal;
import org.eclipse.etrice.core.room.Transition;
+import org.eclipse.etrice.core.room.TransitionTerminal;
import org.eclipse.etrice.core.room.Trigger;
import org.eclipse.etrice.core.room.VarDecl;
import org.eclipse.etrice.core.validation.ValidationUtil;
@@ -667,6 +673,26 @@ public class RoomHelpers {
}
/**
+ * Returns the destination {@link StateGraphNode} of a {@link TransitionTerminal}.
+ *
+ * @param tt the transition terminal
+ *
+ * @return the destination {@link StateGraphNode} of a {@link TransitionTerminal}
+ */
+ public static StateGraphNode getNode(TransitionTerminal tt) {
+ if (tt instanceof StateTerminal)
+ return ((StateTerminal)tt).getState();
+ else if (tt instanceof TrPointTerminal)
+ return ((TrPointTerminal)tt).getTrPoint();
+ else if (tt instanceof SubStateTrPointTerminal)
+ return ((SubStateTrPointTerminal)tt).getTrPoint();
+ else if (tt instanceof ChoicepointTerminal)
+ return ((ChoicepointTerminal)tt).getCp();
+
+ return null;
+ }
+
+ /**
* Returns all {@link State}s of a {@link StateGraph} including parent state graphs recursively.
*
* @param sg the {@link StateGraph}

Back to the top