Commit 8cc454f9 by Oleksandr Barabash

hotfixes on the project

parent fe086c42
......@@ -55,7 +55,7 @@ d = 40000 # draw distance of LOBs in meters
heading_d = 20000
max_age = 5000
receivers = []
cached_receivers = []
###############################################
# Stores settings realted to intersect capture
......@@ -633,7 +633,11 @@ def write_czml(best_point, all_the_points, ellipsedata, plotallintersects, eps):
@get('/receivers.czml')
def write_rx_czml():
response.set_header(
'Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0')
'Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0',
)
response.set_header(
'Content-Type', 'application/json'
)
height = 50
min_conf = ms.min_conf
min_power = ms.min_power
......@@ -713,8 +717,13 @@ def write_rx_czml():
**rx_properties, **rx_icon},
position={"cartographicDegrees": [x.longitude, x.latitude, 15]}))
return Document([top] + receiver_point_packets + lob_packets).dumps(separators=(',', ':'))
response_data = Document([top] + receiver_point_packets + lob_packets).dumps(separators=(',', ':'))
# 11.01.2023::s1z: I know this is ugly and stupid,
# but we're not gonna rewrite the project anyways,
# so, whatever...
globals()["cached_receivers"] = response_data
return response_data
return globals()["cached_receivers"]
###############################################
# Writes aoi.czml used by the WebUI
......@@ -1022,6 +1031,7 @@ def run_receiver(receivers):
except IOError:
print("Problem connecting to receiver.")
rx.d_2_last_intersection = []
time.sleep(0.1)
for x in range(len(receivers)):
for y in range(x):
......@@ -1048,6 +1058,16 @@ def run_receiver(receivers):
if intersection.any() is not None:
intersect_list = np.concatenate(
(intersect_list, intersection), axis=0)
# 11.01.2023::s1z: I don't know if this shit-code is blocking
# or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load
# of the CPU.
time.sleep(0.1)
# 11.01.2023::s1z: I don't know if this shit-code is blocking
# or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load
# of the CPU.
time.sleep(0.1)
if intersect_list.size != 0:
avg_coord = np.average(
......@@ -1113,6 +1133,11 @@ def run_receiver(receivers):
command = "INSERT INTO lobs VALUES (?,?,?,?,?,?)"
DATABASE_EDIT_Q.put((command, [current_doa, ], True))
DATABASE_RETURN.get(timeout=1)
# 11.01.2023::s1z: I don't know if this shit-code is blocking
# or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load
# of the CPU.
time.sleep(0.01) # 11.01.2023::s1z: The fuck is this crap ?
DATABASE_EDIT_Q.put(("done", None, False))
# try:
......@@ -1432,7 +1457,10 @@ if __name__ == '__main__':
clear(debugging)
if not debugging:
print("Receiver Paused")
time.sleep(1)
# 11.01.2023::s1z: I don't know wtf is this crap, but sleep 1 sec,
# You gotta be kidding me.
# Changed fro 1 sec to 10 ms.
time.sleep(0.01)
except KeyboardInterrupt:
finish()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment