Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
2f175f62
Commit
2f175f62
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
tps scrollbar, label's position, color, height for each
parent
caab6ec0
No related branches found
No related tags found
1 merge request
!136
tps scrollbar, label's position, color, height for each
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sohstationviewer/view/plotting/plotting_widget/plotting_axes.py
+11
-5
11 additions, 5 deletions
...tionviewer/view/plotting/plotting_widget/plotting_axes.py
sohstationviewer/view/plotting/time_power_squared_dialog.py
+15
-10
15 additions, 10 deletions
sohstationviewer/view/plotting/time_power_squared_dialog.py
with
26 additions
and
15 deletions
sohstationviewer/view/plotting/plotting_widget/plotting_axes.py
+
11
−
5
View file @
2f175f62
...
...
@@ -352,17 +352,23 @@ class PlottingAxes:
)
)
def
get_height
(
self
,
ratio
,
bw_plots_distance
=
0.0015
):
def
get_height
(
self
,
ratio
:
float
,
bw_plots_distance
:
float
=
0.0015
,
pixel_height
:
float
=
19
)
->
float
:
"""
Calculate new plot
'
s bottom position and return plot
'
s height.
:param ratio: float - ratio of the plot height on the BASIC_HEIGHT
:param bw_plots_distance: float - distance between plots
:return plot_h: float - height of the plot
:param ratio: ratio of the plot height on the BASIC_HEIGHT
:param bw_plots_distance: distance between plots
:param pixel_height: height of plot in pixel (
for TPS/TPS legend, height of each day row)
:return plot_h: height of the plot
"""
plot_h
=
constants
.
BASIC_HEIGHT
*
ratio
# ratio with figure height
self
.
parent
.
plotting_bot
-=
plot_h
+
bw_plots_distance
self
.
parent
.
plotting_bot_pixel
+=
19
*
ratio
bw_plots_distance_pixel
=
3000
*
bw_plots_distance
self
.
parent
.
plotting_bot_pixel
+=
(
pixel_height
*
ratio
+
bw_plots_distance_pixel
)
return
plot_h
def
add_ruler
(
self
,
color
):
...
...
This diff is collapsed.
Click to expand it.
sohstationviewer/view/plotting/time_power_squared_dialog.py
+
15
−
10
View file @
2f175f62
...
...
@@ -89,8 +89,10 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
self
.
is_working
=
True
self
.
set_key
=
key
self
.
plotting_data1
=
d_obj
.
waveform_data
[
key
]
self
.
plot_total
=
len
(
self
.
plotting_data1
)
self
.
plotting_bot
=
const
.
BOTTOM
self
.
plotting_bot_pixel
=
const
.
BOTTOM_PX
self
.
processed_channels
=
[]
self
.
channels
=
[]
self
.
tps_processors
=
[]
...
...
@@ -111,7 +113,7 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
title
=
get_title
(
key
,
self
.
min_x
,
self
.
max_x
,
self
.
date_mode
)
self
.
timestamp_bar_top
=
self
.
plotting_axes
.
add_timestamp_bar
(
0.
)
self
.
plotting_axes
.
set_title
(
title
,
y
=
0
,
v_align
=
'
bottom
'
)
self
.
plotting_axes
.
set_title
(
title
,
y
=
5
,
v_align
=
'
bottom
'
)
if
self
.
plotting_data1
==
{}:
self
.
is_working
=
False
...
...
@@ -220,11 +222,12 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
total_days
=
c_data
[
'
tps_data
'
].
shape
[
0
]
plot_h
=
self
.
plotting_axes
.
get_height
(
1.5
*
total_days
,
bw_plots_distance
=
0.003
)
total_days
/
2
,
bw_plots_distance
=
0.003
,
pixel_height
=
12.1
)
ax
=
self
.
create_axes
(
self
.
plotting_bot
,
plot_h
)
ax
.
spines
[[
'
right
'
,
'
left
'
,
'
top
'
,
'
bottom
'
]].
set_visible
(
False
)
ax
.
text
(
-
0.1
,
1
.2
,
f
"
{
get_chan_label
(
chan_id
)
}
{
c_data
[
'
samplerate
'
]
}
"
,
-
0.1
2
,
1
,
f
"
{
get_chan_label
(
chan_id
)
}
{
c_data
[
'
samplerate
'
]
}
sps
"
,
horizontalalignment
=
'
left
'
,
verticalalignment
=
'
top
'
,
rotation
=
'
horizontal
'
,
...
...
@@ -234,17 +237,17 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
)
zoom_marker1
=
ax
.
plot
(
[],
[],
marker
=
'
|
'
,
markersize
=
10
,
[],
[],
marker
=
'
|
'
,
markersize
=
5
,
markeredgecolor
=
self
.
display_color
[
'
zoom_marker
'
])[
0
]
self
.
zoom_marker1s
.
append
(
zoom_marker1
)
zoom_marker2
=
ax
.
plot
(
[],
[],
marker
=
'
|
'
,
markersize
=
10
,
[],
[],
marker
=
'
|
'
,
markersize
=
5
,
markeredgecolor
=
self
.
display_color
[
'
zoom_marker
'
])[
0
]
self
.
zoom_marker2s
.
append
(
zoom_marker2
)
ruler
=
ax
.
plot
(
[],
[],
marker
=
'
s
'
,
markersize
=
5
,
[],
[],
marker
=
'
s
'
,
markersize
=
4
,
markeredgecolor
=
self
.
display_color
[
'
time_ruler
'
],
markerfacecolor
=
'
None
'
)[
0
]
self
.
rulers
.
append
(
ruler
)
...
...
@@ -258,8 +261,8 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
# not draw data out of day range
color_set
=
self
.
get_color_set
(
y
,
square_counts
,
color_codes
)
# (- dayIdx): each day is a line, increase from top to bottom
ax
.
scatter
(
x
,
[
-
dayIdx
]
*
len
(
x
),
marker
=
'
|
'
,
c
=
color_set
,
s
=
7
,
alpha
=
0.8
)
ax
.
scatter
(
x
,
[
-
dayIdx
]
*
len
(
x
),
marker
=
'
s
'
,
c
=
color_set
,
s
=
3
)
# extra to show highlight square
ax
.
set_ylim
(
-
(
c_data
[
'
tps_data
'
].
shape
[
0
]
+
1
),
1
)
...
...
@@ -274,11 +277,13 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
ax.legend will create one label for each dot.
"""
# set height of legend and distance bw legend and upper ax
plot_h
=
self
.
plotting_axes
.
get_height
(
7
,
bw_plots_distance
=
0.003
)
plot_h
=
self
.
plotting_axes
.
get_height
(
21
,
bw_plots_distance
=
0.004
,
pixel_height
=
12
)
ax
=
self
.
plotting_axes
.
canvas
.
figure
.
add_axes
(
[
self
.
plotting_l
,
self
.
plotting_bot
,
self
.
plotting_w
,
plot_h
],
picker
=
True
)
ax
.
axis
(
'
off
'
)
ax
.
patch
.
set_alpha
(
0
)
c_labels
=
self
.
parent
.
sel_col_labels
clrs
=
self
.
parent
.
color_def
# colordef
...
...
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