Commit 73996439 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Update the skeleton for the MSC-generated Python scripts.

parent 35382cc3
......@@ -101,7 +101,7 @@ def runScenario(pipe_in=None, pipe_out=None, udpController=None):
# Queue for getting scenario status
log = Queue.Queue()
if udpController:
<inst.CleanName> = Exercise_<inst.CleanName>(log, name='Scenario')
<inst.CleanName> = Exercise_<inst.CleanName>(log, name='Exercise_<inst.CleanName>')
udpController.slots.append(<inst.CleanName>.msq_q)
<inst.CleanName>.wait()
udpController.slots.remove(<inst.CleanName>.msg_q)
......@@ -109,12 +109,13 @@ def runScenario(pipe_in=None, pipe_out=None, udpController=None):
else:
# Use old-style message queue
poller = PollerThread()
<inst.CleanName> = Exercise_<inst.CleanName>(log, name='Scenario')
<inst.CleanName> = Exercise_<inst.CleanName>(log, name='Exercise_<inst.CleanName>')
poller.slots.append(<inst.CleanName>.msg_q)
poller.start()
<inst.CleanName>.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(<inst.CleanName>.msg_q)}>}>}>
PrintMscInstance(inst) ::= <<
@Scenario
def Exercise_<inst.CleanName>(queue):
def Exercise_<inst.CleanName>(queue): # queue is actually an instance of the Scenario class
'''<inst.CleanName> processing'''
<inst.events:{evt|<PrintEvent(evt)>}; separator="\n">
return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment