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
e2ca9bfd
Commit
e2ca9bfd
authored
Aug 19, 2015
by
Maxime Perrotin
Browse files
Add function to list active TC
Useful to build up a random simulator
parent
458b857b
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/asn1_value_editor.py
View file @
e2ca9bfd
...
...
@@ -16,7 +16,7 @@
__author__
=
"Maxime Perrotin"
__license__
=
"LGPLv3"
__version__
=
"1.0.
5
"
__version__
=
"1.0.
6
"
__url__
=
"http://taste.tuxfamily.org"
import
sys
...
...
asn1_value_editor/sdlHandler.py
View file @
e2ca9bfd
...
...
@@ -241,6 +241,19 @@ class sdlHandler(QObject):
# VDM handler instance, when needed for external procedures calls
self
.
vdm
=
None
@
property
def
active_tc
(
self
):
''' Yield list of TCs that can be sent (including timeouts) '''
# Find the list of allowed TC based on the current state
st
=
unicode
(
self
.
current_sdl_state
.
decode
(
'latin1'
))
inputs
=
self
.
proc
.
mapping
[
st
.
replace
(
UNICODE_SEP
,
'_'
).
lower
()]
allowed_tc
=
(
tc
for
each
in
inputs
for
tc
in
each
.
inputlist
)
for
each
in
allowed_tc
:
if
each
in
self
.
timers
and
not
self
.
buttons
[
each
].
isEnabled
():
# Timers: check if button is active
continue
yield
each
@
property
def
dll
(
self
):
return
self
.
_dll
...
...
@@ -301,8 +314,8 @@ class sdlHandler(QObject):
# Initialization: set current state and internal variables
self
.
current_sdl_state
=
''
self
.
check_state
()
self
.
init_state
=
self
.
current_hash
=
self
.
on_event
()
self
.
init_timers
()
self
.
init_state
=
self
.
current_hash
=
self
.
on_event
()
def
load_properties
(
self
,
prop_file
=
None
):
''' Try loading a shared object with properties to verify
...
...
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