Commit 9170d322 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update SDL state properly

When simulating SDL, the panel showing the process static data was not
updated properly with respect to the current SDL state
parent 84a6e427
......@@ -482,6 +482,11 @@ class sdlHandler(QObject):
complete_state.append(asn1_instance) # not gser
# Add the SDL state to the new global state
complete_state.append(self.current_sdl_state)
# Update the SDL state in the global state panel
state_as_pyside = vn.fromValueNotationToPySide('Current SDL state',
'{}'.format(self.current_sdl_state.lower().replace('_', '-')))
self.asn1_editor.updateVariable(state_as_pyside,
root=self.tree_items['_states'])
# And save this new state in the graph, if it was not there yet
new_hash = hash(frozenset(complete_state))
self.set_of_states[new_hash] = complete_state
......
#!/usr/bin/python
from pyparsing import Word, QuotedString, Literal, Combine, Optional, oneOf, OneOrMore, srange, nums, nestedExpr, Forward, delimitedList, Keyword
from pyparsing import(Word, QuotedString, Literal, Combine, Optional,
oneOf, OneOrMore, srange, nums, nestedExpr, Forward,
delimitedList, Keyword, ParseException)
import string
......@@ -120,7 +122,11 @@ BitStringLiteral.setParseAction(lambda s, l, t: ''.join([chr(int(t[1][i:i+9], 2)
def fromValueNotationToPySide(varName, string):
''' Return a variable compatible with the ASN.1 Editor from a GSER string'''
# TODO: catch Exceptions
return {varName: value.parseString(string, True)[0]}
try:
return {varName: value.parseString(string, True)[0]}
except ParseException as err:
print '[fromValueNotationToPySide] Parsing error:', string
raise
def toASN1ValueNotation(val):
......
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