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
e129e8b9
Commit
e129e8b9
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into i162_show_GPS_clock_0_when_no_data
parents
d7ce47c1
bee232dd
No related branches found
No related tags found
1 merge request
!180
Make GPS Lk/Unlk and GPS Clock Power to plot in the same channel
Pipeline
#3039
failed with stage
in 2 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/plotting/plotting_widget/plotting.py
+63
-0
63 additions, 0 deletions
sohstationviewer/view/plotting/plotting_widget/plotting.py
with
63 additions
and
0 deletions
sohstationviewer/view/plotting/plotting_widget/plotting.py
+
63
−
0
View file @
e129e8b9
...
@@ -100,6 +100,69 @@ class Plotting:
...
@@ -100,6 +100,69 @@ class Plotting:
ax
.
chan_db_info
=
chan_db_info
ax
.
chan_db_info
=
chan_db_info
return
ax
return
ax
def
plot_tri_colors
(
self
,
c_data
:
Dict
,
chan_db_info
:
Dict
,
chan_id
:
str
)
->
Axes
:
"""
Plot 3 different values in 3 lines with 3 different colors according
to valueColors:
Ex: -1:M|0:R|1:Y means
value = -1 => plot on line y=-1 with M color
value = 0 => plot on line y=0 with R color
value = 1 => plot on line y=1 with Y color
Color codes are defined in colorSettings and limitted in
'
valColRE
'
in dbSettings.py
:param c_data: data of the channel which includes down-sampled
(if needed) data in keys
'
times
'
and
'
data
'
.
:param chan_db_info: info of channel from DB
:param chan_id: name of channel
:return ax: axes of the channel
"""
plot_h
=
self
.
plotting_axes
.
get_height
(
chan_db_info
[
'
height
'
])
ax
=
self
.
plotting_axes
.
create_axes
(
self
.
parent
.
plotting_bot
,
plot_h
,
has_min_max_lines
=
False
)
value_colors
=
chan_db_info
[
'
valueColors
'
].
split
(
'
|
'
)
sample_no_colors
=
[]
total_sample_list
=
[]
for
vc
in
value_colors
:
v
,
c
=
vc
.
split
(
'
:
'
)
sample_no_colors
.
append
(
clr
[
c
])
val
=
get_val
(
v
)
indexes
=
np
.
where
(
c_data
[
'
data
'
][
0
]
==
val
)[
0
]
times
=
c_data
[
'
times
'
][
0
][
indexes
]
# base line
ax
.
plot
([
self
.
parent
.
min_x
,
self
.
parent
.
max_x
],
[
val
,
val
],
color
=
clr
[
'
r
'
],
linewidth
=
0.5
,
zorder
=
constants
.
Z_ORDER
[
'
CENTER_LINE
'
]
)
ax
.
plot
(
times
,
len
(
times
)
*
[
val
],
linestyle
=
""
,
marker
=
'
s
'
,
markersize
=
2
,
zorder
=
constants
.
Z_ORDER
[
'
DOT
'
],
color
=
clr
[
c
],
picker
=
True
,
pickradius
=
3
)
total_sample_list
.
append
(
len
(
times
))
if
val
==
-
1
:
ax
.
x_bottom
=
times
elif
val
==
0
:
ax
.
x_center
=
times
else
:
ax
.
x_top
=
times
self
.
plotting_axes
.
set_axes_info
(
ax
,
sample_no_list
=
total_sample_list
,
sample_no_colors
=
sample_no_colors
,
sample_no_pos
=
[
0.05
,
0.5
,
0.95
],
chan_db_info
=
chan_db_info
)
ax
.
chan_db_info
=
chan_db_info
return
ax
def
plot_multi_color_dots_equal_on_upper_bound
(
def
plot_multi_color_dots_equal_on_upper_bound
(
self
,
c_data
:
Dict
,
chan_db_info
:
Dict
,
chan_id
:
str
)
->
Axes
:
self
,
c_data
:
Dict
,
chan_db_info
:
Dict
,
chan_id
:
str
)
->
Axes
:
"""
"""
...
...
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