Commit 5cccc1d6 authored by Maxime Perrotin's avatar Maxime Perrotin

Adjust better size of MSC instances in streaming mode

parent 4b2b73d8
...@@ -19,9 +19,10 @@ ...@@ -19,9 +19,10 @@
# along with TASTE Msc Diagram Editor. If not, see # along with TASTE Msc Diagram Editor. If not, see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# #
# Author: Angel Esquinas <aesquina@datsi.fi.upm.es> # Original Author: Angel Esquinas <aesquina@datsi.fi.upm.es>
# Maintainer: Maxime Perrotin <maxime.perrotin@esa.int>
# #
# Copyright (c) 2012 European Space Agency # Copyright (c) 2012-2015 European Space Agency
# #
#****************************************************************************** #******************************************************************************
import logging import logging
...@@ -198,17 +199,14 @@ class MscGraphBasicMSCScene(QGraphicsScene): ...@@ -198,17 +199,14 @@ class MscGraphBasicMSCScene(QGraphicsScene):
def removeMessage(self, message): def removeMessage(self, message):
u"""Remove a Message from Scene""" u"""Remove a Message from Scene"""
self.bmsc().removeMessage(message) self.bmsc().removeMessage(message)
logger.debug("BEFORE REMOVE ITEM")
if message.scene(): if message.scene():
self.removeItem(message) self.removeItem(message)
logger.debug("BEFORE DELETE")
message.delete() message.delete()
#--------------- Comments #--------------- Comments
def addComment(self, item=None, pos=None): def addComment(self, item=None, pos=None):
u""" u"""
Add new "comment" to the scene and position it in "pos" Add new "comment" to the scene and position it in (optional) "pos"
if any
""" """
if item != None and item.comment() != None: if item != None and item.comment() != None:
return return
......
...@@ -197,6 +197,9 @@ class MscGraphInstance(MscGraphItem): ...@@ -197,6 +197,9 @@ class MscGraphInstance(MscGraphItem):
if y > lowLimit: if y > lowLimit:
lowLimit = y lowLimit = y
# Adjust size to fit Condition boxes
newSize += 40
if newSize < lowLimit: if newSize < lowLimit:
self.bodySize = lowLimit + (2 * self.Offset) self.bodySize = lowLimit + (2 * self.Offset)
else: else:
...@@ -279,8 +282,6 @@ class MscGraphInstance(MscGraphItem): ...@@ -279,8 +282,6 @@ class MscGraphInstance(MscGraphItem):
if change == MscGraphItem.ItemPositionChange: if change == MscGraphItem.ItemPositionChange:
if self.flagFixAxisY: if self.flagFixAxisY:
value.setY(self.pos().y()) value.setY(self.pos().y())
# for mess in self.messages:
# mess.updatePosition()
return MscGraphItem.itemChange(self, change, value) return MscGraphItem.itemChange(self, change, value)
...@@ -288,9 +289,7 @@ class MscGraphInstance(MscGraphItem): ...@@ -288,9 +289,7 @@ class MscGraphInstance(MscGraphItem):
# Label Functions # Label Functions
#************************************************************************** #**************************************************************************
def addLabel(self): def addLabel(self):
# labelValidator = QRegExpValidator(mscregexp.MscNameRegExp, self)
self.label = MscGraphTextItem(self.mscData().name(), self) self.label = MscGraphTextItem(self.mscData().name(), self)
# self.label.setValidator(labelValidator)
self.label.setEditable(True) self.label.setEditable(True)
self.label.setCenterPos(QPointF(0, -15)) self.label.setCenterPos(QPointF(0, -15))
self.label.lostFocus.connect(self._labelLostFocus) self.label.lostFocus.connect(self._labelLostFocus)
...@@ -352,7 +351,6 @@ class MscGraphInstance(MscGraphItem): ...@@ -352,7 +351,6 @@ class MscGraphInstance(MscGraphItem):
if self.headWidth < labelWidth: if self.headWidth < labelWidth:
self.headWidth = labelWidth + (2 * self.Offset) self.headWidth = labelWidth + (2 * self.Offset)
#self.updateEnd()
self.updateDraw() self.updateDraw()
MscGraphItem.resizeItem(self, watched, pos) MscGraphItem.resizeItem(self, watched, pos)
......
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