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
27ba1525
Commit
27ba1525
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Start enabling moving operations to inbetween other operations in y-direction
parent
0db47102
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!220
Start enabling moving operations to inbetween other operations in y-direction
Pipeline
#90108
passed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/scheduler_gui/scheduler_event.py
+12
-3
12 additions, 3 deletions
b_asic/scheduler_gui/scheduler_event.py
with
12 additions
and
3 deletions
b_asic/scheduler_gui/scheduler_event.py
+
12
−
3
View file @
27ba1525
...
...
@@ -6,7 +6,7 @@ B-ASIC Scheduler-GUI Graphics Scheduler Event Module.
Contains the scheduler_ui SchedulerEvent class containing event filters and
handlers for SchedulerItem objects.
"""
import
math
from
typing
import
List
,
Optional
,
overload
# QGraphics and QPainter imports
...
...
@@ -195,8 +195,8 @@ class SchedulerEvent: # PyQt5
def
update_pos
(
operation_item
,
dx
,
dy
):
pos_x
=
operation_item
.
x
()
+
dx
pos_y
=
operation_item
.
y
()
+
dy
*
(
OPERATION_GAP
+
OPERATION_HEIGHT
)
if
self
.
is_component_valid_pos
(
operation_item
,
pos_x
):
pos_y
=
operation_item
.
y
()
+
dy
*
(
OPERATION_GAP
+
OPERATION_HEIGHT
)
operation_item
.
setX
(
pos_x
)
operation_item
.
setY
(
pos_y
)
self
.
_current_pos
.
setX
(
self
.
_current_pos
.
x
()
+
dx
)
...
...
@@ -208,7 +208,7 @@ class SchedulerEvent: # PyQt5
delta_x
=
(
item
.
mapToParent
(
event
.
pos
())
-
self
.
_current_pos
).
x
()
delta_y
=
(
item
.
mapToParent
(
event
.
pos
())
-
self
.
_current_pos
).
y
()
delta_y_steps
=
round
(
delta_y
/
(
OPERATION_GAP
+
OPERATION_HEIGHT
))
delta_y_steps
=
round
(
2
*
delta_y
/
(
OPERATION_GAP
+
OPERATION_HEIGHT
))
/
2
if
delta_x
>
0.505
:
update_pos
(
item
,
1
,
delta_y_steps
)
elif
delta_x
<
-
0.505
:
...
...
@@ -224,6 +224,7 @@ class SchedulerEvent: # PyQt5
allows the item to receive future move, release and double-click events.
"""
item
:
OperationItem
=
self
.
scene
().
mouseGrabberItem
()
self
.
_old_op_position
=
self
.
_schedule
.
_y_locations
[
item
.
operation
.
graph_id
]
self
.
_signals
.
component_selected
.
emit
(
item
.
graph_id
)
self
.
_current_pos
=
item
.
mapToParent
(
event
.
pos
())
self
.
set_item_active
(
item
)
...
...
@@ -242,6 +243,14 @@ class SchedulerEvent: # PyQt5
if
pos_x
>
self
.
_schedule
.
schedule_time
:
pos_x
=
pos_x
%
self
.
_schedule
.
schedule_time
redraw
=
True
if
self
.
_schedule
.
_y_locations
[
item
.
operation
.
graph_id
]
%
1
:
# TODO: move other operations
self
.
_schedule
.
_y_locations
[
item
.
operation
.
graph_id
]
=
math
.
ceil
(
self
.
_schedule
.
_y_locations
[
item
.
operation
.
graph_id
]
)
pos_y
=
item
.
y
()
+
(
OPERATION_GAP
+
OPERATION_HEIGHT
)
/
2
item
.
setY
(
pos_y
)
redraw
=
True
if
redraw
:
item
.
setX
(
pos_x
)
self
.
_redraw_lines
(
item
)
...
...
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