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
4a7cd16f
Commit
4a7cd16f
authored
Nov 14, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI Improvements and fixes
parent
e2e54efe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
66 deletions
+51
-66
df-aggregator.py
df-aggregator.py
+2
-32
style.css
static/style.css
+7
-8
cesium.tpl
views/cesium.tpl
+42
-26
No files found.
df-aggregator.py
View file @
4a7cd16f
...
...
@@ -248,13 +248,6 @@ def write_czml(best_point, all_the_points, ellipsedata):
"rgba"
:
[
0
,
255
,
0
,
255
],
}
}
# weighted_properties = {
# "pixelSize":20.0,
# "heightReference":"RELATIVE_TO_GROUND",
# "color": {
# "rgba": [0, 0, 255, 255],
# }
# }
rx_properties
=
{
"image"
:
{
...
...
@@ -282,7 +275,6 @@ def write_czml(best_point, all_the_points, ellipsedata):
top
=
Preamble
(
name
=
"Geolocation Data"
)
all_point_packets
=
[]
best_point_packets
=
[]
# weighted_point_packets = []
receiver_point_packets
=
[]
ellipse_packets
=
[]
...
...
@@ -298,25 +290,20 @@ def write_czml(best_point, all_the_points, ellipsedata):
point
=
best_point_properties
,
position
=
{
"cartographicDegrees"
:
[
x
[
1
],
x
[
0
],
15
]}))
# if weighted_point != None:
# for x in weighted_point:
# weighted_point_packets.append(Packet(id=str(x[1]) + ", " + str(x[0]),
# point=weighted_properties,
# position={"cartographicDegrees": [ x[0], x[1], 15 ]}))
if
ellipsedata
!=
None
:
for
x
in
ellipsedata
:
# rotation = 2 * np.pi - x[2]
if
x
[
0
]
>=
x
[
1
]:
semiMajorAxis
=
x
[
0
]
semiMinorAxis
=
x
[
1
]
# rotation = x[2]
rotation
=
2
*
np
.
pi
-
x
[
2
]
rotation
+=
np
.
pi
/
2
# print(f"{x[4], x[3]} is inveted")
else
:
rotation
=
x
[
2
]
semiMajorAxis
=
x
[
1
]
semiMinorAxis
=
x
[
0
]
# print(f"{x[4], x[3]} is NOT inveted")
ellipse_info
=
{
"semiMajorAxis"
:
semiMajorAxis
,
"semiMinorAxis"
:
semiMinorAxis
,
"rotation"
:
rotation
}
ellipse_packets
.
append
(
Packet
(
id
=
str
(
x
[
4
])
+
", "
+
str
(
x
[
3
]),
...
...
@@ -329,14 +316,7 @@ def write_czml(best_point, all_the_points, ellipsedata):
position
=
{
"cartographicDegrees"
:
[
x
.
longitude
,
x
.
latitude
,
15
]}))
with
open
(
"static/output.czml"
,
"w"
)
as
file1
:
# if best_point and ellipsedata != None:
file1
.
write
(
str
(
Document
([
top
]
+
best_point_packets
+
all_point_packets
+
receiver_point_packets
+
ellipse_packets
)))
# elif best_point != None:
# file1.write(str(Document([top] + best_point_packets + all_point_packets + receiver_point_packets)))
# elif all_the_points != None:
# file1.write(str(Document([top] + all_point_packets + receiver_point_packets)))
# else:
# file1.write(str(Document([top] + receiver_point_packets)))
def
finish
():
clear
(
debugging
)
...
...
@@ -385,18 +365,9 @@ def cesium():
# @post('/cesium')
@get
(
'/update'
)
def
update_cesium
():
# ms.eps = float(request.forms.get('epsilonValue'))/100
# ms.min_conf = float(request.forms.get('confValue'))
# ms.min_power = float(request.forms.get('powerValue'))
# ms.min_samp = float(request.forms.get('minpointValue'))
# ms.receiving = True if request.forms.get('rx_en') == "on" else False
# ms.plotintersects = True if request.forms.get('intersect_en') == "on" else False
ms
.
eps
=
float
(
request
.
query
.
eps
)
if
request
.
query
.
eps
else
ms
.
eps
# print(request.query.eps, ms.eps)
ms
.
min_conf
=
float
(
request
.
query
.
minconf
)
if
request
.
query
.
minconf
else
ms
.
min_conf
# print(request.query.minconf, ms.min_conf)
ms
.
min_power
=
float
(
request
.
query
.
minpower
)
if
request
.
query
.
minpower
else
ms
.
min_power
# print(request.query.minpower, ms.min_power)
ms
.
min_samp
=
float
(
request
.
query
.
minpts
)
if
request
.
query
.
minpts
else
ms
.
min_samp
if
request
.
query
.
rx
==
"true"
:
...
...
@@ -410,7 +381,6 @@ def update_cesium():
write_czml
(
*
process_data
(
database_name
,
geofile
))
return
"OK"
# return redirect('cesium')
def
start_server
(
ipaddr
=
"127.0.0.1"
,
port
=
8080
):
run
(
host
=
ipaddr
,
port
=
port
,
quiet
=
True
,
server
=
"paste"
,
debug
=
True
)
...
...
static/style.css
View file @
4a7cd16f
...
...
@@ -123,7 +123,7 @@ span {
/*Slider Stuff*/
.slidecontainer
{
width
:
100%
;
/* Width of the outside container */
max-width
:
8
00px
;
max-width
:
6
00px
;
color
:
white
;
text-shadow
:
-1px
-1px
0
#000
,
...
...
@@ -137,15 +137,15 @@ span {
}
.slidespan
{
width
:
70%
;
/* Width of the outside container */
width
:
550px
;
/* Width of the outside container */
/* padding-top: 10px;
padding-bottom: 10px;*/
vertical-align
:
middle
;
}
.slidetitle
{
width
:
1
5%
;
text-align
:
righ
t
;
width
:
1
70px
;
text-align
:
lef
t
;
}
.slidevalue
{
...
...
@@ -160,7 +160,7 @@ span {
vertical-align
:
middle
;
width
:
100%
;
height
:
25px
;
/* Specified height */
background
:
#
d3d3d3
;
/* Grey background */
background
:
#
eee
;
/* Grey background */
outline
:
none
;
/* Remove outline */
opacity
:
0.7
;
/* Set transparency (for mouse-over effects on hover) */
-webkit-transition
:
.2s
;
/* 0.2 seconds transition on hover */
...
...
@@ -260,7 +260,7 @@ input:checked + .switchslider:before {
.tooltip
.tooltiptext
{
visibility
:
hidden
;
width
:
24
0px
;
width
:
38
0px
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
color
:
#fff
;
text-align
:
center
;
...
...
@@ -270,8 +270,7 @@ input:checked + .switchslider:before {
/* Position the tooltip */
position
:
absolute
;
z-index
:
10
;
top
:
-5px
;
right
:
100%
;
left
:
100%
;
}
.tooltip
:hover
.tooltiptext
{
...
...
views/cesium.tpl
View file @
4a7cd16f
...
...
@@ -19,6 +19,10 @@
homeButton
:
false
,
timeline
:
false
});
var
clock
=
new
Cesium
.
Clock
({
clockStep
:
Cesium
.
ClockStep
.
SYSTEM_CLOCK_MULTIPLIER
});
viewer
.
clock
.
shouldAnimate
=
true
;
viewer
.
zoomTo
(
loadCzml
());
...
...
@@ -27,8 +31,11 @@
xmlHttp
.
open
(
"GET"
,
"/update?"
+
parameter
,
true
);
// false for synchronous request
xmlHttp
.
send
(
null
);
xmlHttp
.
onreadystatechange
=
function
()
{
if
(
this
.
readyState
==
4
&&
this
.
status
==
200
)
{
if
(
this
.
readyState
==
3
)
{
clearOld
();
// loadCzml();
}
else
if
(
this
.
readyState
==
4
&&
this
.
status
==
200
)
{
// clearOld();
loadCzml
();
};
}
...
...
@@ -49,50 +56,59 @@
</script>
<div
class=
"slidecontainer"
>
<
form
action=
"/"
method=
"post"
>
<
!-- <form action="/" method="post"> --
>
<div
class=
"tooltip"
>
<span
class=
"slidetitle"
><h4>
Min Power:
</h4></span>
<span
class=
"tooltiptext"
>
Does not affect historical data.
</span>
<span
class=
"slidespan"
><input
name=
"powerValue"
type=
"range"
min=
"0"
max=
"100"
value=
"{
{
minpower
}
}"
class=
"slider"
id=
"powerRange"
></span>
<!-- <span class="slidetitle"><h4>Min Power:</h4></span> -->
<span
class=
"tooltiptext"
>
Minimum Power:
<br>
Minimun power level to record an intersection.Does not affect historical data.
</span>
<span
class=
"slidespan"
><input
name=
"powerValue"
type=
"range"
min=
"0"
max=
"50"
value=
"{
{
minpower
}
}"
class=
"slider"
id=
"powerRange"
></span>
<span
class=
"slidevalue"
id=
"power"
></span>
</div>
<div
class=
"tooltip"
>
<span
class=
"slidetitle"
><h4>
Min Confidence:
</h4></span>
<span
class=
"tooltiptext"
>
Does not affect historical data.
</span>
<!-- <span class="slidetitle"><h4>Min Confidence:</h4></span> -->
<span
class=
"tooltiptext"
>
Minimum Confidence:
<br>
Minimum confidence level to record an intersection. Does not affect historical data.
</span>
<span
class=
"slidespan"
><input
name=
"confValue"
type=
"range"
min=
"0"
max=
"100"
value=
"{
{
minconf
}
}"
class=
"slider"
id=
"confRange"
></span>
<span
class=
"slidevalue"
id=
"confidence"
></span>
</div>
<div>
<span
class=
"slidetitle"
><h4>
epsilon:
</h4></span>
<div
class=
"tooltip"
>
<!-- <span class="slidetitle"><h4>epsilon:</h4></span> -->
<span
class=
"tooltiptext"
>
Epsilon:
<br>
Maximum distance between neighboring points in a cluster. Set to 0 to disable clustering.
<br>
Disabling clustering will plot all intersections and may cause longer load times.
</span>
<span
class=
"slidespan"
><input
name=
"epsilonValue"
type=
"range"
min=
"0"
max=
"1"
step=
"0.01"
value=
"{
{
epsilon
}
}"
class=
"slider"
id=
"epsilonRange"
></span>
<span
class=
"slidevalue"
id=
"epsilon"
></span>
</div>
<div>
<span
class=
"slidetitle"
><h4>
Min Points per Cluster:
</h4></span>
<span
class=
"slidespan"
><input
name=
"minpointValue"
type=
"range"
min=
"0"
max=
"200"
step=
"5"
value=
"{
{
minpoints
}
}"
class=
"slider"
id=
"minpointRange"
></span>
<div
class=
"tooltip"
>
<span
class=
"tooltiptext"
>
Minimum points per cluster
</span>
<!-- <span class="slidetitle"><h4>Min Points per Cluster:</h4></span> -->
<span
class=
"slidespan"
><input
name=
"minpointValue"
type=
"range"
min=
"0"
max=
"300"
step=
"5"
value=
"{
{
minpoints
}
}"
class=
"slider"
id=
"minpointRange"
></span>
<span
class=
"slidevalue"
id=
"minpoints"
></span>
</div>
<div>
<span
class=
"slidetitle"
><h4>
Receiver Enable:
</h4></span>
<span
class=
"slidespan"
style=
"text-align:left; width: 80px;"
>
<!-- Rounded switch -->
<label
class=
"switch"
>
<input
id=
"rx_en"
name=
"rx_en"
{
{
rx_state
}
}
type=
"checkbox"
>
<span
class=
"switchslider round"
></span>
</label></span>
<div
class=
"tooltip"
>
<span
class=
"slidetitle"
><h4>
Plot All intersect Points:
</h4></span>
<span
class=
"slidespan"
style=
"text-align:left; width: 80px;"
>
<div
style=
"width: 300px"
>
<span>
<span
class=
"slidetitle"
><h4>
Enable Receiver:
</h4></span>
<span
class=
"slidespan"
style=
"text-align:left;width: 100px;margin: 5px;"
>
<!-- Rounded switch -->
<label
class=
"switch"
>
<input
id=
"rx_en"
name=
"rx_en"
{
{
rx_state
}
}
type=
"checkbox"
>
<span
class=
"switchslider round"
></span>
</label></span>
</span>
<span
class=
"tooltip"
>
<span
class=
"slidetitle"
><h4>
Plot All Intersect Points:
</h4></span>
<span
class=
"slidespan"
style=
"text-align:left; width: 100px;margin: 5px;"
>
<!-- Rounded switch -->
<label
class=
"switch"
>
<input
id=
"intersect_en"
name=
"intersect_en"
{
{
intersect_state
}
}
type=
"checkbox"
>
<span
class=
"switchslider round"
></span>
</label></span><span
class=
"tooltiptext"
style=
"width: 360px;"
>
This setting does not apply if clustering is turned off (epsilon = 0).
</label></span>
<span
class=
"tooltiptext"
>
This setting does not apply if clustering is turned off (epsilon = 0).
<br>
Enabling this can cause longer load times.
</span>
</
div
>
</
span
>
</div>
<!-- <div style="width:15%; text-align:right;"><input onclick="loadCzml()" value="Update" type="button" style="height:40px;"/></div> -->
<
/form
>
<
!-- </form> --
>
</div>
<script>
var
powerslider
=
document
.
getElementById
(
"powerRange"
);
...
...
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