Hallo Python Gemeinde,
ich habe eine QT Oberfläche indem ein pyqtgraph widget eingebettet ist. Die daten werden über Singale und Slots übergeben und x und y in eine Liste gepackt.
Das Ganze funktioniert bis zu 100 plots einwandfrei, jedoch wird danach nichts weiter geplottet. In der Console wird kein Fehler ausgegeben. In der Pyqtgraph doku habe ich dazu auch nichts gefunden.
Was kann das sein? Ist irgendwo ein Limit von 100 gesetzt? Bräuchte eure fachliche Hilfe!
Vielen Dank!
Python: Portable Python 3.7.4
PYQT 5
Win7
Codesnippets:
pyqtgraph:
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from pyqtgraphBundleUtils import *
import pyqtgraph as pg
class pyqtgraphPlotWidget(QtWidgets.QWidget):
def __init__(self, parent = None):
QtWidgets.QWidget.__init__(self, parent)
labelStyle = {'color': '#FFF', 'font-size': '14pt'}
pg.setConfigOption('background', '#868482')
pg.setConfigOption('foreground', 'w')
#pg.AxisItem('top',linkView=None, parent=None, maxTickLength=5, showValues=True)
self.fig = pg.PlotWidget(title="Primitivausbringung", )
self.fig.addLegend()
self.fig.setLabel('left','Yield', units='%')
#self.fig.setLabel('bottom','Leistung', units='kWh')
self.vbl = QtWidgets.QVBoxLayout()
self.vbl.addWidget(self.fig)
self.setLayout(self.vbl)
Main py:
def onDataChanged(self, old, new):
print ("onData")
print (old)
print (new)
self.x=(old)
self.y=(new)
if self.x>=101:
self.x=80
if self.y>=101:
self.y=1
def plt(self):
try:
if self.ersteMessung==True:
product=self.lineEdit_2.text()
if self.y!=self.yalt:
self.widget_3.fig.clear()
self.widget_5.fig.clear()
self.yAchse.append(self.y)
self.xAchse.append(self.x)
self.yalt=self.y
self.widget_3.fig.plot(self.yAchse,self.xAchse, pen="b", symbolBrush="b", symbolPen='w')
if "Kappa 2.0" in product or "kappa 2.0" in product:
self.widget_3.fig.addLine(y=84,pen='r')
self.widget_3.fig.addLine(y=85,pen='y')
self.widget_3.fig.addLine(y=100,pen='g')
self.widget_3.fig.showGrid(x=True, y=True)
if "Kappa_4Ag" in product or "kappa_4Ag" in product:
self.widget_3.fig.addLine(y=65,pen='r')
self.widget_3.fig.addLine(y=67,pen='y')
self.widget_3.fig.addLine(y=100,pen='g')
self.widget_3.fig.showGrid(x=True, y=True)
if "Kappa 0.9" in product or "kappa 0.9" in product:
self.widget_3.fig.addLine(y=65,pen='r')
self.widget_3.fig.addLine(y=67,pen='y')
self.widget_3.fig.addLine(y=100,pen='g')
self.widget_3.fig.showGrid(x=True, y=True)
except:
print ('except GRAPH')
self.fehlerIndexGraph()