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
70b10868
Commit
70b10868
authored
Dec 19, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separated Refresh of TX and RX CZML Data
parent
684d30e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
32 deletions
+30
-32
interest_areas.js
static/interest_areas.js
+8
-10
receiver_configurator.js
static/receiver_configurator.js
+12
-12
cesium.tpl
views/cesium.tpl
+10
-10
No files found.
static/interest_areas.js
View file @
70b10868
...
@@ -5,8 +5,6 @@ function updateAoi(callBack, id) {
...
@@ -5,8 +5,6 @@ function updateAoi(callBack, id) {
fetch
(
"/interest_areas"
)
fetch
(
"/interest_areas"
)
.
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
);
})
})
}
}
...
@@ -28,11 +26,11 @@ function makeNewAoi(aoi_type, latitude, longitude, radius) {
...
@@ -28,11 +26,11 @@ function makeNewAoi(aoi_type, latitude, longitude, radius) {
body
:
JSON
.
stringify
(
new_aoi
),
body
:
JSON
.
stringify
(
new_aoi
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/interest_areas/new"
,
otherParams
)
fetch
(
"/interest_areas/new"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
updateAoi
(
createAois
,
true
);
updateAoi
(
createAois
,
true
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
@@ -49,12 +47,12 @@ function deleteAoi(uid) {
...
@@ -49,12 +47,12 @@ function deleteAoi(uid) {
body
:
JSON
.
stringify
(
del_aoi
),
body
:
JSON
.
stringify
(
del_aoi
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/interest_areas/del"
,
otherParams
)
fetch
(
"/interest_areas/del"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
// removerx(uid);
// removerx(uid);
loadAoi
(
createAois
);
loadAoi
(
createAois
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
@@ -71,12 +69,12 @@ function purgeAoi(uid) {
...
@@ -71,12 +69,12 @@ function purgeAoi(uid) {
body
:
JSON
.
stringify
(
del_aoi
),
body
:
JSON
.
stringify
(
del_aoi
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/interest_areas/purge"
,
otherParams
)
fetch
(
"/interest_areas/purge"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
// removerx(uid);
// removerx(uid);
loadAoi
(
createAois
);
loadAoi
(
createAois
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
@@ -84,12 +82,12 @@ function purgeAoi(uid) {
...
@@ -84,12 +82,12 @@ function purgeAoi(uid) {
// * Runs all AOI rules on the backend and Reloads Map
// * Runs all AOI rules on the backend and Reloads Map
// *******************************************
// *******************************************
function
runAoi
(
uid
)
{
function
runAoi
(
uid
)
{
clearOld
();
//
clearOld();
fetch
(
"/run_all_aoi_rules"
)
fetch
(
"/run_all_aoi_rules"
)
.
then
(
res
=>
{
.
then
(
res
=>
{
// removerx(uid);
// removerx(uid);
loadAoi
(
createAois
);
loadAoi
(
createAois
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
...
static/receiver_configurator.js
View file @
70b10868
// Update Map every n milliseconds
// Update Map every n milliseconds
var
refreshrate
=
600
000
;
var
refreshrate
=
5
000
;
// var autoRefresh = setInterval(function () { updateParams
(); }, refreshrate);
var
autoRefresh
=
setInterval
(
function
()
{
reloadRX
();
},
refreshrate
);
// *************************************************
// *************************************************
// * Gets Rx data from backend
// * Gets Rx data from backend
...
@@ -64,7 +64,7 @@ function editReceivers(rx_json, id) {
...
@@ -64,7 +64,7 @@ function editReceivers(rx_json, id) {
var
isSingleCheck
;
var
isSingleCheck
;
var
editButton
=
document
.
getElementById
(
id
+
"-edit"
);
var
editButton
=
document
.
getElementById
(
id
+
"-edit"
);
if
(
editButton
.
checked
)
{
if
(
editButton
.
checked
)
{
//
clearInterval(autoRefresh);
clearInterval
(
autoRefresh
);
let
isMobile
=
""
;
let
isMobile
=
""
;
if
(
receivers
[
id
].
mobile
)
isMobile
=
"checked"
;
if
(
receivers
[
id
].
mobile
)
isMobile
=
"checked"
;
let
isInverted
=
""
;
let
isInverted
=
""
;
...
@@ -106,7 +106,7 @@ function editReceivers(rx_json, id) {
...
@@ -106,7 +106,7 @@ function editReceivers(rx_json, id) {
// }
// }
// }
// }
}
else
{
}
else
{
// autoRefresh = setInterval(function () { updateParams
(); }, refreshrate);
autoRefresh
=
setInterval
(
function
()
{
reloadRX
();
},
refreshrate
);
isMobileCheck
=
document
.
getElementById
(
"mobilerx_toggle_"
+
id
);
isMobileCheck
=
document
.
getElementById
(
"mobilerx_toggle_"
+
id
);
if
(
isMobileCheck
.
checked
)
{
if
(
isMobileCheck
.
checked
)
{
receivers
[
id
].
mobile
=
true
;
receivers
[
id
].
mobile
=
true
;
...
@@ -139,11 +139,11 @@ function editReceivers(rx_json, id) {
...
@@ -139,11 +139,11 @@ function editReceivers(rx_json, id) {
body
:
JSON
.
stringify
(
receivers
[
id
]),
body
:
JSON
.
stringify
(
receivers
[
id
]),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/rx_params/"
+
id
,
otherParams
)
fetch
(
"/rx_params/"
+
id
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
updateRx
(
showReceivers
,
id
);
updateRx
(
showReceivers
,
id
);
loadAllCzml
();
reloadRX
();
})
})
}
}
}
}
...
@@ -161,11 +161,11 @@ function makeNewRx(url) {
...
@@ -161,11 +161,11 @@ function makeNewRx(url) {
body
:
JSON
.
stringify
(
new_rx
),
body
:
JSON
.
stringify
(
new_rx
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/rx_params/new"
,
otherParams
)
fetch
(
"/rx_params/new"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
updateRx
(
createReceivers
,
true
);
updateRx
(
createReceivers
,
true
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
@@ -197,12 +197,12 @@ function deleteReceiver(uid) {
...
@@ -197,12 +197,12 @@ function deleteReceiver(uid) {
body
:
JSON
.
stringify
(
del_rx
),
body
:
JSON
.
stringify
(
del_rx
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/rx_params/del"
,
otherParams
)
fetch
(
"/rx_params/del"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
// removerx(uid);
// removerx(uid);
loadRx
(
createReceivers
);
loadRx
(
createReceivers
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
@@ -218,11 +218,11 @@ function activateReceiver(uid, state) {
...
@@ -218,11 +218,11 @@ function activateReceiver(uid, state) {
body
:
JSON
.
stringify
(
activate_rx
),
body
:
JSON
.
stringify
(
activate_rx
),
method
:
"PUT"
method
:
"PUT"
};
};
clearOld
();
//
clearOld();
fetch
(
"/rx_params/activate"
,
otherParams
)
fetch
(
"/rx_params/activate"
,
otherParams
)
.
then
(
res
=>
{
.
then
(
res
=>
{
loadRx
(
refreshRx
);
loadRx
(
refreshRx
);
loadAllCzml
();
reloadRX
();
})
})
}
}
...
...
views/cesium.tpl
View file @
70b10868
...
@@ -24,8 +24,9 @@
...
@@ -24,8 +24,9 @@
// var rxRefreshRate = 5000;
// var rxRefreshRate = 5000;
// var autoRxRefresh = setInterval(function () { reloadRX(); }, rxRefreshRate);
// var autoRxRefresh = setInterval(function () { reloadRX(); }, rxRefreshRate);
var
transmittersDataSource
;
var
transmittersDataSource
=
new
Cesium
.
CzmlDataSource
;
var
receiversDataSource
;
var
receiversDataSource
=
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 hpr = new Cesium.HeadingPitchRange(0, 40, 0)
...
@@ -190,26 +191,23 @@
...
@@ -190,26 +191,23 @@
}
}
function updateParams(parameter) {
function updateParams(parameter) {
clearOld();
fetch("/update?"+parameter)
fetch("/update?"+parameter)
.then(function(response) {
.then(function(response) {
if (response.status == 200) {
loadRx(refreshRx);
loadRx(refreshRx);
clearOld();
loadAllCzml();
loadAllCzml();
// console.log(response);
}
})
})
}
}
function loadTxCzml() {
function loadTxCzml() {
transmittersDataSource
= Cesium.CzmlDataSource
.load('
/
output
.
czml
');
transmittersDataSource.load('
/
output
.
czml
');
viewer.dataSources.add(transmittersDataSource);
viewer.dataSources.add(transmittersDataSource);
// console.log("Loaded CZML");
// console.log("Loaded CZML");
return transmittersDataSource;
return transmittersDataSource;
}
}
function loadRxCzml() {
function loadRxCzml() {
receiversDataSource
= Cesium.CzmlDataSource
.load('
/
receivers
.
czml
');
receiversDataSource.load('
/
receivers
.
czml
');
viewer.dataSources.add(receiversDataSource);
viewer.dataSources.add(receiversDataSource);
// console.log("Loaded CZML");
// console.log("Loaded CZML");
return receiversDataSource;
return receiversDataSource;
...
@@ -226,8 +224,10 @@
...
@@ -226,8 +224,10 @@
// console.log("Cleared old");
// console.log("Cleared old");
}
}
// Add Cesium OSM Buildings, a global 3D buildings layer.
function reloadRX() {
// const buildingTileset = viewer.scene.primitives.add(Cesium.createOsmBuildings());
viewer.dataSources.remove(receiversDataSource, true);
loadRxCzml();
}
</script>
</script>
<div
id=
"cardsmenu"
>
<div
id=
"cardsmenu"
>
...
...
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