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
5f8ce0e9
Commit
5f8ce0e9
authored
Nov 01, 2015
by
Maxime Perrotin
Browse files
Progress in supporting state composition
parent
9bb9706c
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
5f8ce0e9
...
...
@@ -622,11 +622,31 @@ class sdlHandler(QObject):
for sending TCs '''
# Find the list of allowed TC based on the current state
st
=
self
.
current_sdl_state
.
split
(
UNICODE_SEP
)
st
=
st
[
0
]
# TODO: Replace with proper support of composite states
inputs
=
self
.
proc
.
mapping
[
st
.
lower
()]
allowed_tc
=
[]
for
each
in
inputs
:
allowed_tc
.
extend
(
each
.
inputlist
)
st_iter
=
st
.
pop
(
0
)
context
=
self
.
proc
def
find_allowed_tc
(
context
,
statename
):
print
context
.
mapping
.
keys
()
inputs
=
context
.
mapping
[
statename
.
lower
()]
for
each
in
inputs
:
for
inp
in
each
.
inputlist
:
yield
inp
allowed_tc
=
list
(
find_allowed_tc
(
context
,
st_iter
))
while
len
(
st
):
# Handle state composition (without flattening)
next_st
=
st
.
pop
(
0
)
for
each
in
context
.
composite_states
:
if
each
.
statename
.
lower
()
==
st_iter
.
lower
():
context
=
each
break
allowed_tc
.
extend
(
list
(
find_allowed_tc
(
context
,
next_st
)))
# inputs = self.proc.mapping[st.lower()]
# allowed_tc = []
# for each in inputs:
# allowed_tc.extend(each.inputlist)
# Remove timers from the list
allowed_tc
=
set
(
allowed_tc
)
-
set
(
self
.
proc
.
timers
)
# Enable/disable the parameterless TC buttons accordingly
...
...
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