Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
82d4e1db
Commit
82d4e1db
authored
Dec 29, 2014
by
Maxime Perrotin
Browse files
Workaround pyside bug
parent
ca908dd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
82d4e1db
...
...
@@ -16,6 +16,7 @@
import
os
import
ctypes
from
functools
import
partial
from
PySide.QtGui
import
QDockWidget
,
QPushButton
,
QGridLayout
from
PySide.QtCore
import
Slot
,
Qt
,
QFile
...
...
@@ -36,6 +37,7 @@ except ImportError:
print
'No Python A mapper generated dataview, SDL handler cannot be used'
ASN1
=
None
class
sdlHandler
(
object
):
'''
Class managing SDL models
...
...
@@ -181,20 +183,25 @@ class sdlHandler(object):
dock
.
hide
()
return
dock
def
send_tc
(
self
,
tc
):
''' Send a parameterless TC '''
tc
()
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
widget
=
self
.
dock_simu
.
widget
()
tc_area
=
widget
.
findChild
(
QGridLayout
,
'tc_grid'
)
self
.
tc_area
=
widget
.
findChild
(
QGridLayout
,
'tc_grid'
)
# Find parameterless input signals and create buttons
buttons
=
{}
self
.
buttons
=
{}
for
each
in
self
.
proc
.
input_signals
:
if
'type'
not
in
each
:
buttons
[
each
[
'name'
]]
=
QPushButton
(
each
[
'name'
])
self
.
buttons
[
each
[
'name'
]]
=
QPushButton
(
each
[
'name'
])
for
each
in
self
.
proc
.
timers
:
buttons
[
each
]
=
QPushButton
(
each
+
' timeout'
)
for
name
,
button
in
buttons
.
viewitems
():
tc_area
.
addWidget
(
button
)
self
.
buttons
[
each
]
=
QPushButton
(
each
+
' timeout'
)
for
name
,
button
in
self
.
buttons
.
viewitems
():
self
.
tc_area
.
addWidget
(
button
)
tc
=
getattr
(
self
.
dll
,
'{}_{}'
.
format
(
self
.
proc
.
processName
,
name
))
button
.
pressed
.
connect
(
lambda
:
tc
)
button
.
pressed
.
connect
(
partial
(
self
.
send_tc
,
tc
)
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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