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

Add parallel states in the tree

parent b46897f8
......@@ -368,6 +368,8 @@ class sdlHandler(QObject):
# Build up the list of states, including state compositions
context = self.proc
# get the list of state aggregations
aggregates = opengeode.Helper.state_aggregations(context)
get_statenames = lambda c: [CleanName(s) for s in c.mapping.viewkeys()
if not s.endswith(u'START')]
......@@ -385,8 +387,22 @@ class sdlHandler(QObject):
states = {'id': 'Current SDL state', 'type': 'ENUMERATED',
'values': list(statenames)}
self.tree_items['_states'] = self.asn1_editor.setAsn1Model(states, row)
if aggregates:
statenames.append('(not in state)')
# Add state variables for parelle states in aggregations
for agg, substates in aggregates.viewitems():
for each in substates:
row += 1
states = {'id': 'Substate {}.{}'.format(CleanName(agg),
'type': 'ENUMERATED',
'values': list(statenames)}
self.tree_items['substate_{}'.format(each.statename)] = \
self.asn1_editor.setAsn1Model(states, row)
# Add the SDL variables to the ASN.1 editor
row = 1
row += 1
for var, (sort, _) in self.proc.variables.viewitems():
item = asn1sccToasn1ValueEditorTypes(self.proc.dataview, var, sort)
self.tree_items[var] = self.asn1_editor.setAsn1Model(item, row)
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