Ignore:
Timestamp:
Apr 20, 2011, 12:42:33 PM (14 years ago)
Author:
dennisw
Message:

Grey color removed from images. Added signal strength.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/management/commands/dataimport.py

    r9084 r9092  
    6262    bssid = wnetwork.find('BSSID')
    6363    if bssid != None: bssid = bssid.text
     64    min_sig = wnetwork.find('snr-info/min_signal_dbm')
     65    if min_sig != None: min_sig = int(min_sig.text)
     66    else: min_sig = (-99)
     67    max_sig = wnetwork.find('snr-info/max_signal_dbm')
     68    if max_sig != None: max_sig = int(max_sig.text)
     69    else: max_sig= (-99)
    6470    lat = wnetwork.find('gps-info/min-lat')
    6571    if lat != None: lat = lat.text
     
    6773    if lon != None: lon = lon.text
    6874    if ssid is None: continue
    69     print enc, ssid, bssid, lat, lon
     75   
     76    avg_sig = (min_sig+max_sig)/2
     77    sig = (1.67*avg_sig)+166.67
     78    if sig > 100: sig = 100
     79    if sig < 0: sig = 0
     80
     81    print enc, ssid, bssid, lat, lon, sig
    7082
    7183    ap, created = Accespoint.objects.get_or_create(mac=bssid, ssid=ssid, encryptie=enc)
    72     m = Meting.objects.create(meetrondje=mr, accespoint=ap, latitude=lat, longitude=lon, signaal=100)
     84    m = Meting.objects.create(meetrondje=mr, accespoint=ap, latitude=lat, longitude=lon, signaal=sig)
    7385
    7486
Note: See TracChangeset for help on using the changeset viewer.