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
0fb7307e
Commit
0fb7307e
authored
2 years ago
by
Andreas Bolin
Browse files
Options
Downloads
Patches
Plain Diff
dump branch
parent
8c9bfcab
No related branches found
No related tags found
1 merge request
!78
Add scheduler GUI
Pipeline
#72565
passed
2 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+3
-1
3 additions, 1 deletion
.gitignore
b_asic/schedule-gui/main_window.py
+83
-0
83 additions, 0 deletions
b_asic/schedule-gui/main_window.py
b_asic/schedule-gui/main_window.ui
+161
-0
161 additions, 0 deletions
b_asic/schedule-gui/main_window.ui
with
247 additions
and
1 deletion
.gitignore
+
3
−
1
View file @
0fb7307e
...
...
@@ -109,4 +109,6 @@ venv/
_b_asic_debug_log.txt
.idea/
.qt_for_python/
*.user
\ No newline at end of file
*.pyproject.user
*.pyproject
*/schedule-gui/ui/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
b_asic/schedule-gui/main_window.py
0 → 100644
+
83
−
0
View file @
0fb7307e
# This Python file uses the following encoding: utf-8
"""
B-ASIC Schedule-gui Main Window Module.
This file opens the main window of the schedule-gui for B-ASIC when run.
"""
import
os
#from pathlib import Path
import
sys
from
typing
import
Any
#from matplotlib.pyplot import bar
from
qtpy.QtWidgets
import
QApplication
,
QMainWindow
,
QMessageBox
#from qtpy.QtCore import QFile
class
MainWindow
(
QMainWindow
):
_test
:
int
_ui
:
Any
def
__init__
(
self
):
super
(
MainWindow
,
self
).
__init__
()
self
.
_test
=
5
self
.
init_ui
()
def
init_ui
(
self
):
from
qtpy
import
uic
#uic.compileUiDir('.', False, \
# lambda dir, file : [dir+str('/ui/'), str('ui_')+file],)
_ui
=
uic
.
loadUi
(
"
main_window.ui
"
,
self
)
# Load the .ui file
_ui
.
pushButton
.
clicked
.
connect
(
self
.
callback_pushButton
)
_ui
.
actionLoad_SFG
.
triggered
.
connect
(
self
.
callback_menu_load_SFG
)
_ui
.
actionSave_schedule
.
triggered
.
connect
(
self
.
callback_menu_save_schedule
)
_ui
.
actionQuit
.
triggered
.
connect
(
self
.
close
)
_ui
.
actionNode_info
.
triggered
.
connect
(
self
.
callback_menu_node_info
)
#_ui.actionNode_info.triggered.connect(self.update_statusbar)
print
(
type
(
_ui
))
#_ui, _base_class = uic.loadUiType("main_window_ui.ui", None) # Load the .ui file
#print(type(_base_class))
print
(
type
(
self
.
_test
))
QT_API
=
os
.
environ
.
get
(
'
QT_API
'
)
print
(
"
QT_API:
"
+
QT_API
)
def
callback_pushButton
(
self
):
self
.
printButtonPressed
(
'
callback_pushButton
'
)
def
callback_menu_load_SFG
(
self
):
self
.
printButtonPressed
(
'
callback_menu_load_SFG
'
)
self
.
update_statusbar
(
'
SFG loaded successfully
'
)
def
callback_menu_save_schedule
(
self
):
self
.
printButtonPressed
(
'
callback_menu_save_schedule
'
)
self
.
update_statusbar
(
'
Schedule saved successfully
'
)
def
callback_menu_node_info
(
self
,
checked
:
bool
):
#if _ui.actionNode_info.
print
(
type
(
checked
))
print
(
checked
)
self
.
printButtonPressed
(
'
callback_menu_node_info
'
)
#self.update_statusbar()
def
printButtonPressed
(
self
,
func_name
:
str
):
self
.
label_2
.
setText
(
"
hello
"
)
alert
=
QMessageBox
(
self
)
alert
.
setText
(
"
Called from
"
+
func_name
+
'
!
'
)
alert
.
exec_
()
def
update_statusbar
(
self
,
msg
:
str
):
self
.
statusbar
.
showMessage
(
msg
)
def
start_gui
():
app
=
QApplication
(
sys
.
argv
)
widget
=
MainWindow
()
widget
.
show
()
sys
.
exit
(
app
.
exec_
())
if
__name__
==
"
__main__
"
:
start_gui
()
This diff is collapsed.
Click to expand it.
b_asic/schedule-gui/main_window.ui
0 → 100644
+
161
−
0
View file @
0fb7307e
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
MainWindow
</class>
<widget
class=
"QMainWindow"
name=
"MainWindow"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
800
</width>
<height>
600
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
800
</width>
<height>
600
</height>
</size>
</property>
<property
name=
"windowTitle"
>
<string>
MainWindow
</string>
</property>
<widget
class=
"QWidget"
name=
"centralwidget"
>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"geometry"
>
<rect>
<x>
150
</x>
<y>
90
</y>
<width>
461
</width>
<height>
351
</height>
</rect>
</property>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
</property>
<widget
class=
"QWidget"
name=
"scrollAreaWidgetContents"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
459
</width>
<height>
349
</height>
</rect>
</property>
<widget
class=
"QPushButton"
name=
"pushButton"
>
<property
name=
"geometry"
>
<rect>
<x>
120
</x>
<y>
110
</y>
<width>
83
</width>
<height>
25
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
PushButton
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"geometry"
>
<rect>
<x>
50
</x>
<y>
40
</y>
<width>
62
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
label_2
</string>
</property>
</widget>
</widget>
</widget>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"geometry"
>
<rect>
<x>
110
</x>
<y>
50
</y>
<width>
62
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
label
</string>
</property>
</widget>
</widget>
<widget
class=
"QMenuBar"
name=
"menubar"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
800
</width>
<height>
22
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuFile"
>
<property
name=
"title"
>
<string>
&
File
</string>
</property>
<addaction
name=
"actionLoad_SFG"
/>
<addaction
name=
"actionSave_schedule"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionQuit"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuView"
>
<property
name=
"title"
>
<string>
&
View
</string>
</property>
<addaction
name=
"actionNode_info"
/>
</widget>
<addaction
name=
"menuFile"
/>
<addaction
name=
"menuView"
/>
</widget>
<widget
class=
"QStatusBar"
name=
"statusbar"
/>
<action
name=
"actionLoad_SFG"
>
<property
name=
"text"
>
<string>
&
Load SFG...
</string>
</property>
<property
name=
"toolTip"
>
<string>
Load Signal Flow Graph
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+O
</string>
</property>
</action>
<action
name=
"actionSave_schedule"
>
<property
name=
"text"
>
<string>
&
Save schedule...
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+S
</string>
</property>
</action>
<action
name=
"actionQuit"
>
<property
name=
"text"
>
<string>
&
Quit
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+Q
</string>
</property>
</action>
<action
name=
"actionNode_info"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
&
Node info
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+I
</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>
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