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
666f9d05
Commit
666f9d05
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Fix RT130 plot failing
parent
49657765
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
+5
-1
5 additions, 1 deletion
...onviewer/view/plotting/plotting_widget/plotting_widget.py
sohstationviewer/view/plotting/state_of_health_widget.py
+30
-6
30 additions, 6 deletions
sohstationviewer/view/plotting/state_of_health_widget.py
with
35 additions
and
7 deletions
sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
+
5
−
1
View file @
666f9d05
...
@@ -484,7 +484,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
...
@@ -484,7 +484,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
# channel not plotted
# channel not plotted
continue
continue
c_data
=
self
.
plotting_data1
[
chan_id
]
c_data
=
self
.
plotting_data1
[
chan_id
]
self
.
get_zoom_data
(
c_data
,
chan_id
)
self
.
get_zoom_data
(
c_data
,
chan_id
,
self
.
plotting_data1
)
for
chan_id
in
self
.
plotting_data2
:
for
chan_id
in
self
.
plotting_data2
:
c_data
=
self
.
plotting_data2
[
chan_id
]
c_data
=
self
.
plotting_data2
[
chan_id
]
self
.
get_zoom_data
(
c_data
,
chan_id
)
self
.
get_zoom_data
(
c_data
,
chan_id
)
...
@@ -511,6 +511,10 @@ class PlottingWidget(QtWidgets.QScrollArea):
...
@@ -511,6 +511,10 @@ class PlottingWidget(QtWidgets.QScrollArea):
new_min_y
=
None
new_min_y
=
None
new_max_y
=
None
new_max_y
=
None
if
hasattr
(
ax
,
'
x_list
'
):
if
hasattr
(
ax
,
'
x_list
'
):
if
not
hasattr
(
ax
,
'
y_list
'
):
# dotForTime plots have attribute 'x_list' but not
# 'y_list'
continue
total_points
=
0
total_points
=
0
tr_min_ys
=
[]
tr_min_ys
=
[]
tr_max_ys
=
[]
tr_max_ys
=
[]
...
...
This diff is collapsed.
Click to expand it.
sohstationviewer/view/plotting/state_of_health_widget.py
+
30
−
6
View file @
666f9d05
...
@@ -94,6 +94,9 @@ class SOHWidget(plotting_widget.PlottingWidget):
...
@@ -94,6 +94,9 @@ class SOHWidget(plotting_widget.PlottingWidget):
if
chan_db_info
[
'
plotType
'
]
==
''
:
if
chan_db_info
[
'
plotType
'
]
==
''
:
continue
continue
self
.
plotting_data1
[
chan_id
][
'
chan_db_info
'
]
=
chan_db_info
self
.
plotting_data1
[
chan_id
][
'
chan_db_info
'
]
=
chan_db_info
self
.
move_soh_channels_with_link_to_the_end
()
for
chan_id
in
self
.
plotting_data1
:
self
.
get_zoom_data
(
self
.
plotting_data1
[
chan_id
],
chan_id
,
self
.
get_zoom_data
(
self
.
plotting_data1
[
chan_id
],
chan_id
,
self
.
plotting_data1
,
True
)
self
.
plotting_data1
,
True
)
...
@@ -142,18 +145,20 @@ class SOHWidget(plotting_widget.PlottingWidget):
...
@@ -142,18 +145,20 @@ class SOHWidget(plotting_widget.PlottingWidget):
# dialog.
# dialog.
if
chan_id
in
{
'
GLO
'
,
'
VLO
'
,
'
VLA
'
,
'
GLA
'
,
'
VEL
'
,
'
VNS
'
,
'
GNS
'
,
'
GEL
'
}:
if
chan_id
in
{
'
GLO
'
,
'
VLO
'
,
'
VLA
'
,
'
GLA
'
,
'
VEL
'
,
'
VNS
'
,
'
GNS
'
,
'
GEL
'
}:
return
return
chan_db_info
=
c_data
[
'
chan_db_info
'
]
try
:
chan_db_info
=
c_data
[
'
chan_db_info
'
]
except
KeyError
:
return
plot_type
=
chan_db_info
[
'
plotType
'
]
plot_type
=
chan_db_info
[
'
plotType
'
]
if
c_data
[
'
samplerate
'
]
<=
1
:
if
c_data
[
'
samplerate
'
]
<=
1
:
trim_downsample_soh_chan
(
c_data
,
self
.
min_x
,
self
.
max_x
)
trim_downsample_soh_chan
(
c_data
,
self
.
min_x
,
self
.
max_x
)
else
:
else
:
print
(
"
work on later
"
)
print
(
"
work on later
"
)
apply_convert_factor
(
c_data
,
1
)
apply_convert_factor
(
c_data
,
1
)
linked_ax
=
None
if
chan_db_info
[
'
linkedChan
'
]
not
in
[
None
,
'
None
'
,
''
]:
linked_ax
=
plotting_data
[
chan_db_info
[
'
linkedChan
'
]][
'
ax
'
]
if
'
ax
'
not
in
c_data
:
if
'
ax
'
not
in
c_data
:
linked_ax
=
None
if
chan_db_info
[
'
linkedChan
'
]
not
in
[
None
,
'
None
'
,
''
]:
linked_ax
=
plotting_data
[
chan_db_info
[
'
linkedChan
'
]][
'
ax
'
]
ax
=
getattr
(
self
.
plotting
,
plot_functions
[
plot_type
][
1
])(
ax
=
getattr
(
self
.
plotting
,
plot_functions
[
plot_type
][
1
])(
c_data
,
chan_db_info
,
chan_id
,
None
,
linked_ax
)
c_data
,
chan_db_info
,
chan_id
,
None
,
linked_ax
)
if
ax
is
None
:
if
ax
is
None
:
...
@@ -163,7 +168,7 @@ class SOHWidget(plotting_widget.PlottingWidget):
...
@@ -163,7 +168,7 @@ class SOHWidget(plotting_widget.PlottingWidget):
self
.
axes
.
append
(
ax
)
self
.
axes
.
append
(
ax
)
else
:
else
:
getattr
(
self
.
plotting
,
plot_functions
[
plot_type
][
1
])(
getattr
(
self
.
plotting
,
plot_functions
[
plot_type
][
1
])(
c_data
,
chan_db_info
,
chan_id
,
c_data
[
'
ax
'
],
None
)
c_data
,
chan_db_info
,
chan_id
,
c_data
[
'
ax
'
],
linked_ax
)
def
set_lim
(
self
,
first_time
=
False
):
def
set_lim
(
self
,
first_time
=
False
):
"""
"""
...
@@ -176,3 +181,22 @@ class SOHWidget(plotting_widget.PlottingWidget):
...
@@ -176,3 +181,22 @@ class SOHWidget(plotting_widget.PlottingWidget):
if
not
first_time
:
if
not
first_time
:
self
.
remove_plot_num_points_text
()
self
.
remove_plot_num_points_text
()
super
().
set_lim
(
first_time
)
super
().
set_lim
(
first_time
)
def
move_soh_channels_with_link_to_the_end
(
self
):
"""
In order to plot a channel (channel A) that is linked with another
channel (channel B), we need to plot B before we plot A. Because the
order of the channel in the data is not predetermined, we need to
manually move A to the end of the data set. This is, of course,
assuming that channel link is at most one level deep.
"""
channels_to_move
=
[]
for
channel
,
chan_data
in
self
.
plotting_data1
.
items
():
try
:
linked_channel
=
chan_data
[
'
chan_db_info
'
][
'
linkedChan
'
]
if
linked_channel
not
in
[
''
,
'
None
'
,
None
]:
channels_to_move
.
append
(
channel
)
except
KeyError
:
continue
for
channel
in
channels_to_move
:
self
.
plotting_data1
[
channel
]
=
self
.
plotting_data1
.
pop
(
channel
)
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