Forráskód Böngészése

Fix live modelling GUI for CBDs

Yentl Van Tendeloo 7 éve
szülő
commit
8b97cbeb30

+ 5 - 5
interface/simple_plot/main.py

@@ -1,6 +1,6 @@
+import sys
 import matplotlib.pyplot as plt
 import json
-from matplotlib.animation import FuncAnimation
 import threading
 
 def read_data():
@@ -16,7 +16,8 @@ plt.ion()
 plt.figure()
 
 old_time, d = read_data()
-l = raw_input()
+plt.pause(0.01)
+l = sys.stdin.readline()
 time, _ = l.split(" ", 1)
 time = float(time)
 
@@ -38,13 +39,12 @@ while 1:
         l = first
         first = None
     else:
-        l = raw_input()
+        l = sys.stdin.readline()
 
     if l == "CLOSE":
         import sys
         sys.exit(0)
     elif l == "ALGEBRAIC_LOOP":
-        print("Algebraic loop discovered...")
         continue
     time, key, value = l.split(" ")
     time = float(time)
@@ -63,5 +63,5 @@ while 1:
     maps[key].set_xdata(d[key][0])
     maps[key].set_ydata(d[key][1])
     plt.gca().set_xlim([min(d[key][0]), max(d[key][0])])
-    plt.draw()
+    plt.pause(0.01)
     write_data((0.0, d))

+ 1 - 1
models/upload_models.py

@@ -42,7 +42,7 @@ def modify_model(model):
     attr_assign(model, new_block, "name", "MyProbeBlock")
     print("Added new probeblock: " + new_block)
 
-process_execute("models/live_modelling_CBD", {"design_model": "models/CBD_spring", "partial_runtime_model": "models/cbd_empty_partial", "full_runtime_model": "models/cbd_empty_full"}, {"models/CBD/edit": modify_model})
+#process_execute("models/live_modelling_CBD", {"design_model": "models/CBD_spring", "partial_runtime_model": "models/cbd_empty_partial", "full_runtime_model": "models/cbd_empty_full"}, {"models/CBD/edit": modify_model})
 
 """
 model_add("formalisms/PW_Plant", "formalisms/SimpleClassDiagrams", open("models/plant_PW.mvc", 'r').read())

+ 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:   Fri Nov 17 09:42:18 2017
+Date:   Fri Nov 17 11:34:41 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server