Browse Source

Working SCCD execution

Yentl Van Tendeloo 7 years ago
parent
commit
e4cd26749e

+ 2 - 2
kernel/modelverse_kernel/main.py

@@ -345,8 +345,8 @@ class ModelverseKernel(object):
         #print(func)
         #print(func)
 
 
         # To write out all generated functions
         # To write out all generated functions
-        #with open('/tmp/junk/%s' % suggested_name, 'w') as f:
-        #    f.write(func)
+        with open('/tmp/junk/%s' % suggested_name, 'w') as f:
+            f.write(func)
 
 
         yield [("RETURN", [func])]
         yield [("RETURN", [func])]
 
 

+ 4 - 4
models/SCCD/models/dynamic_trafficlight.mvc

@@ -32,7 +32,7 @@ transition (manager_main_start, manager_main_start) {
         scope = "cd"
         scope = "cd"
         event = "create_instance"
         event = "create_instance"
         parameter = $
         parameter = $
-                Element function raise(attributes : Element, parameters : Element):
+                Element function raises(attributes : Element, parameters : Element):
                     Element result
                     Element result
                     result = list_create()
                     result = list_create()
                     list_append(result, "trafficlights")
                     list_append(result, "trafficlights")
@@ -62,7 +62,7 @@ transition (manager_main_start, manager_main_start) {
         scope = "cd"
         scope = "cd"
         event = "delete_instance"
         event = "delete_instance"
         parameter = $
         parameter = $
-                Element function raise(attributes : Element, parameters : Element):
+                Element function raises(attributes : Element, parameters : Element):
                     Element result
                     Element result
                     result = list_create()
                     result = list_create()
                     list_append(result, list_pop_final(attributes["trafficlights"]))
                     list_append(result, list_pop_final(attributes["trafficlights"]))
@@ -226,7 +226,7 @@ Class trafficlight {
                         {onEntryRaise} Raise {
                         {onEntryRaise} Raise {
                             event = "updateTimerValue"
                             event = "updateTimerValue"
                             parameter = $
                             parameter = $
-                                    Element function raise(attributes : Element):
+                                    Element function raises(attributes : Element):
                                         return attributes["counter"]!
                                         return attributes["counter"]!
                                 $
                                 $
                         }
                         }
@@ -239,7 +239,7 @@ Class trafficlight {
                         {onEntryRaise} Raise {
                         {onEntryRaise} Raise {
                             event = "updateTimerValue"
                             event = "updateTimerValue"
                             parameter = $
                             parameter = $
-                                    Element function raise(attributes : Element):
+                                    Element function raises(attributes : Element):
                                         return attributes["counter"]!
                                         return attributes["counter"]!
                                 $
                                 $
                         }
                         }

+ 1 - 0
models/SCCD/transformations/execute.alc

@@ -128,6 +128,7 @@ Element function expand_parallel_state(model : Element, parallel_state : String,
 Void function delete_class(model : Element, data : Element, identifier : String):
 Void function delete_class(model : Element, data : Element, identifier : String):
 	// Stop a specific class instance, with attached statechart, from executing
 	// Stop a specific class instance, with attached statechart, from executing
 	dict_delete(data["classes"], identifier)
 	dict_delete(data["classes"], identifier)
+	return!
 
 
 String function start_class(model : Element, data : Element, class : String, parameters : Element):
 String function start_class(model : Element, data : Element, class : String, parameters : Element):
 	// Start up the class and assign its initial state to it
 	// Start up the class and assign its initial state to it

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Thu May 17 18:10:59 2018
+Date:   Fri May 18 06:55:09 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server