Skip to content
Snippets Groups Projects
Commit fc62c8d5 authored by Lan Dam's avatar Lan Dam
Browse files

move the declaration of log_data to plotting_widget and change name to rt130_log_data to be clearer

parent a2c0a7da
No related branches found
No related tags found
1 merge request!165Fix SOH info not show for bottom of Jerk/DPS and display all info lines for the case data point clicked matches more than one SOH lines.
# Define functions to call processor
from typing import Tuple, Union, Dict, List, Optional
from typing import Tuple, Union, Dict, List
from PySide6 import QtCore
......@@ -45,10 +45,6 @@ class MultiThreadedPlottingWidget(PlottingWidget):
# or zoom_markers while plotting
self.is_working = False
# List of SOH message lines in RT130 to display in info box when
# there're more than 2 lines for one data point clicked
self.log_data: Optional[List[str]] = None
self.finished.connect(self.stopped)
self.notification.connect(
lambda msg: display_tracking_info(self.tracking_box, msg))
......
......@@ -192,6 +192,10 @@ class PlottingWidget(QtWidgets.QScrollArea):
DataTypeModel.__init__.mass_pos_data[key]
"""
self.plotting_data2 = {}
# List of SOH message lines in RT130 to display in info box when
# there're more than 2 lines for one data point clicked
self.rt130_log_data: Optional[List[str]] = None
# ----------------------------------------------------------------
QtWidgets.QScrollArea.__init__(self)
......@@ -339,7 +343,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
f"Point:{click_plot_index + 1} "
f"Time: {formatted_clicked_time} "
f"Value: {clicked_data}</pre>")
if self.log_data is not None:
if self.rt130_log_data is not None:
log_idxes = [chan_data['logIdx'][0][idx]
for idx in real_idxes]
if len(real_idxes) > 1:
......@@ -347,7 +351,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
"</pre>", f" ({len(real_idxes)} lines)")
for idx in log_idxes:
info_str += (
"<pre> " + self.log_data[idx] + "</pre>")
"<pre> " + self.rt130_log_data[idx] + "</pre>")
display_tracking_info(self.tracking_box, info_str)
if 'logIdx' in chan_data.keys():
# For Reftek, need to hightlight the corresponding
......
......@@ -33,10 +33,10 @@ class SOHWidget(MultiThreadedPlottingWidget):
self.data_object = d_obj
self.plotting_data1 = d_obj.soh_data[key] if key else {}
self.plotting_data2 = d_obj.mass_pos_data[key] if key else {}
self.log_data = None
self.rt130_log_data = None
if self.data_object.data_type == 'RT130':
try:
self.log_data = d_obj.log_data[key]['SOH'][0].split('\n')
self.rt130_log_data = d_obj.log_data[key]['SOH'][0].split('\n')
except KeyError:
pass
channel_list = d_obj.soh_data[key].keys() if key else []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment