Beispiel #1
0
def updateSpeedInfo(n_clicks, oldSpeed, newSpeed):
    if n_clicks != None:
        conn = proj.openConnection(r"proj.sqlite")
        nclicks = None
        print("Speeds Updated")
        with conn:
            proj.updatespeed(conn, oldSpeed, newSpeed)
        proj.closeConnection(conn, r"proj.sqlite")
Beispiel #2
0
def addIspInfo(n_clicks, isp):
    if n_clicks != None:
        conn = proj.openConnection(r"proj.sqlite")
        nclicks = None
        print("ISP Added")
        with conn:
            proj.insertisp(conn, isp)
        proj.closeConnection(conn, r"proj.sqlite")
Beispiel #3
0
def deleteContractInfo(n_clicks, addr):
    if n_clicks != None:
        conn = proj.openConnection(r"proj.sqlite")
        nclicks = None
        print("Deleted Contract")
        with conn:
            proj.endcontract(conn, addr)
        proj.closeConnection(conn, r"proj.sqlite")
Beispiel #4
0
def insertInfo(n_clicks, loc, num, addr):
    if n_clicks != None:
        conn = proj.openConnection(r"proj.sqlite")
        nclicks = None
        print("Inserted")
        with conn:
            proj.inserthouse(conn, "Address___#" + str(addr), num, loc)
        proj.closeConnection(conn, r"proj.sqlite")
Beispiel #5
0
def updateSpeedDropDown(n_intervals):
    conn = proj.openConnection(r"proj.sqlite")
    c = conn.cursor()
    speeds = "SELECT DISTINCT s_speed FROM speed ORDER BY s_speed"
    c.execute(speeds)
    speeds = [{
        'label': str(i[0]) + " mbps",
        'value': i[0]
    } for i in c.fetchall()]
    proj.closeConnection(conn, r"proj.sqlite")
    return [speeds]
Beispiel #6
0
#!/usr/bin/python3
import dash
import dash_core_components as dcc
import dash_html_components as html
import sqlite3
import numpy as np
import pandas as pd
from dash.dependencies import Input, Output, State

import proj

app = dash.Dash()

conn = proj.openConnection(r"proj.sqlite")
#make just a list of addresses #kinda pointless
allAddresses = "SELECT n_address FROM network ORDER BY n_address"
c = conn.cursor()
c.execute(allAddresses)
allAddresses = []
addrOptions = []
for i in c.fetchall():
    allAddresses.append(i[0])
for i in allAddresses:
    addrOptions.append({'label': i, 'value': i})

speeds = "SELECT DISTINCT s_speed FROM speed ORDER BY s_speed"
c.execute(speeds)
speeds = []
speedOptions = []
for i in c.fetchall():
    speeds.append(i[0])