Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
b46897f8
Commit
b46897f8
authored
Nov 01, 2015
by
Maxime Perrotin
Browse files
Complete support of state composition in SDL simulator
parent
a8887401
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
b46897f8
...
...
@@ -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
statenames
.
extend
(
list
(
rec_findstates
(
context
)))
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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