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
f3ad1eb8
Commit
f3ad1eb8
authored
Aug 23, 2015
by
Maxime Perrotin
Browse files
Randomly send TC for selected inputs
parent
a733a79e
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
f3ad1eb8
...
...
@@ -642,11 +642,9 @@ class sdlHandler(QObject):
def
random_step
(
self
):
''' One step of random simulation '''
if
self
.
sim_param
[
'state'
]
!=
'random'
:
return
for
name
,
asn1_ty
in
self
.
sim_param
[
'periodic'
]:
def
send_random_tc
(
name
,
asn1_ty
=
None
):
if
name
not
in
self
.
active_tc
:
continue
return
if
name
in
self
.
buttons
:
# paramless TC
self
.
buttons
[
name
].
click
()
...
...
@@ -658,6 +656,23 @@ class sdlHandler(QObject):
argpy
=
vn
.
fromValueNotationToPySide
(
name
,
arg
)
vals
[
'editor'
].
updateVariable
(
argpy
)
vals
[
'send_btn'
].
click
()
if
self
.
sim_param
[
'state'
]
!=
'random'
:
return
for
name
,
asn1_ty
in
self
.
sim_param
[
'periodic'
]:
send_random_tc
(
name
,
asn1_ty
)
# Select randomly an active TC and call it
random_tc
=
random
.
choice
(
list
(
self
.
active_tc
))
ty
=
None
for
inp
in
self
.
proc
.
input_signals
:
if
inp
[
'name'
].
lower
()
==
random_tc
.
lower
():
sort
=
inp
.
get
(
'type'
,
None
)
if
sort
:
typename
=
sort
.
ReferencedTypeName
.
replace
(
'-'
,
'_'
)
ty
=
self
.
proc
.
dataview
[
sort
.
ReferencedTypeName
]
break
send_random_tc
(
random_tc
,
ty
)
QTimer
().
singleShot
(
1000
,
self
.
random_step
)
def
random_simulation
(
self
):
...
...
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