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
34271366
Commit
34271366
authored
Mar 20, 2015
by
Maxime Perrotin
Browse files
Check properties while simulating
parent
4928b26f
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/resources.py
View file @
34271366
...
...
@@ -2,7 +2,7 @@
# Resource object code
#
# Created: Fri Mar 20
19:48:59
2015
# Created: Fri Mar 20
20:00:31
2015
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
...
...
asn1_value_editor/sdlHandler.py
View file @
34271366
...
...
@@ -223,7 +223,7 @@ class sdlHandler(QObject):
while
True
:
try
:
prop
=
getattr
(
self
.
prop_dll
,
'_property_{}'
.
format
(
idx
))
prop
.
restype
=
ctypes
.
c_
char
prop
.
restype
=
ctypes
.
c_
uint
self
.
properties
.
append
(
prop
)
except
AttributeError
:
break
...
...
@@ -231,20 +231,17 @@ class sdlHandler(QObject):
idx
+=
1
self
.
log_area
.
addItem
(
'Loaded {} properties'
.
format
(
idx
))
def
check_properties
(
self
):
def
check_properties
(
self
,
statehash
):
''' Check the properties at runtime
First copy the running system state to the property system state,
then execute each property and check the return value '''
if
not
self
.
prop_dll
:
return
self
.
restore_global_state
(
s
elf
.
current_
hash
,
dll
=
self
.
prop_dll
)
self
.
restore_global_state
(
s
tate
hash
,
dll
=
self
.
prop_dll
)
for
idx
,
check
in
enumerate
(
self
.
properties
):
if
not
check
():
if
check
():
self
.
log_area
.
addItem
(
'Property {} was violated'
.
format
(
idx
))
@
Slot
()
def
startStop
(
self
):
''' Trigger or stop the SDL display '''
...
...
@@ -384,6 +381,7 @@ class sdlHandler(QObject):
# Log all TC sent
self
.
log_area
.
addItem
(
'Sent {}({})'
.
format
(
tc_name
,
param
or
''
))
self
.
check_properties
(
new_hash
)
return
new_hash
def
update_button_state
(
self
,
tc_name
=
None
):
...
...
Write
Preview
Markdown
is supported
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