Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Commits
44eeb1f9
Commit
44eeb1f9
authored
2 years ago
by
Andreas Bolin
Browse files
Options
Downloads
Patches
Plain Diff
workspace dump
parent
9074665c
No related branches found
Branches containing commit
No related tags found
1 merge request
!78
Add scheduler GUI
Pipeline
#72671
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
b_asic/scheduler-gui/main_window.py
+18
-29
18 additions, 29 deletions
b_asic/scheduler-gui/main_window.py
with
20 additions
and
30 deletions
.gitignore
+
2
−
1
View file @
44eeb1f9
...
...
@@ -111,4 +111,5 @@ _b_asic_debug_log.txt
.qt_for_python/
*.pyproject.user
*.pyproject
*/scheduler-gui/ui/
\ No newline at end of file
*/scheduler-gui/ui/
TODO.txt
\ No newline at end of file
This diff is collapsed.
Click to expand it.
b_asic/scheduler-gui/main_window.py
+
18
−
29
View file @
44eeb1f9
...
...
@@ -7,23 +7,28 @@ Contains the scheduler-gui class for scheduling operations in an SFG.
import
os
,
sys
from
pathlib
import
Path
from
typing
import
Any
from
pathlib
import
Path
from
typing
import
Any
#from matplotlib.pyplot import bar
#from diagram import *
from
qtpy
import
uic
,
QtCore
,
QtGui
,
QtWidgets
import
qtpy
from
qtpy
import
uic
,
QtCore
,
QtGui
,
QtWidgets
from
qtpy.QtCore
import
Qt
,
Slot
,
QSettings
from
qtpy.QtGui
import
QCloseEvent
from
qtpy.QtWidgets
import
QApplication
,
QMainWindow
,
QMessageBox
# QPainter imports
from
qtpy.QtWidgets
import
QGraphicsView
,
QGraphicsScene
,
QMessageBox
from
qtpy.QtGui
import
(
# QGraphics and QPainter imports
from
qtpy.QtWidgets
import
(
QGraphicsView
,
QGraphicsScene
,
QGraphicsLayout
,
QGraphicsLinearLayout
,
QGraphicsGridLayout
,
QGraphicsLayoutItem
,
QGraphicsAnchorLayout
,
QGraphicsItem
,
QGraphicsItemGroup
,
QGraphicsItemAnimation
)
from
qtpy.QtGui
import
(
QPaintEvent
,
QPainter
,
QPainterPath
,
QColor
,
QBrush
,
QPen
,
QFont
,
QPolygon
,
QLinearGradient
)
from
qtpy.QtCore
import
(
QRect
)
# Debug struff
...
...
@@ -87,30 +92,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def
_init_ui
(
self
)
->
None
:
"""
Initialize the ui
"""
# self._ui = uic.loadUi("main_window.ui", None) # Load the .ui file
# #self._ui.setupUi(self)
# print('self:\t\t',str(type(self)))
# print('self._ui:\t',str(type(self._ui)))
# self._ui.pushbutton_add.clicked.connect(self.callback_pushButton)
# self._ui.menu_load_sfg.triggered.connect(self.load_sfg)
# self._ui.menu_save_schedule.triggered.connect(self.save_schedule)
# self._ui.menu_quit.triggered.connect(self._ui.close)
# self._ui.menu_node_info.triggered.connect(self.toggle_node_info)
# self._ui.show()
# if __debug__:
# #self.ui = Ui_MainWindow()
# #self.ui.setupUi(self)
# self.setupUi(self)
# #print(type(self.ui))
# else:
# uic.loadUi("main_window.ui", self) # Load the .ui file
self
.
_settings
=
QSettings
()
self
.
setupUi
(
self
)
self
.
closeEvent
=
self
.
_close_event
#
Ini
t signals
/
slots
#
Connec
t signals
to
slots
self
.
pushbutton_add
.
clicked
.
connect
(
self
.
callback_pushButton
)
self
.
menu_load_sfg
.
triggered
.
connect
(
self
.
open
)
self
.
menu_save_schedule
.
triggered
.
connect
(
self
.
save
)
...
...
@@ -118,6 +104,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self
.
menu_node_info
.
triggered
.
connect
(
self
.
_toggle_component_info
)
self
.
splitter_center
.
splitterMoved
.
connect
(
self
.
_splitter_center_moved
)
# Setup event member functions
self
.
closeEvent
=
self
.
_close_event
# Init info sidebar
for
i
in
range
(
10
):
self
.
listWidget
.
addItem
(
'
this is a very very very very long string that says abolutly nothing
'
+
str
(
i
))
...
...
@@ -188,7 +177,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
#### Events ####
################
def
_close_event
(
self
,
event
:
QCloseEvent
)
->
None
:
"""
Overloads
QMainWindow default closeEvent(QCloseEvent) event
"""
"""
Replace
QMainWindow default closeEvent(QCloseEvent) event
"""
ret
=
QMessageBox
.
question
(
self
,
self
.
tr
(
"
Application
"
),
self
.
tr
(
"
Do you want to exit?
"
))
if
ret
==
QMessageBox
.
StandardButton
.
Yes
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment