REFACTORING : completed separation of static and interactive maps
authorjaviplx <javiplx@gmail.com>
Sun, 1 May 2011 12:34:30 +0000 (12:34 +0000)
committerjaviplx <javiplx@gmail.com>
Sun, 1 May 2011 12:34:30 +0000 (12:34 +0000)
git-svn-id: file:///svnroot/wifihood/branches/cleaning@100 c51dfc6a-5949-4919-9c8e-f207a149c383

wifimap/__init__.py
wifimap/view.py
wifiscanner.py

index a1c5f09..edc2cb7 100644 (file)
@@ -1,5 +1,5 @@
 
-__all__ = [ 'config' , 'db' , 'gps' , 'wifiscan' , 'view' ]
+__all__ = [ 'config' , 'db' , 'gps' , 'wifiscan' , 'scanner' , 'view' ]
 
 from config import *
 
@@ -9,5 +9,9 @@ from gps import *
 
 from wifiscan import *
 
+from scanner import *
+
 from view import *
 
+from replay import *
+
index 6353744..bcb4c51 100755 (executable)
@@ -137,7 +137,7 @@ class interactiveMapWidget :
     self.composeMap()
     self.show()
 
-class mapWidget ( AbstractmapWidget , gtk.Image ) :
+class simpleMapWidget ( AbstractmapWidget , gtk.Image ) :
 
     def __init__ ( self , config , map_size=(800,480) ) :
         AbstractmapWidget.__init__( self , config , map_size )
@@ -204,6 +204,7 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
                 del(pixbuf)
 
         self.draw_paths()
+        self.plot_APs()
 
     def draw_paths( self ) :
 
@@ -230,14 +231,6 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
                 pixmap.draw_rectangle(blue, True , dest_x , dest_y , 3 , 3 )
         fd.close()
 
-        db = wifimap.db.database( os.path.join( self.conf.homedir , self.conf.dbname ) )
-        db.open()
-        for ap in db.db.execute( "SELECT * FROM ap" ) :
-            if ap[3] > 1 :
-                dest_x , dest_y = self.gps2pix( ( ap[4]/ap[3] , ap[5]/ap[3] ) , ( center_x , center_y ) )
-                pixmap.draw_rectangle(red, True , dest_x , dest_y , 3 , 3 )
-        db.close()
-
         self.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.win_x, self.win_y )
 
     def plot_APs( self ) :
@@ -264,3 +257,7 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
 
         self.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.win_x, self.win_y )
 
+class mapWidget ( simpleMapWidget , interactiveMapWidget ) :
+
+    pass
+
index dfa108a..25198bf 100755 (executable)
@@ -123,7 +123,7 @@ if hildon :
 
             self.config = wifimap.config.Configuration()
             self.config.zoom = 16
-            self.map = wifimap.mapWidget( self.config )
+            self.map = wifimap.simpleMapWidget( self.config )
             self.map.plot_APs()
             self.add( self.map )
 
@@ -165,7 +165,7 @@ else :
 
             self.config = wifimap.config.Configuration()
             self.config.zoom = 16
-            self.add( wifimap.mapWidget( self.config , (640,400) ) )
+            self.add( wifimap.simpleMapWidget( self.config , (640,400) ) )
 
     class Wifiscanner ( AbstractWifiscanner , gtk.Window ) :