summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtomorrowtheground.py11
-rw-r--r--tomorrowthegroundGUI/tomorrowthegroundGUI.pde5
2 files changed, 14 insertions, 2 deletions
diff --git a/tomorrowtheground.py b/tomorrowtheground.py
index b1a09ed..841f7ab 100755
--- a/tomorrowtheground.py
+++ b/tomorrowtheground.py
@@ -16,7 +16,12 @@ from xml2obj import *
if len(sys.argv)<2:
- print "usage: tomorrowtheground {configfile}"
+ print "usage: tomorrowtheground configfile [-D] (debug)]"
+
+debug=False
+if len(sys.argv)>2:
+ if sys.argv[1]=="-D" or sys.argv[1]=="-d":
+ debug=True
doc=xml2obj(open(sys.argv[1]))
gpslayers=[]
@@ -77,6 +82,8 @@ while True:
try:
data, addr = insock.recvfrom(128)
pos.parse(data)
+ if (debug):
+ print "received:",data
posChanged=True
except:
nothing=None
@@ -90,6 +97,8 @@ while True:
for layer in gpslayers:
r=layer.checkcoord(pos) #returns a message or None
if r!=None:
+ if (debug):
+ print "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) )
\ No newline at end of file
diff --git a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
index ae035b1..f4966ac 100644
--- a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
+++ b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
@@ -5,10 +5,13 @@ int usemap;
UDP udp;
int x,y;
float lat1,lng1,lat2,lng2,fw,fh;
+String sendIP;
+
void setup()
{
bgmaps=new PImage[2];
+ sendIP="192.168.10.176";
int map=2;
switch (map) {
case 1:
@@ -54,7 +57,7 @@ void mouseDragged()
y=mouseY;
float fx=((float)mouseX)/width;
float fy=((float)mouseY)/height;
- udp.send(((fy*fh)+lat2)+","+((fx*fw)+lng1)+"\n","127.0.0.1",5400);
+ udp.send(((fy*fh)+lat2)+","+((fx*fw)+lng1)+"\n",sendIP,5400);
}
}