#!/usr/bin/python3 import time import configuration circleOpacity=0.2 useLeafletLocal=1 MAPBOXTOKEN="pk.eyJ1IjoieWFuaWtjYXdpZHJvbmUiLCJhIjoiY2p4dmlheGtzMDN0dTNoa2R2b2sxZndkNSJ9.Tfd-xcohTT4x7nEe5_6Rxg" server = configuration.get_server() # Leaflet # https://unpkg.com/leaflet@1.7.1/dist/leaflet.js # https://unpkg.com/leaflet@1.7.1/dist/leaflet.css def networkSurveyColor(rssi): color="#888" if float(rssi) < -105: color="#f00" elif float(rssi) < -95: color="#ff6600" elif float(rssi) < -85: color="#ffa500" elif float(rssi) < -80: color="#ffab40" else: color="#15ab00" return color def networkSurveySetLeaflet(useLocal): global useLeafletLocal if True is useLocal: useLeafletLocal=1 else: useLeafletLocal=0 def networkSurveyAddLeaflet(): global useLeafletLocal leaflet="" leafletCssPath="leaflet.css" leafletJsPath="leaflet.js" if useLeafletLocal is 0: leafletCssPath="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" leafletJsPath="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" leaflet+=" \n" leaflet+=" \n" return leaflet def networkSurveySetMapboxApiToken(): global MAPBOXTOKEN return MAPBOXTOKEN def networkSurvey(filename, subId, devEUI = None, fileOutput= True): global server global circleOpacity start_time = time.time() htmlOutput="\n" htmlOutput+="\n" htmlOutput+="
\n" htmlOutput+="Took: "+str(deltaTime)+" seconds
\n" if countRaw != 0: #print(lastLine) part=lastLine.split(',') lastOutput="\n" lastOutput+="