Mercurial > hg > mood-conductor
comparison visualclient/visclient.py @ 35:ea2ec5f95ad8
some changes to visclient before Barbican
author | gyorgyf |
---|---|
date | Thu, 20 Mar 2014 20:50:35 +0000 |
parents | fe04ff3547c7 |
children |
comparison
equal
deleted
inserted
replaced
33:fe04ff3547c7 | 35:ea2ec5f95ad8 |
---|---|
47 FADE = 15 | 47 FADE = 15 |
48 DIST = 0.15 # blob equivalence tolerance | 48 DIST = 0.15 # blob equivalence tolerance |
49 FRAMERATE = 60 | 49 FRAMERATE = 60 |
50 | 50 |
51 # Connection: | 51 # Connection: |
52 IP = "127.0.0.1:8030" | 52 # IP = "127.0.0.1:8030" |
53 # IP = "192.168.2.158:8030" | 53 # IP = "192.168.2.158:8030" |
54 # IP = "138.37.95.215" | 54 IP = "138.37.95.215" |
55 HTTP_TIMEOUT = 3 | 55 HTTP_TIMEOUT = 3 |
56 SERVER_UPDATE_INTERVAL = 0.8 | 56 SERVER_UPDATE_INTERVAL = 0.8 |
57 | 57 |
58 | 58 |
59 class Indicator(object): | 59 class Indicator(object): |
265 | 265 |
266 def start_update_thread(self): | 266 def start_update_thread(self): |
267 '''Start the thread that reads data from the server.''' | 267 '''Start the thread that reads data from the server.''' |
268 self.thread = Thread(target = self.update_thread) | 268 self.thread = Thread(target = self.update_thread) |
269 self.thread.daemon = True | 269 self.thread.daemon = True |
270 self.running = True | |
270 self.thread.start() | 271 self.thread.start() |
271 self.running = True | |
272 print "OK. Update thread started." | 272 print "OK. Update thread started." |
273 | 273 |
274 def stop_update_thread(self): | 274 def stop_update_thread(self): |
275 '''Stop the thread and allow some time fot the connections to close.''' | 275 '''Stop the thread and allow some time fot the connections to close.''' |
276 self.running = False | 276 self.running = False |
279 except : | 279 except : |
280 print "No update thread to join." | 280 print "No update thread to join." |
281 | 281 |
282 def update_thread(self): | 282 def update_thread(self): |
283 '''The server update thread''' | 283 '''The server update thread''' |
284 print "Thread reporting..." | |
284 while self.running : | 285 while self.running : |
285 # self.update() | 286 # self.update() |
286 try : | 287 try : |
287 self.update() | 288 self.update() |
288 # self.indicators["update"].visible = True | 289 # self.indicators["update"].visible = True |