diff --git a/vcm/config.json b/vcm/config.json index 33c5efdfb2642b75c40249fbb9370aed2cde109e..f087c0200c0e80bddb0c40f382d2050ef2e0bc7d 100644 --- a/vcm/config.json +++ b/vcm/config.json @@ -660,12 +660,12 @@ },{ "template": [ "
", - "", + "", "

Noise Sensor

", "
", "
", - "
", + "
", "Get Noise Data", "

", "

", diff --git a/vcm/css/loading.css b/vcm/css/loading.css index 89f9ce317da00db68c5cfa787cfbddc358bce503..62e9d9658bf9afae23852bd1f6080867da4654c7 100644 --- a/vcm/css/loading.css +++ b/vcm/css/loading.css @@ -7,6 +7,30 @@ -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; } + .loaderN { + border: 2px solid #f3f3f3; + border-radius: 50%; + border-top: 2px solid #3498db; + width: 12px; + height: 12px; + -webkit-animation: spin 2s linear infinite; /* Safari */ + animation: spin 2s linear infinite; + float:right; + } + .LoaderNoise { + border: 8px solid rgb(88, 88, 88); + border-radius: 50%; + border-top: 8px solid #3498db; + width: 48px; + height: 48px; + -webkit-animation: spin 2s linear infinite; /* Safari */ + animation: spin 2s linear infinite; + background-color: rgb(60, 60, 60); + color: rgb(60, 60, 60); + /* text-align:center; */ + /* margin-top: 50%; */ + margin-left: 40%; + } /* Safari */ @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } diff --git a/vcm/index.html b/vcm/index.html index 529632160bb61ee2175e3dca703078c6295d20aa..239007cd49b86fa15d5867885a75291a45d0f991 100644 --- a/vcm/index.html +++ b/vcm/index.html @@ -658,13 +658,15 @@

Historical Noise Data

+
+

-
+
@@ -723,6 +725,7 @@ + diff --git a/vcm/js/ServerorLocal.js b/vcm/js/ServerorLocal.js new file mode 100644 index 0000000000000000000000000000000000000000..c89b12d019c48f34f30ab23e5c58368d53281c85 --- /dev/null +++ b/vcm/js/ServerorLocal.js @@ -0,0 +1,50 @@ +// Server + +var navPublicT = '/partizipation/navPublicT' +var NavCARdata = '/partizipation/NavCARdata' +var ROAD_CLOSURE ="https://m4lab.hft-stuttgart.de/partizipation/ROAD_CLOSURE" +var CONSTRUCTION = "https://m4lab.hft-stuttgart.de/partizipation/CONSTRUCTION" +var TrafficFlow ="https://m4lab.hft-stuttgart.de/partizipation/TrafficFlow" +var NAVCAR = "https://m4lab.hft-stuttgart.de/partizipation/NAVCAR" +var NAVPUB = "https://m4lab.hft-stuttgart.de/partizipation/NAVPUB" +var addPointurl = "https://m4lab.hft-stuttgart.de/partizipation/addPoint" +var routecalcurl = "https://m4lab.hft-stuttgart.de/partizipation/Routecalc2" +var navpublict2url = "https://m4lab.hft-stuttgart.de/partizipation/navPublicT2" +var StartpointUrl = "https://m4lab.hft-stuttgart.de/partizipation/Startpoint" +var EndpointUrl = "https://m4lab.hft-stuttgart.de/partizipation/Endpoint" +var FLOWdataUrl = "/partizipation/FLOWdata" +var NavCARdataUrl = '/partizipation/NavCARdata' +var FLOWtestUrl = '/partizipation/FLOWtest' +var getTrafficIncidentsUrl = '/partizipation/getTrafficIncidents' +var navPointUrl = '/partizipation/navPoint' +var RoutecalcUrl = '/partizipation/Routecalc' +var navPublicTUrl = '/partizipation/navPublicT' +var NoiseRealTimeUrl = '/partizipation/NoiseRealTime' +var getNoiseHistUrl = '/partizipation/getNoiseHist' + + + +//_________________________________________/ +// Local + +// var navPublicT = '/navPublicT' +// var NavCARdata = '/NavCARdata' +// var ROAD_CLOSURE = "http://localhost:8083/ROAD_CLOSURE" +// var CONSTRUCTION = "http://localhost:8083/CONSTRUCTION" +// var TrafficFlow = "http://localhost:8083/TrafficFlow" +// var NAVCAR = "http://localhost:8083/NAVCAR" +// var NAVPUB = "http://localhost:8083/NAVPUB" +// var addPointurl = "http://localhost:8083/addPoint" +// var routecalcurl = "http://localhost:8083/Routecalc2" +// var navpublict2url = "http://localhost:8083/navPublicT2" +// var StartpointUrl = "http://localhost:8083/Startpoint" +// var EndpointUrl = "http://localhost:8083/Endpoint" +// var FLOWdataUrl = "/FLOWdata" +// var NavCARdataUrl = '/NavCARdata' +// var FLOWtestUrl = '/FLOWtest' +// var getTrafficIncidentsUrl = '/getTrafficIncidents' +// var navPointUrl = '/navPoint' +// var RoutecalcUrl = '/Routecalc' +// var navPublicTUrl = '/navPublicT' +// var NoiseRealTimeUrl = '/NoiseRealTime' +// var getNoiseHistUrl = '/getNoiseHist' \ No newline at end of file diff --git a/vcm/js/here.js b/vcm/js/here.js index a8efadf077bc8c6d316ea7562385803029b344c9..6d72e052d6b3d71c8dc365de2f650f9bb858bf6a 100644 --- a/vcm/js/here.js +++ b/vcm/js/here.js @@ -13,7 +13,7 @@ function getNAVcar(){ try { $.ajax({ type: "POST", - url: '/partizipation/NavCARdata', + url: NavCARdata, }).done(function (newdata) { convertdata(newdata); }); @@ -32,7 +32,7 @@ catch (err) { // var type = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].TRAFFIC_ITEM_DESCRIPTION[0].value; // roadclose = new vcs.vcm.layer.GeoJSON({ // name: "ROAD_CLOSURE", - // url: "http://localhost:8083/CONSTRUCTION", + // http://localhost:8083/CONSTRUCTION", // data: geojson, // projection: { // epsg: 4326 @@ -62,7 +62,7 @@ function getAccidents(type){ if (type == "ROAD_CLOSURE"){ roadclose = new vcs.vcm.layer.GeoJSON({ name: "ROAD_CLOSURE", - url: "https://m4lab.hft-stuttgart.de/partizipation/ROAD_CLOSURE", + url: ROAD_CLOSURE, data: geojson, projection: { epsg: 4326 @@ -83,7 +83,7 @@ function getAccidents(type){ } else if (type == "CONSTRUCTION"){ trafficlayer = new vcs.vcm.layer.GeoJSON({ name: "CONSTRUCTION", - url: "https://m4lab.hft-stuttgart.de/partizipation/CONSTRUCTION", + url: CONSTRUCTION, data: geojson, projection: { epsg: 4326 @@ -141,7 +141,7 @@ function getFlow(){ try { $.ajax({ type: "POST", - url: '/partizipation/FLOWdata', + url: FLOWdataUrl, }).done(function (newdata) { convertdata(newdata); }); @@ -165,7 +165,7 @@ function getNAV(){ try { $.ajax({ type: "POST", - url: '/partizipation/NavCARdata', + url: NavCARdataUrl, }).done(function (newdata) { convertdata(newdata); }); @@ -189,7 +189,7 @@ function getFlowtest(){ try { $.ajax({ type: "POST", - url: '/partizipation/FLOWtest', + url: FLOWtestUrl, }).done(function (newdata) { convertdata(newdata); }); @@ -208,7 +208,7 @@ function drawFlow(){ // url: "http://localhost:8083/FLOW", flowlayer = new vcs.vcm.layer.GeoJSON({ name: "FLOW", - url: "https://m4lab.hft-stuttgart.de/partizipation/TrafficFlow", + url: TrafficFlow, data: geojson, projection: { epsg: 4326 @@ -244,7 +244,7 @@ function drawnavcar(){ framework.removeLayerByName("NAVCAR") navcarlayer = new vcs.vcm.layer.GeoJSON({ name: "NAVCAR", - url: "https://m4lab.hft-stuttgart.de/partizipation/NAVCAR", + url: NAVCAR, data: geojson, projection: { epsg: 4326 @@ -259,7 +259,7 @@ function getTraffic() { try { $.ajax({ type: "POST", - url: '/partizipation/getTrafficIncidents', + url: getTrafficIncidentsUrl, }).done(function (newdata) { convertdata(newdata); }); @@ -286,7 +286,7 @@ function drawnavpub(){ framework.removeLayerByName("NAVPUB") navcarlayer = new vcs.vcm.layer.GeoJSON({ name: "NAVPUB", - url: "https://m4lab.hft-stuttgart.de/partizipation/NAVPUB", + url: NAVPUB, data: geojson, projection: { epsg: 4326 @@ -326,7 +326,7 @@ function setPoint(location, pointd){ // visualizing with vcs GeoJson function pointlayer = new vcs.vcm.layer.GeoJSON({ name: location + "point", - url: "https://m4lab.hft-stuttgart.de/partizipation/addPoint?slat=" + pointd.lat + "&slon=" + pointd.lon + "&sloc=" + location, + url: addPointurl + "?slat=" + pointd.lat + "&slon=" + pointd.lon + "&sloc=" + location, data: geojson, projection: { epsg: 4326 @@ -385,7 +385,7 @@ function setRouteCar(){ // visualizing with vcs GeoJson function pointlayer = new vcs.vcm.layer.GeoJSON({ name: "CarRoute", - url: "https://m4lab.hft-stuttgart.de/partizipation/Routecalc2?slat=" + datapoint.slat + "&slon=" + datapoint.slon + "&sloc=" + datapoint.sloc + "&elat=" + datapoint.elat + "&elon=" + datapoint.elon + "&eloc=" + datapoint.eloc, + url: routecalcurl + "?slat=" + datapoint.slat + "&slon=" + datapoint.slon + "&sloc=" + datapoint.sloc + "&elat=" + datapoint.elat + "&elon=" + datapoint.elon + "&eloc=" + datapoint.eloc, data: geojson, projection: { epsg: 4326 @@ -474,7 +474,7 @@ function setRoutePublic(){ // visualizing with vcs GeoJson function pointlayer = new vcs.vcm.layer.GeoJSON({ name: "PublicRoute", - url: "https://m4lab.hft-stuttgart.de/partizipation/navPublicT2?slat=" + datapoint.slat + "&slon=" + datapoint.slon + "&sloc=" + datapoint.sloc + "&elat=" + datapoint.elat + "&elon=" + datapoint.elon + "&eloc=" + datapoint.eloc, + url: navpublict2url + "?slat=" + datapoint.slat + "&slon=" + datapoint.slon + "&sloc=" + datapoint.sloc + "&elat=" + datapoint.elat + "&elon=" + datapoint.elon + "&eloc=" + datapoint.eloc, data: testingThing, projection: { epsg: 4326 diff --git a/vcm/js/navigation.js b/vcm/js/navigation.js index a8136d6c4469c1da3b534d63f5c255c5dd72a981..039995113622063d8e07b572d1bd75b7bc5a1271 100644 --- a/vcm/js/navigation.js +++ b/vcm/js/navigation.js @@ -17,7 +17,7 @@ function PostNavPoint(testing){ $.ajax({ async: true, type: "POST", - url: '/partizipation/navPoint', + url: navPointUrl, data: point }).done(function (SimSMid) { console.log(SimSMid) @@ -60,7 +60,7 @@ function showStartPoint(){ console.log("testStartpointvis") Startpointlayer = new vcs.vcm.layer.GeoJSON({ name: "Startpoint", - url: "http://localhost:8083/Startpoint", + url: StartpointUrl, data: geojson, projection: { epsg: 4326 @@ -93,7 +93,7 @@ function showEndPoint(){ // console.log("testStartpointvis") Endpointlayer = new vcs.vcm.layer.GeoJSON({ name: "EndpointNav", - url: "http://localhost:8083/Endpoint", + url: EndpointUrl, data: geojson, projection: { epsg: 4326 @@ -135,7 +135,7 @@ function showRoute(){ $.ajax({ async: true, type: "POST", - url: '/partizipation/Routecalc', + url: RoutecalcUrl, data: datapointSend }).done(function (SimSMid) { console.log(SimSMid) @@ -167,7 +167,7 @@ function showRoute(){ $.ajax({ async: true, type: "POST", - url: '/partizipation/navPublicT', + url: navPublicTUrl, data: datapointSend }).done(function (SimSMid) { console.log(SimSMid) @@ -223,7 +223,7 @@ function publictransport(){ $.ajax({ async: true, type: "get", - url: '/partizipation/navPublicT', + url: navPublicTUrl, data: datapointSend }).done(function (SimSMid) { console.log(SimSMid) diff --git a/vcm/js/noise.js b/vcm/js/noise.js index ba777c1e625ae361c7fb2d6c8446ffb9119145b8..0523ea2d78eddc099c7bafc67e1da91203658a9c 100644 --- a/vcm/js/noise.js +++ b/vcm/js/noise.js @@ -1,10 +1,21 @@ - +function SetNoiseDataWaiting(){ + var resetBtn = document.getElementById("noiseStuff"); + resetBtn.disabled = true; + resetBtn.innerHTML = '
' +} +function setNoiseWaiting(){ + document.getElementById("infobtnNoise").classList.add('loaderN'); + console.log("arrived") + document.getElementById("infobtnNoise").classList.remove('infobtn'); + // var resetBtn = document.getElementById("infobtnNoise"); + // resetBtn.disabled = true; + // resetBtn.innerHTML = '
' +} function getNoiseData() { - try { $.ajax({ type: "GET", - url: '/partizipation/NoiseRealTime', + url: NoiseRealTimeUrl, }).done(function (newdata) { convertdata(newdata); }); @@ -21,8 +32,14 @@ function getNoiseData() { document.getElementById("noise_lamax").innerHTML = flow[0].sensordatavalues[i].value; } } + var resetBtn = document.getElementById("noiseStuff"); + resetBtn.disabled = true; + resetBtn.innerHTML = "Get Noise Data" } + + return flow + } catch (err) { console.log('loading Gas Values from DB failed!'); @@ -103,13 +120,15 @@ function noisesens(status){ let histNoise function HistNoiseData() { + + try { $.ajax({ - async: false, + async: true, type: "POST", - url: '/partizipation/getNoiseHist', + url: getNoiseHistUrl, data: "", }).done(function (histwinddata) { convertdata(histwinddata); @@ -266,6 +285,9 @@ function showgraphNoise(){ document.getElementById("chartNoise").innerHTML = ""; var chart = new ApexCharts(document.querySelector("#chartNoise"), options); +document.getElementById("infobtnNoise").classList.add('infobtn'); +document.getElementById("infobtnNoise").classList.remove('loaderN'); +console.log("end") chart.render(); } diff --git a/vcm/templates/custom.js b/vcm/templates/custom.js index 6f442fde9930be3966d00ab65e476d9a39683518..2423e08c427705672689b546b538fb79e32315f7 100644 --- a/vcm/templates/custom.js +++ b/vcm/templates/custom.js @@ -258,8 +258,8 @@ function NoiseText() { document.getElementById("Navigation").style.display = "none"; document.getElementById("NordbahnhofInfo").style.display = "none"; document.getElementById("NoiseInfo").style.display = "block"; - showTour(); + HistNoiseData(); }