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
63608c12
Commit
63608c12
authored
Feb 15, 2018
by
Maxime Perrotin
Browse files
create test application for msc streaming
parent
ec5f56ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/test_msc_streaming.py
0 → 100755
View file @
63608c12
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
Testing module for the MSC Streaming function
Copyright (c) 2012-2018 European Space Agency
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import
sys
import
signal
from
PySide.QtGui
import
QGraphicsView
,
QApplication
from
PySide.QtCore
import
Qt
from
mscStreamingScene
import
MscStreamingScene
def
test_msc
():
''' Create an MSC Scene and add items to check if streaming is ok '''
app
=
QApplication
(
sys
.
argv
)
msc_scene
=
MscStreamingScene
()
msc_view
=
QGraphicsView
(
msc_scene
)
# Create two MSC instances on the diagram
env_x
=
80.0
taste_x
=
600.0
gui_instance
=
msc_scene
.
addInstance
(
env_x
,
0
,
label
=
"GUI"
)
taste_instance
=
msc_scene
.
addInstance
(
taste_x
,
0
,
label
=
"SYSTEM"
)
next_y
=
130.0
increase_factor
=
30
counter
=
1
msc_view
.
show
()
item
=
msc_scene
.
addMessage
(
gui_instance
,
taste_instance
,
next_y
,
"Hello World ({})"
.
format
(
counter
))
item
.
show
()
msc_scene
.
visible_items
.
append
(
item
)
counter
+=
1
next_y
+=
increase_factor
app
.
exec_
()
if
__name__
==
'__main__'
:
# Exit app on Ctrl-C
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
sys
.
exit
(
test_msc
())
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