From 8323319e8a4759ad4aceac1f72437dfab1221cef Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 17 Aug 2012 10:36:33 +0100 Subject: fix reverse coords bug --- wim.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'wim.py') diff --git a/wim.py b/wim.py index 9daf13b..29e3ecb 100755 --- a/wim.py +++ b/wim.py @@ -16,13 +16,14 @@ from xml2obj import * if len(sys.argv)<2: - print "wim: usage: tomorrowtheground configfile [-D] (debug)][-T] (test)]" + print "wim: usage: tomorrowtheground configfile [-D debug][-T test]" + sys.exit(0) -debug=False +Debug=False test=False if len(sys.argv)>2: if sys.argv[2]=="-D" or sys.argv[2]=="-d": - debug=True + Debug=True print "wim: DEBUG mode" if len(sys.argv)>3: if sys.argv[3]=="-T" or sys.argv[3]=="-t": @@ -96,7 +97,7 @@ while True: data="" try: data, addr = insock.recvfrom(128) - if debug==True: + if Debug: print "wim: received:",data pos.parse(data) posChanged=True @@ -112,7 +113,7 @@ while True: outsock.sendto( "gps status 0\n", (PD_IP, PD_PORT) ) check=gpsp.check() if check!=False: - if debug==True: + if Debug: print "wim: received from gps",check[0],check[1] outsock.sendto("gps data "+str(check[0])+" "+str(check[1])+"\n",(PD_IP, PD_PORT) ) pos=latLng(check[0],check[1]) @@ -122,7 +123,7 @@ while True: for layer in gpslayers: r=layer.checkcoord(pos) #returns a message or None if r!=None: - if debug==True: + if Debug: 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) ) -- cgit v1.2.3