Handle geocordinates under active scanning
authorjaviplx <javiplx@gmail.com>
Mon, 11 Oct 2010 18:55:30 +0000 (18:55 +0000)
committerjaviplx <javiplx@gmail.com>
Mon, 11 Oct 2010 18:55:30 +0000 (18:55 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@52 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscanner/wifimap/wifiscan.py

index 6dcd3f5..4035467 100644 (file)
@@ -53,7 +53,10 @@ class Scanner ( gps.GPSObject ) :
             start, end = self.scanlist.get_bounds()
             self.scanlist.delete( start , end )
         tstamp = time.time()
-        out_str = self.store_scan( scan_out , tstamp , scan_out )
+        latlon = None
+        if self.gps_state == "FIX" :
+            latlon = ( self.device.fix[4] , self.device.fix[5] , self.device.fix[7] )
+        out_str = self.store_scan( scan_out , tstamp , scan_out , latlon )
         self.refresh_infowin( tstamp )
         if self._debug :
             osso.SystemNote(self.osso_context).system_note_infoprint("Found %d APs" % len(scan_out) )
@@ -62,7 +65,7 @@ class Scanner ( gps.GPSObject ) :
 
         return True
 
-    def store_scan ( self , timestamp , scan_out ) :
+    def store_scan ( self , timestamp , scan_out , gps_info ) :
         out_str = ""
         for net in scan_out.split() :
             self.nfp += 1
@@ -75,13 +78,13 @@ class Scanner ( gps.GPSObject ) :
                 max_rss = int(items[1])
                 if stored[0] > max_rss :
                     max_rss = stored[0]
-                self.db.update( items[0] , max_rss , timestamp )
+                self.db.update( items[0] , max_rss , timestamp , gps_info )
             else :
                 self.newap += 1
-                self.db.add( items[0] , int(items[1]) , timestamp )
+                self.db.add( items[0] , int(items[1]) , timestamp , gps_info )
         return out_str
 
-    def store_logscan ( self , timestamp , scan_out , gps_info=None ) :
+    def store_logscan ( self , timestamp , scan_out , gps_info ) :
         nets = scan_out.split()
         while nets :
             self.nfp += 1