Browse Source

Working live modelling and fix to the MvK with infinite while loops

Yentl Van Tendeloo 7 years ago
parent
commit
cdee1cbec8

+ 2 - 0
kernel/modelverse_kernel/main.py

@@ -308,6 +308,8 @@ class ModelverseKernel(object):
                           "  " * (indent + 2) + "%s['value'], = yield [('RV', [%s['id']])]\n" % (instruction_cond, instruction_cond) + \
                           "  " * (indent + 1) + "if not (%s['value']):\n" % instruction_cond + \
                           "  " * (indent + 2) + "break\n" + \
+                          "  " * (indent + 1) + "else:\n" + \
+                          "  " * (indent + 2) + "yield None\n" + \
                           prev_body + instruction_body
 
         next_inst, = yield [("RD", [inst, "next"])]

models/CBD/transformations/CBD_mapper.alc → models/CBD/transformations/render.alc


models/CBD/transformations/CBD_mapper.mvc → models/CBD/transformations/render.mvc


models/CBD/transformations/cbd_toRuntime.alc → models/CBD/transformations/to_runtime.alc


+ 3 - 0
wrappers/modelverse.py

@@ -483,12 +483,15 @@ def process_execute(process_name, model_mapping, callbacks=None):
 
     while 1:
         result = OUTPUT()
+        print("Got result: " + str(result))
         if result == "Success":
             # Finished
+            print("FINISH")
             return None
         else:
             taskname, operation = result
 
+            print("Looking up operation %s in %s: %s" % (operation, callbacks, operation in callbacks))
             if (operation in callbacks):
                 data = callbacks[operation]
 

+ 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)
 
-Date:   Thu May 17 10:44:23 2018
+Date:   Thu May 17 11:08:54 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server