Browse Source

Fixed rule export to documentation (Graphviz)

Yentl Van Tendeloo 7 years ago
parent
commit
e122a8e5b8

+ 3 - 3
kernel/rules/to_graphviz.alc

@@ -106,9 +106,9 @@ String function print_rule(model : Element, rule : String):
             text = text + style + ", label=\"" + cast_string(read_attribute(model, edge, "value")) + "\"]\n"
         elif (set_len(allOutgoingAssociationInstances(model, edge, "")) > 0):
             // Has no value, and we have outgoing edges ourself, so we should have an edge handle
-            text = text + "\t" + edge + "[width=0]\n"
-            text = text + "\t" + source + " -> " + edge + "[" + style + ", arrowhead=\"none\"]"
-            text = text + "\t" + edge + " -> " + destination + "[" + style + "]\n"
+            text = text + "\t" + string_replace(edge, "/", "_") + "[width=0]\n"
+            text = text + "\t" + source + " -> " + string_replace(edge, "/", "_") + "[" + style + ", arrowhead=\"none\"]"
+            text = text + "\t" + string_replace(edge, "/", "_") + " -> " + destination + "[" + style + "]\n"
         else:
             // Has no value, meaning that we are referring to an intermediate edge...
             text = text + "\t" + source + " -> " + destination + "[" + style + "]\n"

+ 1 - 1
kernel/rules/write_files.alc

@@ -10,6 +10,6 @@ Boolean function main(model : Element):
 	files = allInstances(model, "Files/File")
 	while (set_len(files) > 0):
 		file = set_pop(files)
-		write_file(read_attribute(model, file, "name"), read_attribute(model, file, "content"))
+		write_file(string_replace(read_attribute(model, file, "name"), "/", "_"), read_attribute(model, file, "content"))
 
 	return True!

+ 2 - 0
services/files/main.py

@@ -5,6 +5,7 @@ import os
 import json
 
 import time
+import traceback
 time.sleep(1)
 init(sys.argv[1])
 login("file", "file")
@@ -20,6 +21,7 @@ def file_service(port):
         service_set(port, "Success")
     except:
         service_set(port, "Failure: " + traceback.format_exc())
+        raise
 
 service_register("files", file_service)
 

+ 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 Nov 23 14:30:28 2017
+Date:   Thu Nov 23 14:46:09 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server