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

solving tps title always shows a time range of 1970-01-01 - 1970-01-01

parent c4181291
No related branches found
No related tags found
1 merge request!272solving tps title always shows a time range of 1970-01-01 - 1970-01-01
......@@ -51,6 +51,12 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
date_format: format for date
"""
self.date_format: str = 'YYYY-MM-DD'
"""
min_x: left limit of data plotted
max_x: right limit of data plotted
"""
self.min_x: float = 0
self.max_x: float = 0
self.setWindowTitle("TPS Plot")
......@@ -294,10 +300,10 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
:param end_tm: requested end time to read
"""
self.processing_log_msg = ""
min_x = max(d_obj.data_time[data_set_id][0], start_tm)
max_x = min(d_obj.data_time[data_set_id][1], end_tm)
self.min_x = max(d_obj.data_time[data_set_id][0], start_tm)
self.max_x = min(d_obj.data_time[data_set_id][1], end_tm)
self.start_5mins_of_diff_days = get_start_5mins_of_diff_days(
min_x, max_x)
self.min_x, self.max_x)
for i in range(self.plotting_tab.count() - 1, -1, -1):
# delete all tps tabs
widget = self.plotting_tab.widget(i)
......@@ -338,4 +344,5 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
self.plotting_tab.addTab(tps_widget, tab_name)
self.tps_widget_dict[tab_name] = tps_widget
tps_widget.plot_channels(
data_dict, data_set_id, self.start_5mins_of_diff_days)
data_dict, data_set_id, self.start_5mins_of_diff_days,
self.min_x, self.max_x)
......@@ -102,17 +102,22 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
def plot_channels(self, data_dict: Dict,
data_set_id: Union[str, Tuple[str, str]],
start_5mins_of_diff_days: List[List[float]]):
start_5mins_of_diff_days: List[List[float]],
min_x: float, max_x: float):
"""
Recursively plot each TPS channels for waveform_data.
:param data_dict: dict of all channels to be plotted
:param data_set_id: data set's id
:param start_5mins_of_diff_days: the list of starts of all five minutes
of days in which each day has 288 of 5 minutes.
:param min_x: left limit of data plotted
:param max_x: right limit of data plotted
"""
self.zoom_marker1_shown = False
self.is_working = True
self.plotting_data1 = data_dict
self.min_x = min_x
self.max_x = max_x
self.plot_total = len(self.plotting_data1)
self.fig_height_in = self.init_fig_height_in()
self.start_5mins_of_diff_days = start_5mins_of_diff_days
......
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