Commit 63608c12 authored by Maxime Perrotin's avatar Maxime Perrotin

create test application for msc streaming

parent ec5f56ac
#!/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())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment