diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-05-01 12:16:00 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-05-01 12:16:00 +0100 |
| commit | be1dd58124b3b4e1ad7a9eeabfb421d246b6ad1b (patch) | |
| tree | bbb8eaec0f9b2e62bbc01767ab24f20f998bce67 | |
initial commit
| -rwxr-xr-x | tomorrowtheground.py | 11 | ||||
| -rw-r--r-- | tomorrowthegroundGUI/data/gentmap.png | bin | 0 -> 206526 bytes | |||
| -rw-r--r-- | tomorrowthegroundGUI/tomorrowthegroundGUI.pde | 41 | ||||
| -rw-r--r-- | ttg01.xml | 11 |
4 files changed, 63 insertions, 0 deletions
diff --git a/tomorrowtheground.py b/tomorrowtheground.py new file mode 100755 index 0000000..7b68b12 --- /dev/null +++ b/tomorrowtheground.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +#UDP listener + +import socket +UDP_IP="127.0.0.1" +UDP_PORT=5204 +sock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) +sock.bind( (UDP_IP,UDP_PORT) ) +while True: + data, addr = sock.recvfrom( 1024 ) + print "received message:", data
\ No newline at end of file diff --git a/tomorrowthegroundGUI/data/gentmap.png b/tomorrowthegroundGUI/data/gentmap.png Binary files differnew file mode 100644 index 0000000..4233f5f --- /dev/null +++ b/tomorrowthegroundGUI/data/gentmap.png diff --git a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde new file mode 100644 index 0000000..b784b99 --- /dev/null +++ b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde @@ -0,0 +1,41 @@ +import hypermedia.net.*; + +PImage bgmap; +UDP udp; +int x,y; +float lat1,lng1,lat2,lng2,fw,fh; + +void setup() +{ + bgmap = loadImage("gentmap.png"); + size(bgmap.width,bgmap.height); + frameRate(30); + udp = new UDP(this); + x=width/2; + y=height/2; + lat1=51.050608; + lng1=3.724698; + lat2=51.046878; + lng2=3.732852; + fw=lng2-lng1; + fh=lat1-lat2; +} + +void draw() +{ + background(bgmap); + fill(255); + stroke(255,0,0); + ellipse(x,y,5,5); +} + +void mouseDragged() +{ + if (mousePressed) { + x=mouseX; + y=mouseY; + float fx=((float)mouseX)/width; + float fy=((float)mouseY)/height; + udp.send(((fx*fw)+lng1)+","+((fy*fh)+lat2)+"\n","127.0.0.1",5204); + } +} diff --git a/ttg01.xml b/ttg01.xml new file mode 100644 index 0000000..3a8f9e2 --- /dev/null +++ b/ttg01.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<tomorrowtheground> + <gpsmapper file="x01.gif"> + <triggerlayer> + </triggerlayer> + <scalarlayer> + </scalarlayer> + </gpsmapper> + <bluetooth freq="10"> + </bluetooth> +</tomorrowtheground>
\ No newline at end of file |
