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
981523e1
Commit
981523e1
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Make scheduler GUI use y-location
parent
f55a6e1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!143
Make scheduler GUI use y-location
Pipeline
#88619
passed
2 years ago
Stage: test
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/schedule.py
+2
-0
2 additions, 0 deletions
b_asic/schedule.py
b_asic/scheduler_gui/operation_item.py
+1
-1
1 addition, 1 deletion
b_asic/scheduler_gui/operation_item.py
b_asic/scheduler_gui/scheduler_item.py
+9
-13
9 additions, 13 deletions
b_asic/scheduler_gui/scheduler_item.py
with
12 additions
and
14 deletions
b_asic/schedule.py
+
2
−
0
View file @
981523e1
...
...
@@ -610,6 +610,8 @@ class Schedule:
ax
.
set_yticks
(
ytickpositions
)
ax
.
set_yticklabels
(
yticklabels
)
# Get operation with maximum position
max_pos_op_id
=
max
(
self
.
_y_locations
,
key
=
self
.
_y_locations
.
get
)
yposmin
=
-
self
.
_get_y_position
(
max_pos_op_id
)
-
OPERATION_GAP
ax
.
axis
([
-
1
,
self
.
_schedule_time
+
1
,
yposmin
,
1
])
...
...
This diff is collapsed.
Click to expand it.
b_asic/scheduler_gui/operation_item.py
+
1
−
1
View file @
981523e1
...
...
@@ -48,7 +48,7 @@ class OperationItem(QGraphicsItemGroup):
def
__init__
(
self
,
operation
:
Operation
,
height
:
float
=
0.75
,
height
:
float
=
1.0
,
parent
:
Optional
[
QGraphicsItem
]
=
None
,
):
"""
...
...
This diff is collapsed.
Click to expand it.
b_asic/scheduler_gui/scheduler_item.py
+
9
−
13
View file @
981523e1
...
...
@@ -14,6 +14,7 @@ from typing import Dict, List, Optional, Set, cast
from
qtpy.QtWidgets
import
QGraphicsItem
,
QGraphicsItemGroup
# B-ASIC
from
b_asic._preferences
import
OPERATION_GAP
from
b_asic.operation
import
Operation
from
b_asic.port
import
InputPort
from
b_asic.schedule
import
Schedule
...
...
@@ -34,7 +35,6 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
_axes
:
Optional
[
AxesItem
]
_components
:
List
[
OperationItem
]
_components_height
:
float
_x_axis_indent
:
float
_event_items
:
List
[
QGraphicsItem
]
_signal_dict
:
Dict
[
OperationItem
,
Set
[
SignalItem
]]
...
...
@@ -54,7 +54,6 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
self
.
_schedule
=
schedule
self
.
_axes
=
None
self
.
_components
=
[]
self
.
_components_height
=
0.0
self
.
_x_axis_indent
=
0.2
self
.
_event_items
=
[]
self
.
_signal_dict
=
defaultdict
(
set
)
...
...
@@ -165,36 +164,33 @@ class SchedulerItem(SchedulerEvent, QGraphicsItemGroup): # PySide2 / PyQt5
def
_make_graph
(
self
)
->
None
:
"""
Makes a new graph out of the stored attributes.
"""
# build components
spacing
=
0.2
_components_dict
=
{}
# print('Start times:')
for
op_id
,
op_start_time
in
self
.
schedule
.
start_times
.
items
():
operation
=
cast
(
Operation
,
self
.
schedule
.
sfg
.
find_by_id
(
op_id
))
# if not isinstance(op, (Input, Output)):
self
.
_components_height
+=
spacing
component
=
OperationItem
(
operation
,
parent
=
self
)
component
.
setPos
(
self
.
_x_axis_indent
+
op_start_time
,
self
.
_components_height
self
.
_x_axis_indent
+
op_start_time
,
self
.
schedule
.
_get_y_position
(
op_id
),
)
self
.
_components
.
append
(
component
)
_components_dict
[
operation
]
=
component
self
.
_components_height
+=
component
.
height
self
.
_event_items
+=
component
.
event_items
# self._components_height += spacing
# build axes
schedule_time
=
self
.
schedule
.
schedule_time
self
.
_axes
=
AxesItem
(
schedule
_time
,
int
(
self
.
_components_height
-
spacing
)
max_pos_op_id
=
max
(
self
.
schedule
.
_y_locations
,
key
=
self
.
schedule
.
_y_locations
.
get
)
self
.
_axes
.
setPos
(
0
,
self
.
_components_height
+
spacing
*
2
)
yposmin
=
self
.
schedule
.
_get_y_position
(
max_pos_op_id
)
self
.
_axes
=
AxesItem
(
schedule_time
,
yposmin
+
0.5
)
self
.
_axes
.
setPos
(
0
,
yposmin
+
1
+
OPERATION_GAP
)
self
.
_event_items
+=
self
.
_axes
.
event_items
# self._axes.width = schedule_time
# add axes and components
self
.
addToGroup
(
self
.
_axes
)
# self._axes.update_axes(schedule_time - 2, self._components_height, self._x_axis_indent)
for
component
in
self
.
_components
:
self
.
addToGroup
(
component
)
# self.addToGroup(self._components)
...
...
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