From 27ff7f53b9ba65ab75b038420d6b71e489d7a6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Sat, 12 Apr 2014 09:44:48 +0200 Subject: [PATCH] ekgplotter better plotting --- ekgplotter/ekgplotter/main.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ekgplotter/ekgplotter/main.py b/ekgplotter/ekgplotter/main.py index a870ce4..dc8dfa1 100644 --- a/ekgplotter/ekgplotter/main.py +++ b/ekgplotter/ekgplotter/main.py @@ -136,7 +136,10 @@ class OSCThread(threading.Thread): def run(self): while self.running: - reads, writes, errs = select.select([self.osc_sock], [], [], 0.05) + try: + reads, writes, errs = select.select([self.osc_sock], [], [], 0.05) + except select.error: + pass if reads: osc_input = self.osc_sock.recv(256) osc_address, typetags, messages = decode_osc(osc_input, 0, len(osc_input)) @@ -237,11 +240,11 @@ class Actor(object): class EkgPlot(object): def __init__(self, actor_names, num_data, colors): - self.plot = pg.PlotWidget(title="

EKG

") + self.plot = pg.PlotWidget() self.plot.hide() - self.plot.setLabel('left', "

Amplitude

") - self.plot.setLabel('bottom', "

Time

") - self.plot.showGrid(True, True) + #self.plot.setLabel('left', "

Amplitude

") + #self.plot.setLabel('bottom', "

Time

") + self.plot.showGrid(False, False) self.plot.setYRange(0, 255) self.plot.setXRange(0, num_data) self.plot.resize(1280, 720) @@ -354,7 +357,7 @@ class MyHandler(BaseHTTPRequestHandler): self.thread = thread = OSCThread(self.server.args) thread.daemon = True thread.start() - actor_names = ["bjoern", "merle", "uwe"] + actor_names = ["merle", "bjoern", "uwe"] num_data = 100 colors = ["r", "g", "b"] qtapp = QtGui.QApplication([])