From 7399643939ae4291230a099f904767a7d4bd95e2 Mon Sep 17 00:00:00 2001 From: Thanassis Tsiodras Date: Wed, 12 Sep 2018 17:46:34 +0200 Subject: [PATCH] Update the skeleton for the MSC-generated Python scripts. --- MSCtoPython.stg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MSCtoPython.stg b/MSCtoPython.stg index cf230ea..f504d57 100644 --- a/MSCtoPython.stg +++ b/MSCtoPython.stg @@ -101,7 +101,7 @@ def runScenario(pipe_in=None, pipe_out=None, udpController=None): # Queue for getting scenario status log = Queue.Queue() if udpController: - = Exercise_(log, name='Scenario') + = Exercise_(log, name='Exercise_') udpController.slots.append(.msq_q) .wait() udpController.slots.remove(.msg_q) @@ -109,12 +109,13 @@ def runScenario(pipe_in=None, pipe_out=None, udpController=None): else: # Use old-style message queue poller = PollerThread() - = Exercise_(log, name='Scenario') + = Exercise_(log, name='Exercise_') poller.slots.append(.msg_q) poller.start() .start() # Wait and log messages from both scenarii while True: + time.sleep(0.001) try: scenario, severity, msg = log.get(block=False) except Queue.Empty: @@ -165,7 +166,7 @@ poller.slots.append(.msg_q)}>}>}> PrintMscInstance(inst) ::= << @Scenario -def Exercise_(queue): +def Exercise_(queue): # queue is actually an instance of the Scenario class ''' processing''' }; separator="\n"> return 0 -- GitLab