diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-05-05 12:53:35 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-05-05 12:53:35 +0100 |
| commit | 8b0146b2e2b87b3c9336fce54c1559620093768e (patch) | |
| tree | c497626042679bd1c7c25088654d3b5125cd40fe /tomorrowtheground.py | |
| parent | 5763de58f064b05c69d2a83494ad33be21cdc6e7 (diff) | |
checking GUI
Diffstat (limited to 'tomorrowtheground.py')
| -rwxr-xr-x | tomorrowtheground.py | 11 |
1 files changed, 10 insertions, 1 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 |
