import multiprocessing
import numpy as np
import sys
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import ReadData
def main():
matrix_main = np.memmap('myData.dat', dtype='float64', mode='w+', shape=(5000, 5))
p = multiprocessing.Process(target=ReadData.worker)
p.start()
win1 = pg.GraphicsWindow()
win1.setWindowTitle('Data plot')
p1 = win1.addPlot()
index = int(matrix_main[0, 0])
curve1 = p1.plot(matrix_main[:index, 2], pen='k')
pg.QtGui.QApplication.processEvents()
timer = pg.QtCore.QTimer()
timer.timeout.connect(update1)
timer.start(1000)
def update1():
global curve1, matrix_main
index = int(matrix_main[0, 0])
curve1.setData(matrix_main[:index, 2])
if __name__ == '__main__':
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
main()
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/59f2c28e-34a9-4c28-8ad6-2670422932c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/2d72f103-5c74-43f9-be71-b8ceb8d06329%40googlegroups.com.