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
21a75cb1
Commit
21a75cb1
authored
2 years ago
by
Andreas Bolin
Browse files
Options
Downloads
Patches
Plain Diff
workspace dump
parent
44eeb1f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!78
Add scheduler GUI
Pipeline
#72704
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/scheduler-gui/main_window.py
+17
-6
17 additions, 6 deletions
b_asic/scheduler-gui/main_window.py
with
17 additions
and
6 deletions
b_asic/scheduler-gui/main_window.py
+
17
−
6
View file @
21a75cb1
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
"""
B-ASIC Scheduler-gui Module.
"""
B-ASIC Scheduler-gui Module.
Contains the scheduler-gui class for scheduling operations in an SFG.
Contains the scheduler-gui class for scheduling operations in an SFG.
Start main-window with start_gui().
"""
"""
...
@@ -16,11 +18,11 @@ import qtpy
...
@@ -16,11 +18,11 @@ import qtpy
from
qtpy
import
uic
,
QtCore
,
QtGui
,
QtWidgets
from
qtpy
import
uic
,
QtCore
,
QtGui
,
QtWidgets
from
qtpy.QtCore
import
Qt
,
Slot
,
QSettings
from
qtpy.QtCore
import
Qt
,
Slot
,
QSettings
from
qtpy.QtGui
import
QCloseEvent
from
qtpy.QtGui
import
QCloseEvent
from
qtpy.QtWidgets
import
QApplication
,
QMainWindow
,
QMessageBox
from
qtpy.QtWidgets
import
QApplication
,
QMainWindow
,
QMessageBox
,
QAbstractButton
# QGraphics and QPainter imports
# QGraphics and QPainter imports
from
qtpy.QtWidgets
import
(
from
qtpy.QtWidgets
import
(
QGraphicsView
,
QGraphicsScene
,
QGraphicsView
,
QGraphicsScene
,
QGraphicsWidget
,
QGraphicsLayout
,
QGraphicsLinearLayout
,
QGraphicsGridLayout
,
QGraphicsLayoutItem
,
QGraphicsAnchorLayout
,
QGraphicsLayout
,
QGraphicsLinearLayout
,
QGraphicsGridLayout
,
QGraphicsLayoutItem
,
QGraphicsAnchorLayout
,
QGraphicsItem
,
QGraphicsItemGroup
,
QGraphicsItemAnimation
QGraphicsItem
,
QGraphicsItemGroup
,
QGraphicsItemAnimation
)
)
...
@@ -173,20 +175,30 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -173,20 +175,30 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self
.
menu_node_info
.
setChecked
(
True
)
self
.
menu_node_info
.
setChecked
(
True
)
################
################
#### Events ####
#### Events ####
################
################
def
_close_event
(
self
,
event
:
QCloseEvent
)
->
None
:
def
_close_event
(
self
,
event
:
QCloseEvent
)
->
None
:
"""
Replace 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?
"
))
box
=
QMessageBox
(
self
)
box
.
setWindowTitle
(
self
.
tr
(
'
Confirm Exit
'
))
box
.
setText
(
'
<h3>
'
+
self
.
tr
(
'
Confirm Exit
'
)
+
'
</h3><p><br>
'
+
self
.
tr
(
'
Are you sure you want to exit?
'
)
+
'
<br></p>
'
)
box
.
setIcon
(
QMessageBox
.
Question
)
box
.
setStandardButtons
(
QMessageBox
.
Yes
|
QMessageBox
.
No
)
box
.
setButtonText
(
QMessageBox
.
Yes
,
self
.
tr
(
"
&Exit
"
))
box
.
setButtonText
(
QMessageBox
.
No
,
self
.
tr
(
"
&Cancel
"
))
ret
=
box
.
exec_
()
if
ret
==
QMessageBox
.
StandardButton
.
Yes
:
if
ret
==
QMessageBox
.
StandardButton
.
Yes
:
event
.
accept
()
event
.
accept
()
else
:
else
:
event
.
ignore
()
event
.
ignore
()
#################################
#################################
#### Helper member functions ####
#### Helper member functions ####
#################################
#################################
...
@@ -204,7 +216,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -204,7 +216,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self
.
statusbar
.
showMessage
(
msg
)
self
.
statusbar
.
showMessage
(
msg
)
def
start_gui
():
def
start_gui
():
app
=
QApplication
(
sys
.
argv
)
app
=
QApplication
(
sys
.
argv
)
window
=
MainWindow
()
window
=
MainWindow
()
...
...
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