summaryrefslogtreecommitdiff
path: root/wim.py
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-06-12 11:49:20 +0100
committerTim Redfern <tim@eclectronics.org>2012-06-12 11:49:20 +0100
commit38eca426c03946cc42d7d683c09fefba324f19bf (patch)
treea47655c181c02e849dc0a401696c2b68e7fadf0e /wim.py
parentcd3ff8be099394651de63372b3c35d8e125ed0e0 (diff)
reduced lag in GUI
Diffstat (limited to 'wim.py')
-rwxr-xr-xwim.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/wim.py b/wim.py
index b3ecbb6..9daf13b 100755
--- a/wim.py
+++ b/wim.py
@@ -82,7 +82,7 @@ GUI_IP="0.0.0.0"
GUI_PORT=5400
insock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
insock.bind( (GUI_IP,GUI_PORT) )
-insock.settimeout(0.05) #non blocking, this sets the frame rate of checking
+insock.settimeout(0.01) #non blocking, this sets the frame rate of checking
PD_IP="127.0.0.1"
PD_PORT=5401
outsock = socket.socket( socket.AF_INET,socket.SOCK_DGRAM )
@@ -96,12 +96,13 @@ while True:
data=""
try:
data, addr = insock.recvfrom(128)
- pos.parse(data)
if debug==True:
print "wim: received:",data
+ pos.parse(data)
posChanged=True
except:
- nothing=None
+ nothing=None
+
if gpsp!="": #gps available
if gpsp.fix>1:
gpsfix=True
@@ -125,5 +126,5 @@ while True:
print "wim: sending:",str(r[0]),str(r[1])
#pd needs \n at end of message
outsock.sendto( str(r[0])+' '+str(r[1])+'\n', (PD_IP, PD_PORT) )
- time.sleep(1.0)
+ time.sleep(0.01)