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
4c40cc7c
Commit
4c40cc7c
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add settings file
parent
492645c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#88036
passed
2 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/GUI/main_window.py
+21
-12
21 additions, 12 deletions
b_asic/GUI/main_window.py
b_asic/GUI/settings.py
+9
-0
9 additions, 0 deletions
b_asic/GUI/settings.py
with
30 additions
and
12 deletions
b_asic/GUI/main_window.py
+
21
−
12
View file @
4c40cc7c
...
...
@@ -35,7 +35,14 @@ from b_asic.GUI.drag_button import DragButton
from
b_asic.GUI.gui_interface
import
Ui_main_window
from
b_asic.GUI.port_button
import
PortButton
from
b_asic.GUI.select_sfg_window
import
SelectSFGWindow
from
b_asic.GUI.settings
import
GAP
,
MINBUTTONSIZE
,
PORTHEIGHT
,
PORTWIDTH
from
b_asic.GUI.settings
import
(
GAP
,
MINBUTTONSIZE
,
PORTHEIGHT
,
PORTWIDTH
,
MIN_HEIGHT_SCENE
,
MIN_WIDTH_SCENE
,
)
from
b_asic.GUI.show_pc_window
import
ShowPCWindow
from
b_asic.GUI.simulate_sfg_window
import
Plot
,
SimulateSFGWindow
from
b_asic.GUI.utils
import
decorate_class
,
handle_error
...
...
@@ -47,8 +54,6 @@ from b_asic.signal_flow_graph import SFG
from
b_asic.simulation
import
Simulation
as
FastSimulation
from
b_asic.special_operations
import
Input
,
Output
MIN_WIDTH_SCENE
=
600
MIN_HEIGHT_SCENE
=
520
logging
.
basicConfig
(
level
=
logging
.
INFO
)
...
...
@@ -453,7 +458,11 @@ class MainWindow(QMainWindow):
"""
Determine the distance between each port on the side of an operation.
The method returns the distance that each port should have from 0.
"""
return
[(
height
-
PORTHEIGHT
)
//
2
]
if
ports
==
1
else
[(
PORTHEIGHT
+
GAP
)
*
i
for
i
in
range
(
ports
)]
return
(
[(
height
-
PORTHEIGHT
)
//
2
]
if
ports
==
1
else
[(
PORTHEIGHT
+
GAP
)
*
i
for
i
in
range
(
ports
)]
)
def
add_ports
(
self
,
operation
):
op
=
operation
.
operation
...
...
@@ -466,18 +475,14 @@ class MainWindow(QMainWindow):
)
self
.
portDict
[
operation
]
=
[]
for
i
,
dist
in
enumerate
(
_input_ports_dist
):
port
=
PortButton
(
"
>
"
,
operation
,
op
.
input
(
i
),
self
)
port
=
PortButton
(
"
>
"
,
operation
,
op
.
input
(
i
),
self
)
self
.
portDict
[
operation
].
append
(
port
)
operation
.
ports
.
append
(
port
)
port
.
move
(
0
,
dist
)
port
.
show
()
for
i
,
dist
in
enumerate
(
_output_ports_dist
):
port
=
PortButton
(
"
>
"
,
operation
,
op
.
output
(
i
),
self
)
port
=
PortButton
(
"
>
"
,
operation
,
op
.
output
(
i
),
self
)
self
.
portDict
[
operation
].
append
(
port
)
operation
.
ports
.
append
(
port
)
port
.
move
(
MINBUTTONSIZE
-
PORTWIDTH
,
dist
)
...
...
@@ -525,7 +530,9 @@ class MainWindow(QMainWindow):
def
_get_button_height
(
self
,
op
):
max_ports
=
max
(
op
.
input_count
,
op
.
output_count
)
return
max
(
MINBUTTONSIZE
,
max_ports
*
PORTHEIGHT
+
(
max_ports
-
1
)
*
GAP
)
return
max
(
MINBUTTONSIZE
,
max_ports
*
PORTHEIGHT
+
(
max_ports
-
1
)
*
GAP
)
def
create_operation
(
self
,
op
,
position
=
None
):
try
:
...
...
@@ -537,7 +544,9 @@ class MainWindow(QMainWindow):
else
:
attr_button
.
move
(
*
position
)
attr_button
.
setFixedSize
(
MINBUTTONSIZE
,
self
.
_get_button_height
(
op
))
attr_button
.
setFixedSize
(
MINBUTTONSIZE
,
self
.
_get_button_height
(
op
)
)
attr_button
.
setStyleSheet
(
"
background-color: white; border-style: solid;
"
"
border-color: black; border-width: 2px
"
...
...
This diff is collapsed.
Click to expand it.
b_asic/GUI/settings.py
0 → 100644
+
9
−
0
View file @
4c40cc7c
# Buttons/operations/ports
MINBUTTONSIZE
=
57
PORTHEIGHT
=
19
PORTWIDTH
=
15
GAP
=
MINBUTTONSIZE
-
2
*
PORTHEIGHT
# Window
MIN_WIDTH_SCENE
=
600
MIN_HEIGHT_SCENE
=
520
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