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):
"""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
......@@ -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
......
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