Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
a6bbff9c
Commit
a6bbff9c
authored
Jan 05, 2015
by
Maxime Perrotin
Browse files
Fix state update in MSC
parent
6f029b3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
a6bbff9c
...
...
@@ -186,15 +186,17 @@ class sdlHandler(QObject):
self
.
dock
.
hide
()
def
check_state
(
self
):
''' Highlight the current state on the statechart diagram '''
''' Highlight the current state on the statechart diagram
Return True if the state has changed '''
state
=
self
.
get_sdl_state
()
if
state
!=
self
.
current_sdl_state
:
self
.
current_sdl_state
=
state
self
.
sdl_scene
.
clear_highlight
()
for
each
in
self
.
sdl_scene
.
find_text
(
u
'
\\
b{}
\\
b'
.
format
(
state
)):
self
.
sdl_scene
.
highlight
(
each
)
self
.
add_to_msc
(
'condition'
,
state
)
self
.
log_area
.
addItem
(
'New state: {}'
.
format
(
state
))
return
True
return
False
def
reset_simulation
(
self
):
''' Jump to the first step of simulation '''
...
...
@@ -236,7 +238,7 @@ class sdlHandler(QObject):
set_state
=
getattr
(
self
.
dll
,
"_set_state"
)
set_state
(
ctypes
.
c_char_p
(
state_value
))
#self.current_sdl_state = state_value
#
self.check_state()
self
.
check_state
()
#self.on_event()
def
on_event
(
self
,
tc_name
=
None
,
param
=
None
):
...
...
@@ -349,7 +351,9 @@ class sdlHandler(QObject):
else
:
tc_func_ptr
()
self
.
check_state
()
if
self
.
check_state
():
# If state changed, update the MSC
self
.
add_to_msc
(
'condition'
,
self
.
current_sdl_state
)
# Update windows, highlight state, enable/disable buttons, etc.
self
.
current_hash
=
self
.
on_event
(
tc_name
=
name
,
param
=
param
.
GSER
()
if
param
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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