|
@@ -11,6 +11,7 @@
|
|
|
self.mvk = ModelverseKernel(self.root)
|
|
|
self.all_failed = False
|
|
|
self.timeout = False
|
|
|
+ self.init_time = time.time()
|
|
|
|
|
|
self.users = set()
|
|
|
self.input_queue = defaultdict(list)
|
|
@@ -90,8 +91,6 @@
|
|
|
<parameter name="data"/>
|
|
|
<script>
|
|
|
# No JSON encoding necessary, as it is not complex
|
|
|
- print("Take transition!")
|
|
|
- print("Data: " + str(data))
|
|
|
if data["op"] == "set_input":
|
|
|
if "element_type" in data:
|
|
|
if data["element_type"] == "V":
|
|
@@ -108,7 +107,6 @@
|
|
|
d.append([t, v])
|
|
|
self.input_queue[data["username"]].append((source, d))
|
|
|
elif data["op"] == "get_output":
|
|
|
- print("Registered output listener")
|
|
|
self.output_queue[data["username"]].append(source)
|
|
|
else:
|
|
|
raise Exception("DROPPING unknown operation: " + str(data["op"]))
|
|
@@ -155,7 +153,6 @@
|
|
|
self.destination = self.output_queue[user].pop(0)
|
|
|
self.value = self.mvk.returnvalue
|
|
|
self.all_failed = False
|
|
|
- print("Send output!")
|
|
|
else:
|
|
|
out = self.mvs.read_outgoing(self.root)[0]
|
|
|
for m in out:
|
|
@@ -168,19 +165,21 @@
|
|
|
continue
|
|
|
self.users.add(name)
|
|
|
self.timeout = self.all_failed
|
|
|
+ if self.timeout:
|
|
|
+ print("TIMEOUT")
|
|
|
self.all_failed = True
|
|
|
</script>
|
|
|
</onentry>
|
|
|
|
|
|
- <transition cond="self.destination is not None" after="0" target=".">
|
|
|
+ <transition cond="self.destination is not None" after="self.sccd_yield()" target=".">
|
|
|
<raise event="HTTP_input" scope="narrow" target="'to_mvi/%s' % self.destination">
|
|
|
<parameter expr="self.value"/>
|
|
|
</raise>
|
|
|
</transition>
|
|
|
|
|
|
- <transition cond="self.timeout and self.destination is None" after="0.1" target="."/>
|
|
|
+ <transition cond="self.timeout and self.destination is None" after="self.sccd_yield() + 0.1" target="."/>
|
|
|
|
|
|
- <transition cond="not self.timeout and self.destination is None" after="0" target="."/>
|
|
|
+ <transition cond="not self.timeout and self.destination is None" after="self.sccd_yield()" target="."/>
|
|
|
</state>
|
|
|
</state>
|
|
|
|