Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
df-aggregator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
df-aggregator
Commits
8cc454f9
Commit
8cc454f9
authored
Jan 11, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotfixes on the project
parent
fe086c42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
df-aggregator.py
df-aggregator.py
+33
-5
No files found.
df-aggregator.py
View file @
8cc454f9
...
@@ -55,7 +55,7 @@ d = 40000 # draw distance of LOBs in meters
...
@@ -55,7 +55,7 @@ d = 40000 # draw distance of LOBs in meters
heading_d
=
20000
heading_d
=
20000
max_age
=
5000
max_age
=
5000
receivers
=
[]
receivers
=
[]
cached_receivers
=
[]
###############################################
###############################################
# Stores settings realted to intersect capture
# Stores settings realted to intersect capture
...
@@ -633,7 +633,11 @@ def write_czml(best_point, all_the_points, ellipsedata, plotallintersects, eps):
...
@@ -633,7 +633,11 @@ def write_czml(best_point, all_the_points, ellipsedata, plotallintersects, eps):
@get
(
'/receivers.czml'
)
@get
(
'/receivers.czml'
)
def
write_rx_czml
():
def
write_rx_czml
():
response
.
set_header
(
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
height
=
50
min_conf
=
ms
.
min_conf
min_conf
=
ms
.
min_conf
min_power
=
ms
.
min_power
min_power
=
ms
.
min_power
...
@@ -713,8 +717,13 @@ def write_rx_czml():
...
@@ -713,8 +717,13 @@ def write_rx_czml():
**
rx_properties
,
**
rx_icon
},
**
rx_properties
,
**
rx_icon
},
position
=
{
"cartographicDegrees"
:
[
x
.
longitude
,
x
.
latitude
,
15
]}))
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
# Writes aoi.czml used by the WebUI
...
@@ -1022,6 +1031,7 @@ def run_receiver(receivers):
...
@@ -1022,6 +1031,7 @@ def run_receiver(receivers):
except
IOError
:
except
IOError
:
print
(
"Problem connecting to receiver."
)
print
(
"Problem connecting to receiver."
)
rx
.
d_2_last_intersection
=
[]
rx
.
d_2_last_intersection
=
[]
time
.
sleep
(
0.1
)
for
x
in
range
(
len
(
receivers
)):
for
x
in
range
(
len
(
receivers
)):
for
y
in
range
(
x
):
for
y
in
range
(
x
):
...
@@ -1048,6 +1058,16 @@ def run_receiver(receivers):
...
@@ -1048,6 +1058,16 @@ def run_receiver(receivers):
if
intersection
.
any
()
is
not
None
:
if
intersection
.
any
()
is
not
None
:
intersect_list
=
np
.
concatenate
(
intersect_list
=
np
.
concatenate
(
(
intersect_list
,
intersection
),
axis
=
0
)
(
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
:
if
intersect_list
.
size
!=
0
:
avg_coord
=
np
.
average
(
avg_coord
=
np
.
average
(
...
@@ -1113,6 +1133,11 @@ def run_receiver(receivers):
...
@@ -1113,6 +1133,11 @@ def run_receiver(receivers):
command
=
"INSERT INTO lobs VALUES (?,?,?,?,?,?)"
command
=
"INSERT INTO lobs VALUES (?,?,?,?,?,?)"
DATABASE_EDIT_Q
.
put
((
command
,
[
current_doa
,
],
True
))
DATABASE_EDIT_Q
.
put
((
command
,
[
current_doa
,
],
True
))
DATABASE_RETURN
.
get
(
timeout
=
1
)
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
))
DATABASE_EDIT_Q
.
put
((
"done"
,
None
,
False
))
# try:
# try:
...
@@ -1432,7 +1457,10 @@ if __name__ == '__main__':
...
@@ -1432,7 +1457,10 @@ if __name__ == '__main__':
clear
(
debugging
)
clear
(
debugging
)
if
not
debugging
:
if
not
debugging
:
print
(
"Receiver Paused"
)
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
:
except
KeyboardInterrupt
:
finish
()
finish
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment