Commit e9804b73 authored by Valentin Valls's avatar Valentin Valls
Browse files

Update the API for consistency

parent 94765731
...@@ -1994,13 +1994,13 @@ class RegPlot: ...@@ -1994,13 +1994,13 @@ class RegPlot:
self.fig.submit("setGraphGrid", which=True) self.fig.submit("setGraphGrid", which=True)
# Define the plot content # Define the plot content
self.fig.select_curve("setpoint", color="blue", linestyle="-", z=2) self.fig.select_time_curve("setpoint", color="blue", linestyle="-", z=2)
self.fig.select_curve("input", color="red", linestyle="-", z=2) self.fig.select_time_curve("input", color="red", linestyle="-", z=2)
self.fig.select_curve( self.fig.select_time_curve(
"output", color="green", linestyle="-", yaxis="right", z=2 "output", color="green", linestyle="-", yaxis="right", z=2
) )
self.fig.select_curve("deadband_high", color="blue", linestyle="--", z=2) self.fig.select_time_curve("deadband_high", color="blue", linestyle="--", z=2)
self.fig.select_curve("deadband_low", color="blue", linestyle="--", z=2) self.fig.select_time_curve("deadband_low", color="blue", linestyle="--", z=2)
def is_plot_active(self): def is_plot_active(self):
if self.fig is None: if self.fig is None:
...@@ -656,15 +656,15 @@ class TimeCurvePlot(BasePlot): ...@@ -656,15 +656,15 @@ class TimeCurvePlot(BasePlot):
""" """
self.submit("setXDuration", second) self.submit("setXDuration", second)
def select_curve(self, name, **kwargs): def select_time_curve(self, yname, **kwargs):
""" """
Append the data displayed in this plot. Select a dedicated data to be displayed against the time.
Arguments: Arguments:
name: Name of the data to use as y-axis name: Name of the data to use as y-axis
kwargs: Associated style (see `addCurve` from silx plot) kwargs: Associated style (see `addCurve` from silx plot)
""" """
self.submit("selectCurve", name, **kwargs) self.submit("selectCurve", yname, **kwargs)
def set_data(self, **kwargs): def set_data(self, **kwargs):
""" """
...@@ -178,6 +178,12 @@ class TimeCurvePlot(qt.QWidget): ...@@ -178,6 +178,12 @@ class TimeCurvePlot(qt.QWidget):
data = data[index:] data = data[index:]
self.__data[name] = data self.__data[name] = data
def getDataRange(self):
r = self.__plot.getDataRange()
if r is None:
return None
return r[0], r[1]
def setGraphGrid(self, which): def setGraphGrid(self, which):
self.__plot.setGraphGrid(which) self.__plot.setGraphGrid(which)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment