Sfoglia il codice sorgente

Fixed Modelverse with remote HUTN compiler

Yentl Van Tendeloo 8 anni fa
parent
commit
9e66fda092

+ 1 - 0
bootstrap/compiler.alc

@@ -42,6 +42,7 @@ Element function compile_model(code : String, metamodel : Element):
 	port = ""
 	while (port == ""):
 		port = comm_connect("compiler")
+		sleep(0.5)
 
 	comm_set(port, "model")
 

+ 0 - 2
bootstrap/core_algorithm.alc

@@ -1968,10 +1968,8 @@ String function cmd_service_register(service_name : String):
 		output("Success: " + get_taskname())
 
 		// Wait until we can stop the service
-		log("Waiting for service_stop")
 		while (cast_v2s(input()) != "\"service_stop\""):
 			output("Service is running on this task: stop it by sending 'service_stop'")
-		log("Finished")
 
 		model_delete_element(core, service)
 

+ 4 - 2
scripts/HUTN_service.py

@@ -9,9 +9,7 @@ import os
 
 import time
 time.sleep(1)
-print("INIT HUTN")
 init(sys.argv[1])
-print("INITTED HUTN")
 login("HUTN", "HUTN")
 
 def clean_code(code):
@@ -82,5 +80,9 @@ service_register("compiler", compile_service)
 try:
     while raw_input() != "STOP":
         pass
+except EOFError:
+    import time
+    while 1:
+        time.sleep(1.0)
 finally:
     service_stop()

+ 0 - 2
wrappers/test_SCCD.py

@@ -25,7 +25,6 @@ model_add("models/my_SCCD", "formalisms/SCCD", open("models/dynamic_trafficlight
 # Add SCCD execution semantics
 transformation_add_AL({"SCCD": "formalisms/SCCD"}, {"trace": "formalisms/SCCD_Trace"}, "models/SCCD_execute", open("models/SCCD_execute.alc", 'r').read())
 
-"""
 import poll_print
 ctrl = poll_print.Controller(keep_running=False)
 
@@ -41,4 +40,3 @@ while thrd.is_alive():
         ctrl.addInput(Event("raw_inp", "user_inp", [sys.stdin.readline().strip()]))
 
 thrd.join()
-"""