Commit bb4e758b authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add dll pointer in sdl handler

The SDL handler is parsing the SDL file, so it can read the list of
declared variables. Using the shared lib it can then read the actual
value of each parameter at runtime. An event (signal) is received by a
slot when an message (call of a PI) has ben processed. This is the
placeholder to put the read of the DLL.
parent 8ea063d6
......@@ -281,9 +281,10 @@ def gui():
# Create a dock to handle the display of SDL diagrams
try:
sdl = sdlHandler(myWidget)
sdl.dll = dll
except IOError:
log.info('SDL viewer not available')
pass
sdl = None
else:
sdlButton = toolbar.addAction('SDL')
sdlButton.triggered.connect(sdl.startStop)
......@@ -350,6 +351,7 @@ def gui():
elif udp:
encoder_backend.setUDP()
elif dll:
# Provide pointer to the shared lib to the backends
encoder_backend.setSharedLib(dll)
editor.backend = encoder_backend
editor.log = log
......@@ -385,6 +387,8 @@ def gui():
button.clicked.connect(editor.loadTC)
elif button.objectName() == 'sendButton':
button.clicked.connect(editor.sendTC)
if sdl:
button.clicked.connect(sdl.on_event)
# Create a thread to poll the message queue or open an UDP socket
if msgQ:
......
......@@ -2,7 +2,7 @@
# Resource object code
#
# Created: Sat Dec 13 21:32:03 2014
# Created: Fri Dec 19 11:56:51 2014
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
......
......@@ -61,6 +61,8 @@ class sdlHandler(object):
self.dock.setWidget(self.sdl_view)
self.running = False
self.dock.hide()
# Pointer to the shared library, set by gui.py
self.dll = None
@Slot()
def startStop(self):
......@@ -77,3 +79,10 @@ class sdlHandler(object):
self.sdl_scene.clear_highlight()
for each in self.sdl_scene.find_text(u'\\b{}\\b'.format(new_state)):
self.sdl_scene.highlight(each)
@Slot()
def on_event(self):
''' Process signals indicating that a PI was called in the shared lib:
read the global variables and display them '''
print 'Event!'
Supports Markdown
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