First implementation for plotting a gps walk
authorjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 14:56:25 +0000 (14:56 +0000)
committerjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 14:56:25 +0000 (14:56 +0000)
git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@44 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiview

index bf84f2a..a1bbd8c 100755 (executable)
--- a/wifiview
+++ b/wifiview
@@ -107,6 +107,31 @@ class mapWidget ( gtk.Image ) :
             pixbuf.copy_area( init_x, init_y, size_x, size_y, self.get_pixbuf(), dest_x , dest_y )
         del(pixbuf)
 
+    pixmap,mask = self.get_pixbuf().render_pixmap_and_mask()
+    red = pixmap.new_gc()
+    red.foreground = pixmap.get_colormap().alloc_color("red")
+    green = pixmap.new_gc()
+    green.foreground = pixmap.get_colormap().alloc_color("green")
+    blue = pixmap.new_gc()
+    blue.foreground = pixmap.get_colormap().alloc_color("blue")
+
+    filename = "/tmp/vale/wiscan_gui.campus.info"
+    fd = open( filename )
+    for line in fd.readlines() :
+        values = line.split()
+
+        x_pos = self.lon2tilex( float(values[6]) , self.conf.zoom )
+        y_pos = self.lat2tiley( float(values[5]) , self.conf.zoom )
+
+        dest_x = self.tile_size * ( x_pos[0] - self.reftile_x ) + center_x + x_pos[1]
+        dest_y = self.tile_size * ( y_pos[0] - self.reftile_y ) + center_y + y_pos[1]
+
+        pixmap.draw_rectangle(blue, True , dest_x , dest_y , 3 , 3 )
+    fd.close()
+
+    self.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.win_x, self.win_y )
+
+
   def tilename ( self , x , y , zoom ) :
     file = self.tile2file( self.reftile_x + x , self.reftile_y + y , zoom )
     try :