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

Format paramless TC in two columns in simulator

parent 042aa10a
......@@ -16,8 +16,8 @@ try:
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtUiTools import *
except ImportError:
print 'Pyside not found (package python-pyside missing)...'
except ImportError as err:
print 'Pyside not found (package python-pyside missing)...' + str(err)
import vn
......@@ -525,7 +525,7 @@ class asn1Editor(QTreeView):
rec(inp[i], outp[i], sort.type.type)
if sort.type.Min != sort.type.Max:
# The ASN1SCC AST only knows if the list has a fixed length
dest.SetLength(len(inp))
outp.SetLength(len(inp))
elif isinstance(inp, (int, float, bool)):
outp.Set(inp)
elif isinstance(inp, dict):
......@@ -541,13 +541,17 @@ class asn1Editor(QTreeView):
enum_val = getattr(ASN1Swig.DV, ch_ty.EnumID)
outp.kind.Set(enum_val)
rec(inp[child_name],
getattr(outp, child_name),
ch_ty.type)
getattr(outp,
child_name.replace('-', '_')),
ch_ty.type)
else:
# SEQUENCE
for field, data in inp.viewitems():
field_ty = sort.type.Children[field.replace('_', '-')]
rec(data, getattr(outp, field), field_ty.type)
#print outp, field, outp.GSER()
rec(data,
getattr(outp, field.replace('-', '_')),
field_ty.type)
else:
self.log.error('Unsupported type in to_asn1scc_swig')
rec(var, dest, sort)
......
......@@ -620,8 +620,12 @@ class sdlHandler(QObject):
self.buttons[each['name']] = QPushButton(each['name'])
for each in self.proc.timers:
self.buttons[each] = QPushButton(each+' timeout')
col, row = 0, 0
for name, button in self.buttons.viewitems():
self.tc_area.addWidget(button)
self.tc_area.addWidget(button, row, col)
if col:
row += 1
col = (col + 1) % 2
tc = getattr(self.dll, '{}_{}'.format(self.proc.processName,
name))
button.pressed.connect(partial(self.send_tc, name, tc))
......
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