Skip to content
Snippets Groups Projects

Enable configuration of aspects ratios in scheduler GUI

Merged Oscar Gustafsson requested to merge configureschedulergui into master
1 file
+ 25
5
Compare changes
  • Side-by-side
  • Inline
@@ -69,7 +69,8 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
self._make_graph()
def clear(self) -> None:
"""Sets all children's parent to 'None' and delete the children objects.
"""
Sets all children's parent to 'None' and delete the children objects.
"""
self._event_items = []
for item in self.childItems():
@@ -88,7 +89,7 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
The component.
pos : float
The y-position to check.
The x-position to check.
"""
# TODO: implement
assert self.schedule is not None, "No schedule installed."
@@ -128,11 +129,29 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
signal.update_path()
def set_item_active(self, item: OperationItem) -> None:
"""
Set an item as active, i.e., draw it and connecting signals in special colors.
Parameters
----------
item : OperationItem
The item to set as active.
"""
item.set_active()
for signal in self._signal_dict[item]:
signal.set_active()
def set_item_inactive(self, item: OperationItem) -> None:
"""
Set an item as inactive, i.e., draw it and connecting signals in standard colors.
Parameters
----------
item : OperationItem
The item to set as active.
"""
item.set_inactive()
for signal in self._signal_dict[item]:
signal.set_inactive()
@@ -147,8 +166,9 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
self.schedule.move_operation(item.graph_id, move_time)
def is_valid_delta_time(self, delta_time: int) -> bool:
"""Takes in a delta time and returns true if the new schedule time is
valid, false otherwise."""
"""
Takes in a delta time and returns True if the schedule time can be changed by *delta_time*. False otherwise.
"""
# TODO: implement
# item = self.scene().mouseGrabberItem()
assert self.schedule is not None, "No schedule installed."
@@ -158,7 +178,7 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
)
def set_schedule_time(self, delta_time: int) -> None:
"""Set the schedule time and redraw the graph."""
"""Change the schedule time by *delta_time* and redraw the graph."""
if self._axes is None:
raise RuntimeError("No AxesItem!")
assert self.schedule is not None, "No schedule installed."
Loading