summaryrefslogtreecommitdiff
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
parentcd3ff8be099394651de63372b3c35d8e125ed0e0 (diff)
reduced lag in GUI
-rw-r--r--testreceive.pd4
-rw-r--r--tomorrowthegroundGUI/tomorrowthegroundGUI.pde2
-rwxr-xr-xwim.py9
3 files changed, 9 insertions, 6 deletions
diff --git a/testreceive.pd b/testreceive.pd
index 5737fed..a4f9385 100644
--- a/testreceive.pd
+++ b/testreceive.pd
@@ -1,4 +1,4 @@
-#N canvas 1275 134 693 413 10;
+#N canvas 821 69 693 413 10;
#X msg 30 20 /pd 1;
#X msg 86 21 /other 1;
#X obj 160 22 netreceive 5401 1;
@@ -26,11 +26,13 @@
#X obj 292 158 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 294 188 1 0 \, 0 0 5;
+#X floatatom 24 180 5 0 0 0 - - -;
#X connect 0 0 4 0;
#X connect 1 0 4 0;
#X connect 2 0 4 0;
#X connect 4 0 3 0;
#X connect 4 1 8 0;
+#X connect 4 1 26 0;
#X connect 4 2 23 0;
#X connect 4 3 5 0;
#X connect 4 4 6 0;
diff --git a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
index 478488b..29fe559 100644
--- a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
+++ b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
@@ -12,7 +12,7 @@ void setup()
{
bgmaps=new PImage[2];
sendIP="127.0.0.1";
- int map=3;
+ int map=2;
switch (map) {
case 1:
bgmaps[0] = loadImage("gentmap.png");
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)