Commit 08934b55 authored by Maxime Perrotin's avatar Maxime Perrotin

Support for parameterless TM

parent b744eaa7
......@@ -129,7 +129,7 @@ inst {fv};'''.format(fv=fv_name)]
if direction == 'out':
start_item = self.gui_instance
end_item = self.taste_instance
else:
elif direction == 'in':
start_item = self.taste_instance
end_item = self.gui_instance
msg = self.msc_scene.addMessage(
......@@ -157,14 +157,14 @@ inst {fv};'''.format(fv=fv_name)]
if msg.direction == 'out':
self.msc.append(' gate in ' + msg.label
+ ' from {fv};'.format(fv=self.fv_name))
else:
elif msg.direction == 'in':
self.msc.append(' gate out ' + msg.label
+ ' to {fv};'.format(fv=self.fv_name))
self.msc.append(' {fv}: instance;'.format(fv=self.fv_name))
for msg in self.msg:
if msg.direction == 'out':
self.msc.append(' out ' + msg.label + ' to env;')
else:
elif msg.direction == 'in':
self.msc.append(' in ' + msg.label + ' from env;')
self.msc.append(''' endinstance;
endmsc;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,7 +18,7 @@ import os
import ctypes
from functools import partial
from PySide.QtGui import QDockWidget, QPushButton, QGridLayout
from PySide.QtGui import QDockWidget, QPushButton, QGridLayout, QListWidget
from PySide.QtCore import QObject, Signal, Slot, Qt, QFile
from PySide.QtUiTools import QUiLoader
......@@ -114,6 +114,7 @@ class sdlHandler(QObject):
row += 1
# In the simulation panel, set the buttons to send paramless TC/timers
self.set_paramless_tc()
self.set_paramless_tm()
@Slot()
def startStop(self):
......@@ -191,6 +192,10 @@ class sdlHandler(QObject):
self.msc.emit('out', name)
tc_func_ptr()
def receive_tm(self, tm_name):
''' Function called when a paramless TM is received '''
self.msc.emit('in', tm_name)
def set_paramless_tc(self):
''' Once the DLL is loaded set the buttons to send paramless TC '''
# tc_area and buttons have to be in self because of known pyside bug
......@@ -209,3 +214,17 @@ class sdlHandler(QObject):
name))
button.pressed.connect(partial(self.send_tc, name, tc))
def set_paramless_tm(self):
''' Once the DLL is loaded register the paramless TM to log them '''
widget = self.dock_simu.widget()
self.log_area = widget.findChild(QListWidget, 'log_tm')
# Define a single function to handle all parameterless TM
func = ctypes.CFUNCTYPE(None, ctypes.c_char_p)
self.tm_func = func(self.receive_tm)
for each in self.proc.output_signals:
if 'type' not in each:
register_func = getattr(self.dll, 'register_{}'
.format(each['name']))
register_func(self.tm_func)
......@@ -24,11 +24,7 @@
</widget>
</item>
<item>
<widget class="QTextEdit" name="log">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QListWidget" name="log_tm"/>
</item>
<item>
<widget class="QLabel" name="label_3">
......
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