|
@@ -7,21 +7,31 @@ login("admin", "admin")
|
|
|
|
|
|
# Assume that we don't change the SCCD MM
|
|
|
try:
|
|
|
- model_add("SCCD", "SimpleClassDiagrams", open("models/SCCD.mvc", 'r').read())
|
|
|
+ model_add("formalisms/SCCD", "formalisms/SimpleClassDiagrams", open("models/SCCD.mvc", 'r').read())
|
|
|
+except ModelExists:
|
|
|
+ pass
|
|
|
+
|
|
|
+try:
|
|
|
+ model_add("formalisms/SCCD_Trace", "formalisms/SimpleClassDiagrams", open("models/SCCD_Trace.mvc", 'r').read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
# Update the model of the traffic light
|
|
|
-if "my_SCCD" in [i[0] for i in model_list()]:
|
|
|
- model_delete("my_SCCD")
|
|
|
-model_add("my_SCCD", "SCCD", open("models/dynamic_trafficlight.mvc", 'r').read())
|
|
|
+if "my_SCCD" in [i[0] for i in model_list("models")]:
|
|
|
+ model_delete("models/my_SCCD")
|
|
|
+#model_add("models/my_SCCD", "formalisms/SCCD", open("models/dynamic_trafficlight.mvc", 'r').read())
|
|
|
+model_add("models/my_SCCD", "formalisms/SCCD", open("integration/code/SCCD_all.mvc", 'r').read())
|
|
|
|
|
|
# Add SCCD execution semantics
|
|
|
-transformation_add_AL({"SCCD": "SCCD"}, {}, "SCCD_execute", open("models/SCCD_execute.alc", 'r').read())
|
|
|
+transformation_add_AL({"SCCD": "formalisms/SCCD"}, {"trace": "formalisms/SCCD_Trace"}, "models/SCCD_execute", open("models/SCCD_execute.alc", 'r').read())
|
|
|
|
|
|
# Execute it, while interacting through the console
|
|
|
def callback(inp):
|
|
|
print(inp)
|
|
|
- return raw_input()
|
|
|
+ inp = raw_input()
|
|
|
+ if inp == "":
|
|
|
+ return None
|
|
|
+ else:
|
|
|
+ return inp
|
|
|
|
|
|
-transformation_execute_AL("SCCD_execute", {"SCCD": "my_SCCD"}, {}, callback=callback)
|
|
|
+transformation_execute_AL("models/SCCD_execute", {"SCCD": "models/my_SCCD"}, {"trace": "models/my_trace"}, callback=callback)
|