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
78af3a54
Commit
78af3a54
authored
Dec 22, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Caching, made sliders touch friendly.
parent
265a2e15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
24 deletions
+21
-24
df-aggregator.py
df-aggregator.py
+8
-5
cesium.tpl
views/cesium.tpl
+13
-19
No files found.
df-aggregator.py
View file @
78af3a54
...
@@ -20,6 +20,8 @@ from czml3.properties import Position, Polyline, PolylineOutlineMaterial, Color,
...
@@ -20,6 +20,8 @@ from czml3.properties import Position, Polyline, PolylineOutlineMaterial, Color,
from
multiprocessing
import
Process
,
Queue
from
multiprocessing
import
Process
,
Queue
from
bottle
import
route
,
run
,
request
,
get
,
post
,
put
,
response
,
redirect
,
template
,
static_file
from
bottle
import
route
,
run
,
request
,
get
,
post
,
put
,
response
,
redirect
,
template
,
static_file
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate, max-age=0'
)
DBSCAN_Q
=
Queue
()
DBSCAN_Q
=
Queue
()
DBSCAN_WAIT_Q
=
Queue
()
DBSCAN_WAIT_Q
=
Queue
()
DATABASE_EDIT_Q
=
Queue
()
DATABASE_EDIT_Q
=
Queue
()
...
@@ -502,7 +504,8 @@ def write_czml(best_point, all_the_points, ellipsedata):
...
@@ -502,7 +504,8 @@ def write_czml(best_point, all_the_points, ellipsedata):
ellipse
=
{
**
ellipse_properties
,
**
ellipse_info
},
ellipse
=
{
**
ellipse_properties
,
**
ellipse_info
},
position
=
{
"cartographicDegrees"
:
[
x
[
3
],
x
[
4
],
0
]}))
position
=
{
"cartographicDegrees"
:
[
x
[
3
],
x
[
4
],
0
]}))
output
=
Document
([
top
]
+
best_point_packets
+
all_point_packets
+
ellipse_packets
)
output
=
json
.
dumps
(
json
.
loads
(
str
(
Document
([
top
]
+
best_point_packets
+
all_point_packets
+
ellipse_packets
))),
separators
=
(
','
,
':'
))
return
output
return
output
...
@@ -511,7 +514,7 @@ def write_czml(best_point, all_the_points, ellipsedata):
...
@@ -511,7 +514,7 @@ def write_czml(best_point, all_the_points, ellipsedata):
###############################################
###############################################
@get
(
'/receivers.czml'
)
@get
(
'/receivers.czml'
)
def
write_rx_czml
():
def
write_rx_czml
():
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate'
)
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate
, max-age=0
'
)
height
=
50
height
=
50
receiver_point_packets
=
[]
receiver_point_packets
=
[]
lob_packets
=
[]
lob_packets
=
[]
...
@@ -635,7 +638,7 @@ def clear(debugging):
...
@@ -635,7 +638,7 @@ def clear(debugging):
###############################################
###############################################
@route
(
'/static/<filepath:path>'
,
name
=
'static'
)
@route
(
'/static/<filepath:path>'
,
name
=
'static'
)
def
server_static
(
filepath
):
def
server_static
(
filepath
):
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate'
)
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate
, max-age=0
'
)
return
static_file
(
filepath
,
root
=
'./static'
)
return
static_file
(
filepath
,
root
=
'./static'
)
###############################################
###############################################
...
@@ -646,7 +649,7 @@ def server_static(filepath):
...
@@ -646,7 +649,7 @@ def server_static(filepath):
@get
(
'/index'
)
@get
(
'/index'
)
@get
(
'/cesium'
)
@get
(
'/cesium'
)
def
cesium
():
def
cesium
():
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate'
)
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate
, max-age=0
'
)
with
open
(
'accesstoken.txt'
,
"r"
)
as
tokenfile
:
with
open
(
'accesstoken.txt'
,
"r"
)
as
tokenfile
:
access_token
=
tokenfile
.
read
()
.
replace
(
'
\n
'
,
''
)
access_token
=
tokenfile
.
read
()
.
replace
(
'
\n
'
,
''
)
return
template
(
'cesium.tpl'
,
return
template
(
'cesium.tpl'
,
...
@@ -706,7 +709,7 @@ def rx_params():
...
@@ -706,7 +709,7 @@ def rx_params():
###############################################
###############################################
@get
(
'/output.czml'
)
@get
(
'/output.czml'
)
def
tx_czml_out
():
def
tx_czml_out
():
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate'
)
response
.
set_header
(
'Cache-Control'
,
'no-cache, no-store, must-revalidate
, max-age=0
'
)
output
=
write_czml
(
*
process_data
(
database_name
))
output
=
write_czml
(
*
process_data
(
database_name
))
return
str
(
output
)
return
str
(
output
)
...
...
views/cesium.tpl
View file @
78af3a54
...
@@ -20,17 +20,12 @@
...
@@ -20,17 +20,12 @@
</div>
</div>
<script>
<script>
// // Update Map every n milliseconds
// var rxRefreshRate = 5000;
// var autoRxRefresh = setInterval(function () { reloadRX(); }, rxRefreshRate);
var
transmittersDataSource
=
new
Cesium
.
CzmlDataSource
;
var
transmittersDataSource
=
new
Cesium
.
CzmlDataSource
;
var
receiversDataSource
=
new
Cesium
.
CzmlDataSource
;
var
receiversDataSource
=
new
Cesium
.
CzmlDataSource
;
var
aoiDataSource
=
new
Cesium
.
CzmlDataSource
;
var
aoiDataSource
=
new
Cesium
.
CzmlDataSource
;
// Your access token can be found at: https://cesium.com/ion/tokens.
// Your access token can be found at: https://cesium.com/ion/tokens.
Cesium
.
Ion
.
defaultAccessToken
=
'{
{
access_token
}
}'
;
Cesium
.
Ion
.
defaultAccessToken
=
'{
{
access_token
}
}'
;
// var hpr = new Cesium.HeadingPitchRange(0, 40, 0)
var
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
var
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
// terrainProvider: Cesium.createWorldTerrain(),
// terrainProvider: Cesium.createWorldTerrain(),
homeButton
:
false
,
homeButton
:
false
,
...
@@ -39,8 +34,8 @@
...
@@ -39,8 +34,8 @@
var
clock
=
new
Cesium
.
Clock
({
var
clock
=
new
Cesium
.
Clock
({
clockStep
:
Cesium
.
ClockStep
.
SYSTEM_CLOCK_MULTIPLIER
clockStep
:
Cesium
.
ClockStep
.
SYSTEM_CLOCK_MULTIPLIER
});
});
viewer
.
clock
.
shouldAnimate
=
true
;
viewer
.
clock
.
shouldAnimate
=
true
;
// var hpr = new Cesium.HeadingPitchRange(0.0, 1.57, 5000.0);
viewer
.
zoomTo
(
loadAllCzml
());
viewer
.
zoomTo
(
loadAllCzml
());
var
scene
=
viewer
.
scene
;
var
scene
=
viewer
.
scene
;
...
@@ -51,7 +46,6 @@
...
@@ -51,7 +46,6 @@
var
handler
;
var
handler
;
var
cartesian
;
var
cartesian
;
var
cartographic
var
cartographic
// var center_cartesian;
var
rad_cartesian
;
var
rad_cartesian
;
var
center_lat
;
var
center_lat
;
var
center_lon
;
var
center_lon
;
...
@@ -202,9 +196,10 @@
...
@@ -202,9 +196,10 @@
function
loadTxCzml
()
{
function
loadTxCzml
()
{
transmittersDataSource
.
load
(
'/output.czml'
);
transmittersDataSource
.
load
(
'/output.czml'
);
viewer
.
dataSources
.
add
(
transmittersDataSource
);
Cesium
.
when
(
transmittersDataSource
,
function
(
dataSource1
){
// console.log("Loaded CZML");
viewer
.
dataSources
.
add
(
dataSource1
);
return
transmittersDataSource
;
return
dataSource1
;
});
}
}
function
loadRxCzml
()
{
function
loadRxCzml
()
{
...
@@ -221,12 +216,11 @@
...
@@ -221,12 +216,11 @@
return
aoiDataSource
;
return
aoiDataSource
;
}
}
function
loadAllCzml
()
{
function
loadAllCzml
()
{
l
oadT
xCzml
();
l
et
rx
=
loadR
xCzml
();
loadAoiCzml
();
l
et
aoi
=
l
oadAoiCzml
();
let
zoom
=
loadR
xCzml
();
let
tx
=
loadT
xCzml
();
return
zoom
;
return
rx
;
}
}
function
clearOld
()
{
function
clearOld
()
{
...
@@ -376,25 +370,25 @@
...
@@ -376,25 +370,25 @@
epsslider
.
oninput
=
function
()
{
epsslider
.
oninput
=
function
()
{
epsoutput
.
innerHTML
=
this
.
value
;
epsoutput
.
innerHTML
=
this
.
value
;
}
}
epsslider
.
on
mouse
up
=
function
()
{
epsslider
.
on
pointer
up
=
function
()
{
updateParams
(
"eps="
+
this
.
value
);
updateParams
(
"eps="
+
this
.
value
);
}
}
powerslider
.
oninput
=
function
()
{
powerslider
.
oninput
=
function
()
{
poweroutput
.
innerHTML
=
this
.
value
;
poweroutput
.
innerHTML
=
this
.
value
;
}
}
powerslider
.
on
mouse
up
=
function
()
{
powerslider
.
on
pointer
up
=
function
()
{
updateParams
(
"minpower="
+
this
.
value
);
updateParams
(
"minpower="
+
this
.
value
);
}
}
confslider
.
oninput
=
function
()
{
confslider
.
oninput
=
function
()
{
confoutput
.
innerHTML
=
this
.
value
;
confoutput
.
innerHTML
=
this
.
value
;
}
}
confslider
.
on
mouse
up
=
function
()
{
confslider
.
on
pointer
up
=
function
()
{
updateParams
(
"minconf="
+
this
.
value
);
updateParams
(
"minconf="
+
this
.
value
);
}
}
minpointslider
.
oninput
=
function
()
{
minpointslider
.
oninput
=
function
()
{
minpointoutput
.
innerHTML
=
this
.
value
;
minpointoutput
.
innerHTML
=
this
.
value
;
}
}
minpointslider
.
on
mouse
up
=
function
()
{
minpointslider
.
on
pointer
up
=
function
()
{
updateParams
(
"minpts="
+
this
.
value
);
updateParams
(
"minpts="
+
this
.
value
);
}
}
...
...
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