Commit 60034039 authored by Maxime Perrotin's avatar Maxime Perrotin

Fix streaming issue

parent ae9d8bce
......@@ -34,6 +34,7 @@ LICENSE: LGPL - see LICENSE file
CHANGELOG:
1.6.0 - Fix autoscrolling in MSC streaming scenes
1.5.8 - Fix in Scenario.py used in MSCtoPython handlers
1.5.7 - No change - 1st version in TASTEv4
1.5.6 - Add support for taste-msc-editor
......
......@@ -16,7 +16,7 @@
__author__ = "Maxime Perrotin"
__license__ = "LGPLv3"
__version__ = "1.5.8"
__version__ = "1.6.0"
__url__ = "http://taste.tuxfamily.org"
import sys
......
......@@ -5,7 +5,7 @@
Tool main entry point (when used standalone)
Copyright (c) 2012-2015 European Space Agency
Copyright (c) 2012-2018 European Space Agency
Designed and implemented by Maxime Perrotin
......@@ -29,6 +29,7 @@ import time
from functools import partial
from ctypes import CDLL, create_string_buffer
logging.basicConfig()
log = logging.getLogger(__name__)
terminal_formatter = logging.Formatter(
fmt="%(levelname)s - %(name)s: %(message)s")
......
......@@ -69,6 +69,8 @@ class MscStreamingScene(MscGraphBasicMSCScene):
y=y - self.globalDiff, data=coreMsg)
rst = super(MscStreamingScene, self).addMessage2(graphMsg)
self.visible_items.append (rst)
rst.show()
self.streamingControl(rst)
rst.ensureVisible()
return rst
......@@ -142,15 +144,16 @@ class MscStreamingScene(MscGraphBasicMSCScene):
''' Scroll up in streaming mode '''
_ = element
if len(self.visible_items) > self.max_items:
#print "stream up"
item = self.visible_items.popleft()
firstY = item.pos().y()
self.removeGenericItem(item)
firstY = item.y()
item.hide()
#self.removeGenericItem(item)
while len(self.visible_items) > self.max_items:
item = self.visible_items.popleft()
self.removeGenericItem(item)
#self.removeGenericItem(item)
item.hide()
diff = self.visible_items[0].pos().y() - firstY
diff = self.visible_items[0].y() - firstY
self.globalDiff = self.globalDiff + diff
map(lambda msg: msg.setPos(msg.pos().x(), msg.pos().y() - diff),
map(lambda msg: msg.setPos(msg.x(), msg.y() - diff),
self.visible_items)
......@@ -15,6 +15,7 @@
import sys
import signal
import time
import logging
from PySide.QtGui import QGraphicsView, QApplication
from PySide.QtCore import Qt, QTimer
......@@ -46,8 +47,6 @@ def test_msc():
def add_item(item):
''' Add item to the scene and update next y position '''
global next_y, counter
item.show()
msc_scene.visible_items.append(item)
counter += 1
next_y += increase_factor
......@@ -64,15 +63,17 @@ def test_msc():
next_y,
"Pong({})".format(counter))
add_item(item)
print "next y = ", next_y
msc_scene.mousePressEvent = click
msc_scene.setLimit(15)
app.exec_()
if __name__ == '__main__':
# Exit app on Ctrl-C
logging.basicConfig()
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