Spaces:
Sleeping
Sleeping
LapStore commited on
Commit ·
70b4505
1
Parent(s): ee3c704
refined design
Browse files- app.py +0 -1
- mqtt_manager.py +3 -4
- traffic_utils.py +3 -1
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import ast
|
|
| 4 |
import pymysql
|
| 5 |
import time
|
| 6 |
from database_manager import *
|
| 7 |
-
from mqtt_manager import singlas_state
|
| 8 |
from mqtt_manager import *
|
| 9 |
from traffic_utils import *
|
| 10 |
from Utils import *
|
|
|
|
| 4 |
import pymysql
|
| 5 |
import time
|
| 6 |
from database_manager import *
|
|
|
|
| 7 |
from mqtt_manager import *
|
| 8 |
from traffic_utils import *
|
| 9 |
from Utils import *
|
mqtt_manager.py
CHANGED
|
@@ -4,7 +4,8 @@ import time
|
|
| 4 |
import threading
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
import os
|
| 7 |
-
from traffic_utils import status_acc,status_emr,status_free
|
|
|
|
| 8 |
import paho.mqtt.client as mqtt
|
| 9 |
import time
|
| 10 |
|
|
@@ -19,9 +20,7 @@ topic_rep = lambda x: MQTT_PARTOPIC_state+"/"+x +"/"+ MQTT_SUBTOPIC_reply
|
|
| 19 |
topic_msg = lambda x:MQTT_PARTOPIC_state+"/"+x +"/"+ MQTT_SUBTOPIC_msg
|
| 20 |
|
| 21 |
|
| 22 |
-
|
| 23 |
-
"1698478721" :status_free,
|
| 24 |
-
"6082411793":status_free}
|
| 25 |
|
| 26 |
client = mqtt.Client()
|
| 27 |
|
|
|
|
| 4 |
import threading
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
import os
|
| 7 |
+
from traffic_utils import status_acc,status_emr,status_free,singlas_state
|
| 8 |
+
|
| 9 |
import paho.mqtt.client as mqtt
|
| 10 |
import time
|
| 11 |
|
|
|
|
| 20 |
topic_msg = lambda x:MQTT_PARTOPIC_state+"/"+x +"/"+ MQTT_SUBTOPIC_msg
|
| 21 |
|
| 22 |
|
| 23 |
+
|
|
|
|
|
|
|
| 24 |
|
| 25 |
client = mqtt.Client()
|
| 26 |
|
traffic_utils.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
import requests
|
| 2 |
from database_manager import *
|
| 3 |
import time
|
| 4 |
-
from mqtt_manager import singlas_state
|
| 5 |
|
| 6 |
status_free = "FREE"
|
| 7 |
status_emr = "EMR"
|
| 8 |
status_acc = "ACC"
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def get_traffic_in_container(coordinates):
|
| 11 |
(min_lat, max_lat, min_lon, max_lon) = get_rectangle_container(coordinates)
|
|
|
|
| 1 |
import requests
|
| 2 |
from database_manager import *
|
| 3 |
import time
|
|
|
|
| 4 |
|
| 5 |
status_free = "FREE"
|
| 6 |
status_emr = "EMR"
|
| 7 |
status_acc = "ACC"
|
| 8 |
+
singlas_state = {
|
| 9 |
+
"1698478721" :status_free,
|
| 10 |
+
"6082411793":status_free}
|
| 11 |
|
| 12 |
def get_traffic_in_container(coordinates):
|
| 13 |
(min_lat, max_lat, min_lon, max_lon) = get_rectangle_container(coordinates)
|