Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
5a275ff7
Commit
5a275ff7
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Move readout to label widget on plot
parent
acc019fa
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!921
Add interactive task plot script.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/task_plots/iplot_tasks.py
+9
-8
9 additions, 8 deletions
tools/task_plots/iplot_tasks.py
with
9 additions
and
8 deletions
tools/task_plots/iplot_tasks.py
+
9
−
8
View file @
5a275ff7
...
@@ -499,8 +499,11 @@ class Container:
...
@@ -499,8 +499,11 @@ class Container:
wcanvas
.
config
(
width
=
1000
,
height
=
300
)
wcanvas
.
config
(
width
=
1000
,
height
=
300
)
wcanvas
.
pack
(
side
=
tk
.
TOP
,
expand
=
True
,
fill
=
tk
.
BOTH
)
wcanvas
.
pack
(
side
=
tk
.
TOP
,
expand
=
True
,
fill
=
tk
.
BOTH
)
toolbar
=
tkagg
.
NavigationToolbar2TkAgg
(
canvas
,
self
.
window
)
toolbar
=
tkagg
.
NavigationToolbar2TkAgg
(
canvas
,
self
.
window
)
toolbar
.
update
()
toolbar
.
update
()
self
.
output
=
tk
.
StringVar
()
label
=
tk
.
Label
(
self
.
window
,
textvariable
=
self
.
output
,
bg
=
"
white
"
,
fg
=
"
red
"
,
bd
=
2
)
label
.
pack
(
side
=
tk
.
RIGHT
,
expand
=
True
,
fill
=
tk
.
X
)
wcanvas
.
pack
(
side
=
tk
.
TOP
,
expand
=
True
,
fill
=
tk
.
BOTH
)
wcanvas
.
pack
(
side
=
tk
.
TOP
,
expand
=
True
,
fill
=
tk
.
BOTH
)
canvas
.
draw
()
canvas
.
draw
()
...
@@ -512,12 +515,7 @@ class Container:
...
@@ -512,12 +515,7 @@ class Container:
fig
.
canvas
.
mpl_connect
(
'
button_press_event
'
,
self
.
onclick
)
fig
.
canvas
.
mpl_connect
(
'
button_press_event
'
,
self
.
onclick
)
def
onclick
(
self
,
event
):
def
onclick
(
self
,
event
):
#print('%s click: button=%d, x=%d, y=%d, xdata=%f, ydata=%f' %
# Find thread, then scan for bounded task.
# ('double' if event.dblclick else 'single', event.button,
# event.x, event.y, event.xdata, event.ydata))
# Find thread, then scan for task.
# XXX are sorted by tic? If so could break earlier.
try
:
try
:
thread
=
int
(
round
(
event
.
ydata
))
-
1
thread
=
int
(
round
(
event
.
ydata
))
-
1
if
thread
>=
0
and
thread
<
self
.
nthread
:
if
thread
>=
0
and
thread
<
self
.
nthread
:
...
@@ -526,7 +524,10 @@ class Container:
...
@@ -526,7 +524,10 @@ class Container:
labels
=
self
.
llabels
[
thread
]
labels
=
self
.
llabels
[
thread
]
for
i
in
range
(
len
(
tics
)):
for
i
in
range
(
len
(
tics
)):
if
event
.
xdata
>
tics
[
i
]
and
event
.
xdata
<
tocs
[
i
]:
if
event
.
xdata
>
tics
[
i
]
and
event
.
xdata
<
tocs
[
i
]:
print
"
task =
"
,
labels
[
i
],
"
tic/toc =
"
,
tics
[
i
],
"
/
"
,
tocs
[
i
]
tic
=
"
{0:.3f}
"
.
format
(
tics
[
i
])
toc
=
"
{0:.3f}
"
.
format
(
tocs
[
i
])
outstr
=
"
task =
"
+
labels
[
i
]
+
"
, tic/toc =
"
+
tic
+
"
/
"
+
toc
self
.
output
.
set
(
outstr
)
break
break
except
TypeError
:
except
TypeError
:
# Ignore out of bounds.
# Ignore out of bounds.
...
...
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