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
59c5ae39
Commit
59c5ae39
authored
Nov 27, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up code
parent
48f52161
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
32 deletions
+31
-32
df-aggregator.py
df-aggregator.py
+1
-1
receiver_configurator.js
static/receiver_configurator.js
+19
-23
cesium.tpl
views/cesium.tpl
+11
-8
No files found.
df-aggregator.py
View file @
59c5ae39
...
@@ -7,7 +7,7 @@ import time
...
@@ -7,7 +7,7 @@ import time
import
sqlite3
import
sqlite3
import
threading
import
threading
import
signal
import
signal
import
hashlib
#
import hashlib
from
colorsys
import
hsv_to_rgb
from
colorsys
import
hsv_to_rgb
from
optparse
import
OptionParser
from
optparse
import
OptionParser
from
os
import
system
,
name
,
kill
,
getpid
from
os
import
system
,
name
,
kill
,
getpid
...
...
static/receiver_configurator.js
View file @
59c5ae39
...
@@ -4,7 +4,10 @@
...
@@ -4,7 +4,10 @@
function
updateRx
(
callBack
,
id
)
{
function
updateRx
(
callBack
,
id
)
{
fetch
(
"/rx_params"
)
fetch
(
"/rx_params"
)
.
then
(
data
=>
{
return
data
.
json
()
})
.
then
(
data
=>
{
return
data
.
json
()
})
.
then
(
res
=>
{
callBack
(
res
,
id
)
})
.
then
(
res
=>
{
callBack
(
res
,
id
);
// console.log("updateRx Complete");
// console.log(res);
})
}
}
// ******************************************************
// ******************************************************
...
@@ -89,12 +92,10 @@ function editReceivers(rx_json, id) {
...
@@ -89,12 +92,10 @@ function editReceivers(rx_json, id) {
};
};
clearOld
();
clearOld
();
fetch
(
"/rx_params/"
+
id
,
otherParams
)
fetch
(
"/rx_params/"
+
id
,
otherParams
)
.
then
(
data
=>
{
return
data
.
json
()
})
.
then
(
res
=>
{
.
then
(
res
=>
{
updateRx
(
showReceivers
,
id
)
})
updateRx
(
showReceivers
,
id
);
.
then
(
res
=>
{
loadCzml
()
})
loadCzml
();
//.catch(error=>{console.log(error)})
})
// updateRx(showReceivers, id);
// loadCzml();
}
}
}
}
...
@@ -113,12 +114,10 @@ function makeNewRx(url) {
...
@@ -113,12 +114,10 @@ function makeNewRx(url) {
};
};
clearOld
();
clearOld
();
fetch
(
"/rx_params/new"
,
otherParams
)
fetch
(
"/rx_params/new"
,
otherParams
)
.
then
(
data
=>
{
return
data
.
json
()
})
.
then
(
res
=>
{
.
then
(
res
=>
{
updateRx
(
createReceivers
,
true
)
})
updateRx
(
createReceivers
,
true
);
.
then
(
res
=>
{
loadCzml
()
})
loadCzml
();
//.catch(error=>{console.log(error)})
})
//.then(updateRx(createReceivers, true));
// loadCzml();
}
}
// *****************************************
// *****************************************
...
@@ -144,16 +143,14 @@ function deleteReceiver(uid) {
...
@@ -144,16 +143,14 @@ function deleteReceiver(uid) {
};
};
clearOld
();
clearOld
();
fetch
(
"/rx_params/del"
,
otherParams
)
fetch
(
"/rx_params/del"
,
otherParams
)
.
then
(
data
=>
{
return
data
.
json
()
})
.
then
(
res
=>
{
.
then
(
res
=>
{
removerx
(
uid
)
})
removerx
(
uid
);
.
then
(
res
=>
{
loadCzml
()
})
loadCzml
();
//.catch(error=>{console.log(error)})
})
//.then(updateRx(createReceivers, true));
// loadCzml();
}
}
// *******************************************
// *******************************************
// * Fills in Rx UI cards with Rx info
// * Fills in Rx UI cards with Rx info
// *******************************************
// *******************************************
function
showReceivers
(
rx_json
,
id
)
{
function
showReceivers
(
rx_json
,
id
)
{
const
receivers
=
rx_json
[
'receivers'
];
const
receivers
=
rx_json
[
'receivers'
];
...
@@ -206,7 +203,7 @@ function createReceivers(rx_json, id) {
...
@@ -206,7 +203,7 @@ function createReceivers(rx_json, id) {
}
else
{
}
else
{
receivers
=
rx_json
[
'receivers'
];
receivers
=
rx_json
[
'receivers'
];
}
}
console
.
log
(
receivers
);
//
console.log(receivers);
for
(
let
i
=
0
;
i
<
Object
.
keys
(
receivers
).
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
Object
.
keys
(
receivers
).
length
;
i
++
)
{
const
rxcard
=
document
.
createElement
(
'div'
);
const
rxcard
=
document
.
createElement
(
'div'
);
...
@@ -283,4 +280,4 @@ function refreshRx(rx_json, id) {
...
@@ -283,4 +280,4 @@ function refreshRx(rx_json, id) {
// ****************************************************
// ****************************************************
function
loadRx
(
action
)
{
function
loadRx
(
action
)
{
updateRx
(
action
,
null
);
updateRx
(
action
,
null
);
}
}
\ No newline at end of file
views/cesium.tpl
View file @
59c5ae39
...
@@ -31,24 +31,27 @@
...
@@ -31,24 +31,27 @@
viewer
.
zoomTo
(
loadCzml
());
viewer
.
zoomTo
(
loadCzml
());
function
updateParams
(
parameter
)
{
function
updateParams
(
parameter
)
{
var
xmlHttp
=
new
XMLHttpRequest
();
fetch
(
"/update?"
+
parameter
)
xmlHttp
.
open
(
"GET"
,
"/update?"
+
parameter
,
true
);
// false for synchronous request
.
then
(
function
(
response
)
{
xmlHttp
.
send
(
null
);
if
(
response
.
status
==
200
)
{
xmlHttp
.
onload
=
function
()
{
loadRx
(
refreshRx
);
loadRx
(
refreshRx
);
clearOld
();
clearOld
();
loadCzml
();
loadCzml
();
console
.
log
(
response
);
}
}
})
}
}
function
loadCzml
()
{
function
loadCzml
()
{
var
dataSourcePromise
=
Cesium
.
CzmlDataSource
.
load
(
'/static/output.czml'
);
var
dataSourcePromise
=
Cesium
.
CzmlDataSource
.
load
(
'/static/output.czml'
);
viewer
.
dataSources
.
add
(
dataSourcePromise
);
viewer
.
dataSources
.
add
(
dataSourcePromise
);
console
.
log
(
"Loaded CZML"
);
return
dataSourcePromise
;
return
dataSourcePromise
;
}
}
function
clearOld
()
{
function
clearOld
()
{
viewer
.
dataSources
.
removeAll
(
true
);
viewer
.
dataSources
.
removeAll
(
true
);
console
.
log
(
"Cleared old"
);
}
}
// Add Cesium OSM Buildings, a global 3D buildings layer.
// Add Cesium OSM Buildings, a global 3D buildings layer.
...
...
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