diff --git a/b_asic/scheduler-gui/graphics_scene.py b/b_asic/scheduler-gui/graphics_scene.py index 0115f90a2e6c6d96dc3b5009940153eeb9a71134..a039be2f4f1d608043614a648618a33805896d5a 100644 --- a/b_asic/scheduler-gui/graphics_scene.py +++ b/b_asic/scheduler-gui/graphics_scene.py @@ -39,6 +39,7 @@ class GraphicsScene(QGraphicsScene): """GraphicsScene subclass of QGraphicsScene acts as a scene to place items on""" _id: Final[int] _schedule: Final[Schedule] + # _schedule: Final[Schedule] # def __init__(self, id: int, schedule: Optional["Schedule"] = None, *args, **kwargs): # def __init__(self, id: int, schedule: Optional["Schedule"] = None): @@ -49,28 +50,33 @@ class GraphicsScene(QGraphicsScene): self._id = id if isinstance(schedule, Schedule): self._schedule = schedule - print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - self._schedule.plot_schedule() - print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - print('From GraphicsScene:') + print('From GraphicsScene/schedule:\t\t', end='') + pprint(schedule) + print('From GraphicsScene/self._schedule:\t', end='') pprint(self._schedule) - print('') - - + # print('') + + + def plot_schedule(self): + self._schedule.plot_schedule() @property - def id(self): + def id(self) -> int: return self._id @property - def schedule(self): + def schedule(self) -> Schedule: + print('From GraphicsScene.schedule:\t\t', end='') + pprint(self._schedule) + # print('') + # print(callable(self._schedule)) return self._schedule - @schedule.setter - def schedule(self, schedule: Schedule): - self._schedule = schedule + # @schedule_.setter + # def schedule_(self, schedule: Schedule): + # self._schedule = schedule -print('\nGraphicsScene.__mro__') -pprint(GraphicsScene.__mro__) -print('') \ No newline at end of file +# print('\nGraphicsScene.__mro__') +# pprint(GraphicsScene.__mro__) +# print('') \ No newline at end of file diff --git a/b_asic/scheduler-gui/main_window.py b/b_asic/scheduler-gui/main_window.py index 530dc3c660d0fa3e109e7e2256dda6fa09efba94..dfd8ebf2b800f02735de358ca57d3259ca27b441 100644 --- a/b_asic/scheduler-gui/main_window.py +++ b/b_asic/scheduler-gui/main_window.py @@ -101,6 +101,7 @@ QCoreApplication.setApplicationName('B-ASIC Scheduler') + class MainWindow(QMainWindow, Ui_MainWindow): """Schedule of an SFG with scheduled Operations.""" # _schedules: dict @@ -168,10 +169,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): ############### @Slot() def callback_pushButton(self) -> None: - print('_scene_count:', self._scene_count) - print('From MainWindow:') - pprint(self._scenes[self._scene_count - 1].schedule()) - print('') + # print('_scene_count:', self._scene_count) + scene = self._scenes[self._scene_count - 1] + sched = scene.schedule + print('From MainWindow:\t\t\t', end='') + pprint(sched) + # print('') + self._scenes[self._scene_count - 1].plot_schedule() # self.printButtonPressed('callback_pushButton()') @Slot() @@ -233,10 +237,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): scene = GraphicsScene(self._scene_count, schedule, self) #scene = QGraphicsScene() self._scenes[self._scene_count] = scene - # self.graphic_view.setScene(scene) - # self.graphic_view.setRenderHint(QPainter.Antialiasing) + self.graphic_view.setScene(scene) + self.graphic_view.setRenderHint(QPainter.Antialiasing) # self.graphic_view.setGeometry(20, 20, self.width(), self.height()) - # self.graphic_view.setDragMode(QGraphicsView.RubberBandDrag) + self.graphic_view.setDragMode(QGraphicsView.RubberBandDrag) self._scene_count += 1