Hi,

I'm trying to plot data from a drone in an updating scrolling plot. For the 
plotting I use the example code number 3 from this file:
https://github.com/pyqtgraph/pyqtgraph/blob/develop/examples/scrollingPlots.py

Now i want to be able to send commands to the drone while the plots keep 
updating, because that's the data that I want to see.
Now I figured I need to multi thread using Qt, and got my code form 
here: https://groups.google.com/forum/#!topic/pyqtgraph/haiJsGhxTaQ

But when I start the thread the main thread sleeps. I'm new to this and 
have no idea what's happening, can someone help me?
Without the the threading the plots work just fine.

This is my code:

import pyqtgraph as pg
import time
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
from pyardrone import ARDrone, at
import thread1

## Code for plot, copied form example.
--


## Threading and updating part

def update():
    print("update")
    update_plot_vx()
    update_plot_vy()
    update_plot_vz()


class Thread(pg.QtCore.QThread):
    newData = pg.QtCore.Signal(object)
    def run(self):
            thread1

timer = pg.QtCore.QTimer()
timer.timeout.connect(update)
timer.start(50)

thread = Thread()
thread.newData.connect(update)  #It might be something with row, but 
removing it doesn't change anything
thread.start()

# Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/f9941f7c-0449-42e9-98c9-bea183da47d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to