Commit 22ebb9d8 authored by Pedro Henrique Kopper's avatar Pedro Henrique Kopper

Adicionar gráfico combinado

parent 731be5dc
......@@ -42,6 +42,7 @@ class Graph():
#self.plots[i].getViewBox().setRange(xRange=(self.dataX[0][-1] - 10, self.dataX[0][-1]))
self.plots[i].setData(self.dataX[i], self.dataY[i])
self.logFile.write("{},".format(self.dataY[i][-1]))
self.combinedPlot.setData(self.dataY[1], self.dataY[0])
self.logFile.write("{}".format(self.dataX[0][-1]))
self.logFile.flush()
......@@ -64,9 +65,9 @@ class Graph():
def _configurePlots(self):
self.logger("[GRAPH]", "Found new device {}".format(self.config["device"]["type"]))
self.debugLayout = self.graph.addLayout(colspan=len(self.device["channels"]))
for channel in self.device["channels"]:
plotItem = self.graph.addPlot()
plotItem = self.debugLayout.addPlot()
plot = plotItem.plot(pen=mkPen(mkColor(channel["color"]), width=2), name=channel["id"])
self.plots.append(plot)
plotItem.setClipToView(True)
......@@ -85,3 +86,13 @@ class Graph():
# Faz com que ambos eixos X se movam juntos sempre
# TODO: escrever de forma mais limpa
self.plots[0].getViewBox().linkView(self.plots[0].getViewBox().XAxis, self.plots[1].getViewBox())
self.graph.nextRow()
self.combinedPlot = self.graph.addPlot()
self.combinedPlot.setClipToView(True)
self.combinedPlot.showGrid(True)
self.combinedPlot.getViewBox().enableAutoRange(plotItem.getViewBox().YAxis)
self.combinedPlot.setLabel("left", text="Amostra", units="V")
self.combinedPlot.setLabel("bottom", text="Pressão", units="bar")
self.combinedPlot = self.combinedPlot.plot(pen=mkPen(mkColor("#FF0000"), width=2))
Markdown is supported
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