Skip to content
Snippets Groups Projects

Improve signal drawing

Merged Oscar Gustafsson requested to merge linedrawing into master
2 files
+ 21
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -34,7 +34,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
@@ -34,7 +34,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
_components_height: float
_components_height: float
_x_axis_indent: float
_x_axis_indent: float
_event_items: List[QGraphicsItem]
_event_items: List[QGraphicsItem]
_signal_dict: Dict[GraphicsComponentItem, Set[GraphicsSignal]]
_signal_dict: Dict[GraphicsComponentItem, Set[GraphicsSignal]]
def __init__(self, schedule: Schedule, parent: Optional[QGraphicsItem] = None):
def __init__(self, schedule: Schedule, parent: Optional[QGraphicsItem] = None):
@@ -152,7 +152,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
@@ -152,7 +152,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
# if not isinstance(op, (Input, Output)):
# if not isinstance(op, (Input, Output)):
self._components_height += spacing
self._components_height += spacing
component = GraphicsComponentItem(operation)
component = GraphicsComponentItem(operation, parent=self)
component.setPos(self._x_axis_indent + op_start_time, self._components_height)
component.setPos(self._x_axis_indent + op_start_time, self._components_height)
self._components.append(component)
self._components.append(component)
_components_dict[operation] = component
_components_dict[operation] = component
@@ -179,7 +179,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
@@ -179,7 +179,7 @@ class GraphicsGraphItem(GraphicsGraphEvent, QGraphicsItemGroup): # PySide2 /
for output_port in component.operation.outputs:
for output_port in component.operation.outputs:
for signal in output_port.signals:
for signal in output_port.signals:
dest_component = _components_dict[signal.destination.operation]
dest_component = _components_dict[signal.destination.operation]
gui_signal = GraphicsSignal(component, dest_component, signal)
gui_signal = GraphicsSignal(component, dest_component, signal, parent=self)
self.addToGroup(gui_signal)
self.addToGroup(gui_signal)
self._signal_dict[component].add(gui_signal)
self._signal_dict[component].add(gui_signal)
self._signal_dict[dest_component].add(gui_signal)
self._signal_dict[dest_component].add(gui_signal)
Loading