From: javiplx Date: Mon, 11 Oct 2010 18:55:30 +0000 (+0000) Subject: Handle geocordinates under active scanning X-Git-Tag: cleaned~32 X-Git-Url: http://vcs.maemo.org/git/?p=wifihood;a=commitdiff_plain;h=2cb7d0a4127899b60a3f3961cfc50d2af40d8d0a Handle geocordinates under active scanning git-svn-id: file:///svnroot/wifihood/trunk@52 c51dfc6a-5949-4919-9c8e-f207a149c383 --- diff --git a/wifiscanner/wifimap/wifiscan.py b/wifiscanner/wifimap/wifiscan.py index 6dcd3f5..4035467 100644 --- a/wifiscanner/wifimap/wifiscan.py +++ b/wifiscanner/wifimap/wifiscan.py @@ -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