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

Complete support of state composition in SDL simulator

parent a8887401
......@@ -365,10 +365,25 @@ class sdlHandler(QObject):
self.parent.tabifyDockWidget(self.dock_simu, self.dock_checker)
# Add the state list to the ASN.1 Editor (at row 0)
row = 0
statenames = [CleanName(s) for s in self.proc.mapping.viewkeys()
if not s.endswith(u'START')]
# Build up the list of states, including state compositions
context = self.proc
get_statenames = lambda c: [CleanName(s) for s in c.mapping.viewkeys()
if not s.endswith(u'START')]
statenames = get_statenames(context)
def rec_findstates(context, prefix=''):
for each in context.composite_states:
prefix += each.statename + '__'
for name in get_statenames(each):
yield prefix+name
for substate in rec_findstates(each, prefix):
yield substate
states = {'id': 'Current SDL state', 'type': 'ENUMERATED',
'values': statenames}
'values': list(statenames)}
self.tree_items['_states'] = self.asn1_editor.setAsn1Model(states, row)
# Add the SDL variables to the ASN.1 editor
row = 1
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