Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
b744eaa7
Commit
b744eaa7
authored
Dec 29, 2014
by
Maxime Perrotin
Browse files
Connect parameterless TC to MSC
parent
82d4e1db
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/gui.py
View file @
b744eaa7
...
...
@@ -309,6 +309,7 @@ def gui():
try
:
sdl
=
sdlHandler
(
myWidget
)
sdl
.
dll
=
dll
sdl
.
msc
.
connect
(
msc
.
addToMsc
)
except
IOError
:
log
.
info
(
'SDL viewer not available'
)
sdl
=
None
...
...
asn1_value_editor/sdlHandler.py
View file @
b744eaa7
...
...
@@ -19,7 +19,7 @@ import ctypes
from
functools
import
partial
from
PySide.QtGui
import
QDockWidget
,
QPushButton
,
QGridLayout
from
PySide.QtCore
import
Slot
,
Qt
,
QFile
from
PySide.QtCore
import
QObject
,
Signal
,
Slot
,
Qt
,
QFile
from
PySide.QtUiTools
import
QUiLoader
import
asn1_value_editor
...
...
@@ -38,13 +38,16 @@ except ImportError:
ASN1
=
None
class
sdlHandler
(
o
bject
):
class
sdlHandler
(
QO
bject
):
'''
Class managing SDL models
'''
# signal sent whenever a paramless TM or TC event happens
msc
=
Signal
(
unicode
,
unicode
)
def
__init__
(
self
,
parent
):
''' Startup: check if there are some SDL files in
the directory and try to parse them and build the widget '''
super
(
sdlHandler
,
self
).
__init__
()
self
.
parent
=
parent
all_files
=
os
.
listdir
(
'.'
)
pr_files
=
[]
...
...
@@ -183,9 +186,10 @@ class sdlHandler(object):
dock
.
hide
()
return
dock
def
send_tc
(
self
,
tc
):
def
send_tc
(
self
,
name
,
tc_func_ptr
):
''' Send a parameterless TC '''
tc
()
self
.
msc
.
emit
(
'out'
,
name
)
tc_func_ptr
()
def
set_paramless_tc
(
self
):
''' Once the DLL is loaded set the buttons to send paramless TC '''
...
...
@@ -203,5 +207,5 @@ class sdlHandler(object):
self
.
tc_area
.
addWidget
(
button
)
tc
=
getattr
(
self
.
dll
,
'{}_{}'
.
format
(
self
.
proc
.
processName
,
name
))
button
.
pressed
.
connect
(
partial
(
self
.
send_tc
,
tc
))
button
.
pressed
.
connect
(
partial
(
self
.
send_tc
,
name
,
tc
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment