Skip to content

Commit

Permalink
FIX: More issues in PR #1108
Browse files Browse the repository at this point in the history
  • Loading branch information
zdomke committed Sep 17, 2024
1 parent 7143407 commit 1a7dcb8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pydm/widgets/archiver_time_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import OrderedDict
from typing import List, Optional
from pyqtgraph import DateAxisItem, ErrorBarItem
from pydm.utilities import remove_protocol
from pydm.utilities import remove_protocol, is_qt_designer
from pydm.widgets.channel import PyDMChannel
from pydm.widgets.timeplot import TimePlotCurveItem
from pydm.widgets import PyDMTimePlot
Expand Down Expand Up @@ -714,9 +714,9 @@ def __init__(
bottom_axis=DateAxisItem("bottom"),
)
self.optimized_data_bins = optimized_data_bins
self._min_x = None
self._prev_x = None # Holds the minimum x-value of the previous update of the plot
self._starting_timestamp = time.time() # The timestamp at which the plot was first rendered
self._min_x = self._starting_timestamp - DEFAULT_TIME_SPAN
self._prev_x = self._min_x # Holds the minimum x-value of the previous update of the plot
self._archive_request_queued = False
self.setTimeSpan(DEFAULT_TIME_SPAN)

Expand All @@ -733,7 +733,7 @@ def updateXAxis(self, update_immediately: bool = False) -> None:
self._max_x = time.time()
self._min_x = self._max_x - DEFAULT_TIME_SPAN
self._starting_timestamp = self._max_x
if self.getTimeSpan() != DEFAULT_TIME_SPAN:
if self.getTimeSpan() != MIN_TIME_SPAN:
# Initialize x-axis based on the time span as well as trigger a call to the archiver below
self._min_x = self._min_x - self.getTimeSpan()
self._archive_request_queued = True
Expand Down Expand Up @@ -942,7 +942,8 @@ def addYChannel(
useArchiveData=useArchiveData,
liveData=liveData,
)
self.requestDataFromArchiver()
if not is_qt_designer():
self.requestDataFromArchiver()
return curve

def addFormulaChannel(self, yAxisName: str, **kwargs) -> FormulaCurveItem:
Expand Down

0 comments on commit 1a7dcb8

Please sign in to comment.