Commit 79faa997 authored by Maxime Perrotin's avatar Maxime Perrotin

Improve statechart rendering

parent 23282983
......@@ -473,6 +473,7 @@ class Channel(Signalroute):
class Controlpoint(QGraphicsPathItem, object):
''' Class handling one edge control point (to change bezier curves) '''
user_can_connect = False # not used but will avoid exceptions
def __init__(self, pos, edge):
''' Set the original control point - with color, shape '''
path = QPainterPath()
......
This diff is collapsed.
......@@ -195,7 +195,7 @@ class EditableText(QGraphicsTextItem, object):
parent_rect = self.parent.boundingRect()
rect = self.boundingRect()
# Use parent symbol alignment requirement
# Does not support right nor bottom alignment
# Does not support right alignment (just add it when needed)
alignment = self.parent.textbox_alignment
rect_center = parent_rect.center() - rect.center()
if alignment & Qt.AlignLeft:
......@@ -208,6 +208,8 @@ class EditableText(QGraphicsTextItem, object):
y_pos = 0
elif alignment & Qt.AlignVCenter:
y_pos = rect_center.y()
elif alignment & Qt.AlignBottom:
y_pos = parent_rect.height()
else:
y_pos = 0
self.setPos(x_pos, y_pos)
......
......@@ -1064,6 +1064,13 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
# in that case ast was provided in the parameters
LOG.debug("Statechart rendering: no CONTEXT.processes[0]")
# Create a simpler list of input signals including the timers
process_ast.all_signals = {sig['name'].lower()
for sig in process_ast.input_signals}
for each in process_ast.timers:
process_ast.all_signals.add(each)
# TODO: add continuous signals
# Flatten nested states (no, because neato does not support it,
# dot supports only vertically-aligned states, and fdp does not
# support curved edges and is buggy with pygraphviz anyway)
......
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