|
@@ -1,8 +1,6 @@
|
|
|
"""
|
|
|
Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
|
|
|
|
|
|
-Date: Thu Jun 7 16:50:26 2018
|
|
|
-
|
|
|
Model author: Yentl Van Tendeloo
|
|
|
Model name: MvK Server
|
|
|
Model description:
|
|
@@ -2463,7 +2461,6 @@ class Modelverse(RuntimeClassBase):
|
|
|
#print("Got input (%s): %s" % (self.taskname, data))
|
|
|
if self.taskname == "task_manager":
|
|
|
self.controller.taskname = self.taskname = json.loads(data)
|
|
|
- print("Got taskname: " + data)
|
|
|
else:
|
|
|
self.responses.append(json.loads(data))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[1], Event("HTTP_input", None, [urlencode({"op": "get_output", "taskname": self.taskname}), "parent"])]))
|
|
@@ -2477,7 +2474,6 @@ class Modelverse(RuntimeClassBase):
|
|
|
#print("Got input (%s): %s" % (self.taskname, data))
|
|
|
if self.taskname == "task_manager":
|
|
|
self.controller.taskname = self.taskname = json.loads(data)
|
|
|
- print("Got taskname: " + data)
|
|
|
else:
|
|
|
self.responses.append(json.loads(data))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[1], Event("HTTP_input", None, [urlencode({"op": "get_output", "taskname": self.taskname}), "parent"])]))
|
|
@@ -2488,7 +2484,6 @@ class Modelverse(RuntimeClassBase):
|
|
|
|
|
|
def _initialized_behaviour_init_connect_http_client_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[self.i], Event("connect", None, [self.address, self.timeout])]))
|
|
|
- print("CONNECT HTTP")
|
|
|
|
|
|
def _initialized_behaviour_init_connect_http_client_0_guard(self, parameters):
|
|
|
return self.i < 2
|
|
@@ -2501,14 +2496,12 @@ class Modelverse(RuntimeClassBase):
|
|
|
|
|
|
def _initialized_behaviour_init_waiting_http_client_0_exec(self, parameters):
|
|
|
self.i += 1
|
|
|
- print("Got first HTTP ready")
|
|
|
|
|
|
def _initialized_behaviour_init_waiting_http_client_0_guard(self, parameters):
|
|
|
return self.i == 0
|
|
|
|
|
|
def _initialized_behaviour_init_waiting_http_client_1_exec(self, parameters):
|
|
|
self.i += 1
|
|
|
- print("RAISE get output")
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[1], Event("HTTP_input", None, [urlencode({"op": "get_output", "taskname": self.taskname}), "parent"])]))
|
|
|
|
|
|
def _initialized_behaviour_init_waiting_http_client_1_guard(self, parameters):
|
|
@@ -3596,7 +3589,6 @@ class HTTPClient(RuntimeClassBase):
|
|
|
|
|
|
# transition /connecting/cooldown
|
|
|
_connecting_cooldown_0 = Transition(self, self.states["/connecting/cooldown"], [self.states["/connecting/connecting"]])
|
|
|
- _connecting_cooldown_0.setAction(self._connecting_cooldown_0_exec)
|
|
|
_connecting_cooldown_0.setTrigger(Event("_1after"))
|
|
|
self.states["/connecting/cooldown"].addTransition(_connecting_cooldown_0)
|
|
|
|
|
@@ -3671,7 +3663,6 @@ class HTTPClient(RuntimeClassBase):
|
|
|
|
|
|
def _connecting_connecting_enter(self):
|
|
|
self.big_step.outputEvent(Event("connect_socket", "socket_out", [self.socket, self.address]))
|
|
|
- print("Connecting ...")
|
|
|
|
|
|
def _connecting_cooldown_enter(self):
|
|
|
self.addTimer(1, 0.1)
|
|
@@ -3712,9 +3703,6 @@ class HTTPClient(RuntimeClassBase):
|
|
|
socket = parameters[0]
|
|
|
return self.socket == socket
|
|
|
|
|
|
- def _connecting_cooldown_0_exec(self, parameters):
|
|
|
- print("COOLDOWN")
|
|
|
-
|
|
|
def _connected_listening_listen_0_exec(self, parameters):
|
|
|
socket = parameters[0]
|
|
|
data = parameters[1]
|