Skip to content
Snippets Groups Projects
Commit a5eed061 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Fix line length and module init

parent afb9a462
No related branches found
No related tags found
1 merge request!170Fix line length and module init
Pipeline #88985 passed
......@@ -2,14 +2,6 @@
Graphical user interface for B-ASIC.
"""
from b_asic.GUI.about_window import *
from b_asic.GUI.arrow import *
from b_asic.GUI.drag_button import *
from b_asic.GUI.gui_interface import *
from b_asic.GUI.main_window import *
from b_asic.GUI.port_button import *
from b_asic.GUI.properties_window import *
from b_asic.GUI.select_sfg_window import *
from b_asic.GUI.show_pc_window import *
from b_asic.GUI.simulate_sfg_window import *
from b_asic.GUI.utils import *
from b_asic.GUI.main_window import MainWindow, start_gui
__all__ = ['MainWindow', 'start_gui']
"""B-ASIC Scheduler-gui Module.
"""
B-ASIC Scheduler-gui Module.
Graphical user interface for B-ASIC scheduler.
"""
from b_asic.scheduler_gui.main_window import MainWindow, start_gui
__author__ = "Andreas Bolin"
# __all__ = ['main_window', 'graphics_graph', 'component_item', 'graphics_axes', 'graphics_timeline_item']
from b_asic.scheduler_gui.axes_item import *
from b_asic.scheduler_gui.logger import *
from b_asic.scheduler_gui.main_window import *
from b_asic.scheduler_gui.operation_item import *
from b_asic.scheduler_gui.scheduler_event import *
from b_asic.scheduler_gui.scheduler_item import *
from b_asic.scheduler_gui.signal_item import *
from b_asic.scheduler_gui.timeline_item import *
__all__ = ['MainWindow', 'start_gui']
......@@ -58,14 +58,21 @@ from typing import Type, Union
def getLogger(
filename: str = "scheduler-gui.log", loglevel: str = "INFO"
) -> Logger:
"""This function creates console- and filehandler and from those, creates a logger object.
"""
This function creates console- and filehandler and from those, creates a logger
object.
Parameters
==========
Args:
filename (str, optional): Output filename. Defaults to 'scheduler-gui.log'.
loglevel (str, optional): The minimum level that the logger will log. Defaults to 'INFO'.
filename : str optional
Output filename. Defaults to 'scheduler-gui.log'.
loglevel : str, optional
The minimum level that the logger will log. Defaults to 'INFO'.
Returns:
Logger: 'logging.Logger' object.
Returns
=======
Logger : 'logging.Logger' object.
"""
# logger = logging.getLogger(name)
......
......@@ -346,7 +346,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
Takes in a boolean and hide or show the info table accordingly with
'checked'.
"""
# Note: splitter handler index 0 is a hidden splitter handle far most left, use index 1
# Note: splitter handler index 0 is a hidden splitter handle far most left,
# use index 1
# settings = QSettings()
_, max_ = self.splitter.getRange(1) # tuple(min, max)
......
......@@ -3,7 +3,8 @@
"""
B-ASIC Scheduler-gui Graphics Component Item Module.
Contains the scheduler-gui OperationItem class for drawing and maintain a component in a graph.
Contains the scheduler-gui OperationItem class for drawing and maintain a component
in a graph.
"""
from typing import Dict, List, Optional, Union
......@@ -60,7 +61,8 @@ class OperationItem(QGraphicsItemGroup):
parent: Optional[QGraphicsItem] = None,
):
"""
Construct a OperationItem. *parent* is passed to QGraphicsItemGroup's constructor.
Construct a OperationItem. *parent* is passed to QGraphicsItemGroup's
constructor.
"""
super().__init__(parent=parent)
self._operation = operation
......@@ -167,7 +169,8 @@ class OperationItem(QGraphicsItemGroup):
Qt.GlobalColor.black
) # used by component outline
latency_outline_pen.setWidthF(2 / self._scale)
# latency_outline_pen.setCapStyle(Qt.RoundCap) # Qt.FlatCap, Qt.SquareCap (default), Qt.RoundCap
# latency_outline_pen.setCapStyle(Qt.RoundCap)
# Qt.FlatCap, Qt.SquareCap (default), Qt.RoundCap
latency_outline_pen.setJoinStyle(
Qt.RoundJoin
) # Qt.MiterJoin, Qt.BevelJoin (default), Qt.RoundJoin, Qt.SvgMiterJoin
......
......@@ -3,7 +3,8 @@
"""
B-ASIC Scheduler-gui Graphics Graph Event Module.
Contains the scheduler-gui SchedulerEvent class containing event filters and handlers for SchedulerItem objects.
Contains the scheduler-gui SchedulerEvent class containing event filters and
handlers for SchedulerItem objects.
"""
from typing import List, Optional, overload
......@@ -121,18 +122,19 @@ class SchedulerEvent: # PyQt5
if isinstance(item, OperationItem): # one component
switch = {
# QEvent.FocusIn: self.operation_focusInEvent,
# QEvent.GraphicsSceneContextMenu: self.operation_contextMenuEvent,
# QEvent.GraphicsSceneContextMenu: self.operation_contextMenuEvent,
# QEvent.GraphicsSceneDragEnter: self.operation_dragEnterEvent,
# QEvent.GraphicsSceneDragMove: self.operation_dragMoveEvent,
# QEvent.GraphicsSceneDragLeave: self.operation_dragLeaveEvent,
# QEvent.GraphicsSceneDrop: self.operation_dropEvent,
# QEvent.GraphicsSceneHoverEnter: self.operation_hoverEnterEvent,
# QEvent.GraphicsSceneHoverEnter: self.operation_hoverEnterEvent,
# QEvent.GraphicsSceneHoverMove: self.operation_hoverMoveEvent,
# QEvent.GraphicsSceneHoverLeave: self.operation_hoverLeaveEvent,
# QEvent.GraphicsSceneHoverLeave: self.operation_hoverLeaveEvent,
QEvent.GraphicsSceneMouseMove: self.operation_mouseMoveEvent,
QEvent.GraphicsSceneMousePress: self.operation_mousePressEvent,
QEvent.GraphicsSceneMouseRelease: self.operation_mouseReleaseEvent,
# QEvent.GraphicsSceneMouseDoubleClick: self.operation_mouseDoubleClickEvent,
# QEvent.GraphicsSceneMouseDoubleClick:
# self.operation_mouseDoubleClickEvent,
# QEvent.GraphicsSceneWheel: self.operation_wheelEvent
}
handler = switch.get(event.type())
......
......@@ -57,7 +57,8 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
self, schedule: Schedule, parent: Optional[QGraphicsItem] = None
):
"""
Construct a SchedulerItem. *parent* is passed to QGraphicsItemGroup's constructor.
Construct a SchedulerItem. *parent* is passed to QGraphicsItemGroup's
constructor.
"""
# QGraphicsItemGroup.__init__(self, self)
# SchedulerEvent.__init__(self)
......@@ -151,7 +152,8 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
def set_item_inactive(self, item: OperationItem) -> None:
"""
Set an item as inactive, i.e., draw it and connecting signals in standard colors.
Set an item as inactive, i.e., draw it and connecting signals in standard
colors.
Parameters
----------
......@@ -174,7 +176,8 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
def is_valid_delta_time(self, delta_time: int) -> bool:
"""
Takes in a delta time and returns True if the schedule time can be changed by *delta_time*. 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()
......
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