示例#1
0
analysisWindow = QWidget()
analysisWindow.setLayout(layout)
analysisWindow.show()

sourceThread = UDPThread()

quickWindow.show()
#quickWindow.showFullScreen()

def handlePacket(packet):
	context.append_channel_data('Channel 1', [packet[0]])
	context.append_channel_data('Channel 2', [packet[1]])
	context.process()

sourceThread.newPacket.connect(handlePacket)
sourceThread.start()

def updateGUI():
	for child in analysisWindow.children():
		try:
			if hasattr(child, 'block'):
				child.block.updateGUI()
		#		pass
		except NameError:
			pass

guiTimer = QtCore.QTimer()
guiTimer.timeout.connect(updateGUI)
guiTimer.start(0)

myApp.exec_()
示例#2
0
import signal
import wave
import struct

from pyqtgraph import QtCore

app = QtCore.QCoreApplication(sys.argv)
signal.signal(signal.SIGINT, signal.SIG_DFL)

source = UDPThread(port=9999)

f = wave.open(sys.argv[1], 'w')
f.setnchannels(8)
f.setsampwidth(3)
f.setframerate(250)


def handle_packet(packet):
    for ch in packet:
        data = struct.pack('<i', ch)
        f.writeframes(data[1:])
        #print (len(data[:1]))

    #print (data)


source.newPacket.connect(handle_packet)
source.start()

app.exec_()
示例#3
0
analysisWindow.show()

sourceThread = UDPThread()

quickWindow.show()
#quickWindow.showFullScreen()


def handlePacket(packet):
    context.append_channel_data('Channel 1', [packet[0]])
    context.append_channel_data('Channel 2', [packet[1]])
    context.process()


sourceThread.newPacket.connect(handlePacket)
sourceThread.start()


def updateGUI():
    for child in analysisWindow.children():
        try:
            if hasattr(child, 'block'):
                child.block.updateGUI()
        #		pass
        except NameError:
            pass


guiTimer = QtCore.QTimer()
guiTimer.timeout.connect(updateGUI)
guiTimer.start(0)
示例#4
0
import struct

from pyqtgraph import QtCore

app = QtCore.QCoreApplication(sys.argv)
signal.signal(signal.SIGINT, signal.SIG_DFL)

source = UDPThread(port=9999)


f = wave.open(sys.argv[1], 'w')
f.setnchannels(8)
f.setsampwidth(3)
f.setframerate(250)


def handle_packet(packet):
	for ch in packet:
		data = struct.pack('<i', ch)
		f.writeframes(data[1:])
		#print (len(data[:1]))


	#print (data)


source.newPacket.connect(handle_packet)
source.start()

app.exec_()