Skip to content
Snippets Groups Projects
Commit c4966d9d authored by Andreas Bolin's avatar Andreas Bolin
Browse files

workspace dump

parent 654d8ca4
No related branches found
No related tags found
1 merge request!78Add scheduler GUI
Pipeline #72926 passed
...@@ -39,6 +39,7 @@ class GraphicsScene(QGraphicsScene): ...@@ -39,6 +39,7 @@ class GraphicsScene(QGraphicsScene):
"""GraphicsScene subclass of QGraphicsScene acts as a scene to place items on""" """GraphicsScene subclass of QGraphicsScene acts as a scene to place items on"""
_id: Final[int] _id: Final[int]
_schedule: Final[Schedule] _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, *args, **kwargs):
# def __init__(self, id: int, schedule: Optional["Schedule"] = None): # def __init__(self, id: int, schedule: Optional["Schedule"] = None):
...@@ -49,28 +50,33 @@ class GraphicsScene(QGraphicsScene): ...@@ -49,28 +50,33 @@ class GraphicsScene(QGraphicsScene):
self._id = id self._id = id
if isinstance(schedule, Schedule): if isinstance(schedule, Schedule):
self._schedule = schedule self._schedule = schedule
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') print('From GraphicsScene/schedule:\t\t', end='')
self._schedule.plot_schedule() pprint(schedule)
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') print('From GraphicsScene/self._schedule:\t', end='')
print('From GraphicsScene:')
pprint(self._schedule) pprint(self._schedule)
print('') # print('')
def plot_schedule(self):
self._schedule.plot_schedule()
@property @property
def id(self): def id(self) -> int:
return self._id return self._id
@property @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 return self._schedule
@schedule.setter # @schedule_.setter
def schedule(self, schedule: Schedule): # def schedule_(self, schedule: Schedule):
self._schedule = schedule # self._schedule = schedule
print('\nGraphicsScene.__mro__') # print('\nGraphicsScene.__mro__')
pprint(GraphicsScene.__mro__) # pprint(GraphicsScene.__mro__)
print('') # print('')
\ No newline at end of file \ No newline at end of file
...@@ -101,6 +101,7 @@ QCoreApplication.setApplicationName('B-ASIC Scheduler') ...@@ -101,6 +101,7 @@ QCoreApplication.setApplicationName('B-ASIC Scheduler')
class MainWindow(QMainWindow, Ui_MainWindow): class MainWindow(QMainWindow, Ui_MainWindow):
"""Schedule of an SFG with scheduled Operations.""" """Schedule of an SFG with scheduled Operations."""
# _schedules: dict # _schedules: dict
...@@ -168,10 +169,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -168,10 +169,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
############### ###############
@Slot() @Slot()
def callback_pushButton(self) -> None: def callback_pushButton(self) -> None:
print('_scene_count:', self._scene_count) # print('_scene_count:', self._scene_count)
print('From MainWindow:') scene = self._scenes[self._scene_count - 1]
pprint(self._scenes[self._scene_count - 1].schedule()) sched = scene.schedule
print('') print('From MainWindow:\t\t\t', end='')
pprint(sched)
# print('')
self._scenes[self._scene_count - 1].plot_schedule()
# self.printButtonPressed('callback_pushButton()') # self.printButtonPressed('callback_pushButton()')
@Slot() @Slot()
...@@ -233,10 +237,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -233,10 +237,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
scene = GraphicsScene(self._scene_count, schedule, self) scene = GraphicsScene(self._scene_count, schedule, self)
#scene = QGraphicsScene() #scene = QGraphicsScene()
self._scenes[self._scene_count] = scene self._scenes[self._scene_count] = scene
# self.graphic_view.setScene(scene) self.graphic_view.setScene(scene)
# self.graphic_view.setRenderHint(QPainter.Antialiasing) self.graphic_view.setRenderHint(QPainter.Antialiasing)
# self.graphic_view.setGeometry(20, 20, self.width(), self.height()) # 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 self._scene_count += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment