[ui/plot] refactoring
This commit is contained in:
parent
2539fa7e25
commit
57d3a83243
@ -14,18 +14,18 @@ class Continously:
|
||||
self.figure = figure
|
||||
self.buffer = buffer
|
||||
|
||||
def plot_daq(self, *args, **kwargs):
|
||||
def plot(self, *args, **kwargs):
|
||||
self.figure.setBackground("w")
|
||||
|
||||
prev_plot = self.figure.getItem(row=0, col=0)
|
||||
if prev_plot:
|
||||
self.figure.removeItem(prev_plot)
|
||||
self.continous_plot = self.figure.addPlot(row=0, col=0)
|
||||
self.continous_ax = self.figure.addPlot(row=0, col=0)
|
||||
|
||||
pen = pg.mkPen("red")
|
||||
self.time = np.zeros(self.buffer.size)
|
||||
self.data = np.zeros(self.buffer.size)
|
||||
self.line = self.continous_plot.plot(
|
||||
self.line = self.continous_ax.plot(
|
||||
self.time,
|
||||
self.data,
|
||||
pen=pen,
|
||||
@ -40,7 +40,7 @@ class Continously:
|
||||
self.timer.start()
|
||||
|
||||
def update_plot(self):
|
||||
log.debug(self.buffer.totalcount())
|
||||
# log.debug(self.buffer.totalcount())
|
||||
if self.buffer.totalcount() > self.CHUNK_PLOT:
|
||||
log.debug(self.buffer.totalcount())
|
||||
try:
|
||||
@ -72,4 +72,4 @@ class Continously:
|
||||
self.timer.stop()
|
||||
|
||||
def refresh(self):
|
||||
self.continous_plot.enableAutoRange()
|
||||
self.continous_ax.enableAutoRange()
|
||||
|
Loading…
Reference in New Issue
Block a user