Browse Source

Added all structure (states)

Yentl Van Tendeloo 8 years ago
parent
commit
37b4001543
1 changed files with 80 additions and 0 deletions
  1. 80 0
      models/dynamic_trafficlight.mvc

+ 80 - 0
models/dynamic_trafficlight.mvc

@@ -60,3 +60,83 @@ transition (manager_root_start, manager_root_start) {
             $
     }
 }
+
+Class trafficlight {
+    name = "TrafficLight"
+    default = False
+    constructor_body = $
+            Void function constructor(attributes : Element, parameters : Element):
+                dict_add(attributes, "counter", 0)
+                return!
+        $
+
+    {behaviour} CompositeState trafficlight_root {
+        name = "root"
+        isInitial = True
+        {composite_children} BasicState trafficlight_root_off {
+            name = "off"
+            isInitial = True
+        }
+
+        {composite_children} ParallelState trafficlight_root_main {
+            name = "main"
+            isInitial = False
+
+            {parallel_children} CompositeState trafficlight_root_main_trafficlight {
+                name = "trafficlight"
+                isInitial = False
+
+                {composite_children} CompositeState trafficlight_root_main_trafficlight_normal {
+                    name = "normal"
+                    isInitial = True
+
+                    {composite_children} BasicState trafficlight_root_main_trafficlight_normal_red {
+                        name = "red"
+                        isInitial = True
+                    }
+
+                    {composite_children} BasicState trafficlight_root_main_trafficlight_normal_green {
+                        name = "green"
+                        isInitial = False
+                    }
+
+                    {composite_children} BasicState trafficlight_root_main_trafficlight_normal_yellow {
+                        name = "yellow"
+                        isInitial = False
+                    }
+
+                    {composite_children} HistoryState trafficlight_root_main_trafficlight_normal_hist {
+                        name = "hist"
+                    }
+                }
+
+                {composite_children} CompositeState trafficlight_root_main_trafficlight_interrupted {
+                    {composite_children} BasicState trafficlight_root_main_trafficlight_interrupted_yellow {
+                        name = "yellow"
+                        isInitial = True
+                    }
+
+                    {composite_children} BasicState trafficlight_root_main_trafficlight_interrupted_black {
+                        name = "black"
+                        isInitial = False
+                    }
+                }
+            }
+
+            {parallel_children} CompositeState trafficlight_root_main_timer {
+                name = "timer"
+                isInitial = False
+
+                {composite_children} BasicState trafficlight_root_main_timer_disabled {
+                    name = "disabled"
+                    isInitial = False
+                }
+
+                {composite_children} BasicState trafficlight_root_main_timer_running {
+                    name = "running"
+                    isInitial = True
+                }
+            }
+        }
+    }
+}