Commit 23cc6b81 authored by Patrick's avatar Patrick
Browse files

update waiting

parent 80241bd6
...@@ -660,12 +660,12 @@ ...@@ -660,12 +660,12 @@
},{ },{
"template": [ "template": [
"<div class='balloon' style='width: 200px; background-color: #3C3C3C; color: #FFFFFF;' id='myBalloon'>", "<div class='balloon' style='width: 200px; background-color: #3C3C3C; color: #FFFFFF;' id='myBalloon'>",
"<button class='infobtn' onclick='NoiseText()'></button>", "<button class='infobtn' id='infobtnNoise' onclick='setNoiseWaiting();NoiseText();'></button>",
" <h1 class='balloon-title' style='color: #FFFFFF;'>Noise Sensor</h1>", " <h1 class='balloon-title' style='color: #FFFFFF;'>Noise Sensor</h1>",
" <div class='balloon-content' style='margin-right: 0px;'", " <div class='balloon-content' style='margin-right: 0px;'",
" </div>", " </div>",
"<div class='box-3'>", "<div class='box-3'>",
"<div class='btn btn-three' onclick='getNoiseData()'>", "<div class='btn btn-three' id='noiseStuff' onclick='getNoiseData();SetNoiseDataWaiting()'>",
"<span>Get Noise Data</span>", "<span>Get Noise Data</span>",
"</div><br>", "</div><br>",
"<br></div><br>", "<br></div><br>",
......
...@@ -7,6 +7,30 @@ ...@@ -7,6 +7,30 @@
-webkit-animation: spin 2s linear infinite; /* Safari */ -webkit-animation: spin 2s linear infinite; /* Safari */
animation: spin 2s linear infinite; 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 */ /* Safari */
@-webkit-keyframes spin { @-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); } 0% { -webkit-transform: rotate(0deg); }
......
...@@ -658,13 +658,15 @@ ...@@ -658,13 +658,15 @@
<!-- <h1 class="sticky" id="headNoise">Lärmdaten</h1> <!-- <h1 class="sticky" id="headNoise">Lärmdaten</h1>
<br> --> <br> -->
<h2>Historical Noise Data</h2> <h2>Historical Noise Data</h2>
<br>
<div id="loadingHistNoise"></div>
<!-- <p>The specific space heating demand wurde mit SimStadt simuliert. Die Werte sind in [kWh/m²·a] angegeben.</p><br> <!-- <p>The specific space heating demand wurde mit SimStadt simuliert. Die Werte sind in [kWh/m²·a] angegeben.</p><br>
<button onclick="HistNoiseData()">GetData</button> <button onclick="HistNoiseData()">GetData</button>
<button onclick="showgraphNoise()">GetData</button> --> <button onclick="showgraphNoise()">GetData</button> -->
<div id="unconstrained"></div><br> <div id="unconstrained"></div><br>
<span class="example-val" id="unconstrained-values"></span> <span class="example-val" id="unconstrained-values"></span>
<div style='width:100%;margin-top:200px;' id="chartNoise"></div> <div style='width:100%;margin-top:10px;' id="chartNoise"></div>
<!-- <div id="slider-color"></div> --> <!-- <div id="slider-color"></div> -->
</div> </div>
<!-- ======================================================================================================================================================================== --> <!-- ======================================================================================================================================================================== -->
...@@ -723,6 +725,7 @@ ...@@ -723,6 +725,7 @@
<script src="templates/slider.js"></script> <script src="templates/slider.js"></script>
<script src="templates/UserBalloon.js"></script> <script src="templates/UserBalloon.js"></script>
<script src="js/navigation.js"></script> <script src="js/navigation.js"></script>
<script src="js/ServerorLocal.js"></script>
<script src="js/noise.js"></script> <script src="js/noise.js"></script>
<link href="templates/sliders.css" rel="stylesheet"> <link href="templates/sliders.css" rel="stylesheet">
<link rel="stylesheet" href="css/menu.css"> <link rel="stylesheet" href="css/menu.css">
......
// 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
...@@ -13,7 +13,7 @@ function getNAVcar(){ ...@@ -13,7 +13,7 @@ function getNAVcar(){
try { try {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/partizipation/NavCARdata', url: NavCARdata,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -32,7 +32,7 @@ catch (err) { ...@@ -32,7 +32,7 @@ catch (err) {
// var type = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].TRAFFIC_ITEM_DESCRIPTION[0].value; // var type = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].TRAFFIC_ITEM_DESCRIPTION[0].value;
// roadclose = new vcs.vcm.layer.GeoJSON({ // roadclose = new vcs.vcm.layer.GeoJSON({
// name: "ROAD_CLOSURE", // name: "ROAD_CLOSURE",
// url: "http://localhost:8083/CONSTRUCTION", // http://localhost:8083/CONSTRUCTION",
// data: geojson, // data: geojson,
// projection: { // projection: {
// epsg: 4326 // epsg: 4326
...@@ -62,7 +62,7 @@ function getAccidents(type){ ...@@ -62,7 +62,7 @@ function getAccidents(type){
if (type == "ROAD_CLOSURE"){ if (type == "ROAD_CLOSURE"){
roadclose = new vcs.vcm.layer.GeoJSON({ roadclose = new vcs.vcm.layer.GeoJSON({
name: "ROAD_CLOSURE", name: "ROAD_CLOSURE",
url: "https://m4lab.hft-stuttgart.de/partizipation/ROAD_CLOSURE", url: ROAD_CLOSURE,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -83,7 +83,7 @@ function getAccidents(type){ ...@@ -83,7 +83,7 @@ function getAccidents(type){
} else if (type == "CONSTRUCTION"){ } else if (type == "CONSTRUCTION"){
trafficlayer = new vcs.vcm.layer.GeoJSON({ trafficlayer = new vcs.vcm.layer.GeoJSON({
name: "CONSTRUCTION", name: "CONSTRUCTION",
url: "https://m4lab.hft-stuttgart.de/partizipation/CONSTRUCTION", url: CONSTRUCTION,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -141,7 +141,7 @@ function getFlow(){ ...@@ -141,7 +141,7 @@ function getFlow(){
try { try {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/partizipation/FLOWdata', url: FLOWdataUrl,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -165,7 +165,7 @@ function getNAV(){ ...@@ -165,7 +165,7 @@ function getNAV(){
try { try {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/partizipation/NavCARdata', url: NavCARdataUrl,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -189,7 +189,7 @@ function getFlowtest(){ ...@@ -189,7 +189,7 @@ function getFlowtest(){
try { try {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/partizipation/FLOWtest', url: FLOWtestUrl,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -208,7 +208,7 @@ function drawFlow(){ ...@@ -208,7 +208,7 @@ function drawFlow(){
// url: "http://localhost:8083/FLOW", // url: "http://localhost:8083/FLOW",
flowlayer = new vcs.vcm.layer.GeoJSON({ flowlayer = new vcs.vcm.layer.GeoJSON({
name: "FLOW", name: "FLOW",
url: "https://m4lab.hft-stuttgart.de/partizipation/TrafficFlow", url: TrafficFlow,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -244,7 +244,7 @@ function drawnavcar(){ ...@@ -244,7 +244,7 @@ function drawnavcar(){
framework.removeLayerByName("NAVCAR") framework.removeLayerByName("NAVCAR")
navcarlayer = new vcs.vcm.layer.GeoJSON({ navcarlayer = new vcs.vcm.layer.GeoJSON({
name: "NAVCAR", name: "NAVCAR",
url: "https://m4lab.hft-stuttgart.de/partizipation/NAVCAR", url: NAVCAR,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -259,7 +259,7 @@ function getTraffic() { ...@@ -259,7 +259,7 @@ function getTraffic() {
try { try {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/partizipation/getTrafficIncidents', url: getTrafficIncidentsUrl,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -286,7 +286,7 @@ function drawnavpub(){ ...@@ -286,7 +286,7 @@ function drawnavpub(){
framework.removeLayerByName("NAVPUB") framework.removeLayerByName("NAVPUB")
navcarlayer = new vcs.vcm.layer.GeoJSON({ navcarlayer = new vcs.vcm.layer.GeoJSON({
name: "NAVPUB", name: "NAVPUB",
url: "https://m4lab.hft-stuttgart.de/partizipation/NAVPUB", url: NAVPUB,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -326,7 +326,7 @@ function setPoint(location, pointd){ ...@@ -326,7 +326,7 @@ function setPoint(location, pointd){
// visualizing with vcs GeoJson function // visualizing with vcs GeoJson function
pointlayer = new vcs.vcm.layer.GeoJSON({ pointlayer = new vcs.vcm.layer.GeoJSON({
name: location + "point", 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, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -385,7 +385,7 @@ function setRouteCar(){ ...@@ -385,7 +385,7 @@ function setRouteCar(){
// visualizing with vcs GeoJson function // visualizing with vcs GeoJson function
pointlayer = new vcs.vcm.layer.GeoJSON({ pointlayer = new vcs.vcm.layer.GeoJSON({
name: "CarRoute", 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, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -474,7 +474,7 @@ function setRoutePublic(){ ...@@ -474,7 +474,7 @@ function setRoutePublic(){
// visualizing with vcs GeoJson function // visualizing with vcs GeoJson function
pointlayer = new vcs.vcm.layer.GeoJSON({ pointlayer = new vcs.vcm.layer.GeoJSON({
name: "PublicRoute", 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, data: testingThing,
projection: { projection: {
epsg: 4326 epsg: 4326
......
...@@ -17,7 +17,7 @@ function PostNavPoint(testing){ ...@@ -17,7 +17,7 @@ function PostNavPoint(testing){
$.ajax({ $.ajax({
async: true, async: true,
type: "POST", type: "POST",
url: '/partizipation/navPoint', url: navPointUrl,
data: point data: point
}).done(function (SimSMid) { }).done(function (SimSMid) {
console.log(SimSMid) console.log(SimSMid)
...@@ -60,7 +60,7 @@ function showStartPoint(){ ...@@ -60,7 +60,7 @@ function showStartPoint(){
console.log("testStartpointvis") console.log("testStartpointvis")
Startpointlayer = new vcs.vcm.layer.GeoJSON({ Startpointlayer = new vcs.vcm.layer.GeoJSON({
name: "Startpoint", name: "Startpoint",
url: "http://localhost:8083/Startpoint", url: StartpointUrl,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -93,7 +93,7 @@ function showEndPoint(){ ...@@ -93,7 +93,7 @@ function showEndPoint(){
// console.log("testStartpointvis") // console.log("testStartpointvis")
Endpointlayer = new vcs.vcm.layer.GeoJSON({ Endpointlayer = new vcs.vcm.layer.GeoJSON({
name: "EndpointNav", name: "EndpointNav",
url: "http://localhost:8083/Endpoint", url: EndpointUrl,
data: geojson, data: geojson,
projection: { projection: {
epsg: 4326 epsg: 4326
...@@ -135,7 +135,7 @@ function showRoute(){ ...@@ -135,7 +135,7 @@ function showRoute(){
$.ajax({ $.ajax({
async: true, async: true,
type: "POST", type: "POST",
url: '/partizipation/Routecalc', url: RoutecalcUrl,
data: datapointSend data: datapointSend
}).done(function (SimSMid) { }).done(function (SimSMid) {
console.log(SimSMid) console.log(SimSMid)
...@@ -167,7 +167,7 @@ function showRoute(){ ...@@ -167,7 +167,7 @@ function showRoute(){
$.ajax({ $.ajax({
async: true, async: true,
type: "POST", type: "POST",
url: '/partizipation/navPublicT', url: navPublicTUrl,
data: datapointSend data: datapointSend
}).done(function (SimSMid) { }).done(function (SimSMid) {
console.log(SimSMid) console.log(SimSMid)
...@@ -223,7 +223,7 @@ function publictransport(){ ...@@ -223,7 +223,7 @@ function publictransport(){
$.ajax({ $.ajax({
async: true, async: true,
type: "get", type: "get",
url: '/partizipation/navPublicT', url: navPublicTUrl,
data: datapointSend data: datapointSend
}).done(function (SimSMid) { }).done(function (SimSMid) {
console.log(SimSMid) console.log(SimSMid)
......
function SetNoiseDataWaiting(){
var resetBtn = document.getElementById("noiseStuff");
resetBtn.disabled = true;
resetBtn.innerHTML = '<div id="loaderCar" class="LoaderNoise"></div>'
}
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 = '<div id="loaderCartest" class="loaderN"></div>'
}
function getNoiseData() { function getNoiseData() {
try { try {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/partizipation/NoiseRealTime', url: NoiseRealTimeUrl,
}).done(function (newdata) { }).done(function (newdata) {
convertdata(newdata); convertdata(newdata);
}); });
...@@ -21,8 +32,14 @@ function getNoiseData() { ...@@ -21,8 +32,14 @@ function getNoiseData() {
document.getElementById("noise_lamax").innerHTML = flow[0].sensordatavalues[i].value; document.getElementById("noise_lamax").innerHTML = flow[0].sensordatavalues[i].value;
} }
} }
var resetBtn = document.getElementById("noiseStuff");
resetBtn.disabled = true;
resetBtn.innerHTML = "<span>Get Noise Data</span>"
} }
return flow return flow
} }
catch (err) { catch (err) {
console.log('loading Gas Values from DB failed!'); console.log('loading Gas Values from DB failed!');
...@@ -103,13 +120,15 @@ function noisesens(status){ ...@@ -103,13 +120,15 @@ function noisesens(status){
let histNoise let histNoise
function HistNoiseData() { function HistNoiseData() {
try { try {
$.ajax({ $.ajax({
async: false, async: true,
type: "POST", type: "POST",
url: '/partizipation/getNoiseHist', url: getNoiseHistUrl,
data: "", data: "",
}).done(function (histwinddata) { }).done(function (histwinddata) {
convertdata(histwinddata); convertdata(histwinddata);
...@@ -266,6 +285,9 @@ function showgraphNoise(){ ...@@ -266,6 +285,9 @@ function showgraphNoise(){
document.getElementById("chartNoise").innerHTML = ""; document.getElementById("chartNoise").innerHTML = "";
var chart = new ApexCharts(document.querySelector("#chartNoise"), options); 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(); chart.render();
} }
......
...@@ -258,8 +258,8 @@ function NoiseText() { ...@@ -258,8 +258,8 @@ function NoiseText() {
document.getElementById("Navigation").style.display = "none"; document.getElementById("Navigation").style.display = "none";
document.getElementById("NordbahnhofInfo").style.display = "none"; document.getElementById("NordbahnhofInfo").style.display = "none";
document.getElementById("NoiseInfo").style.display = "block"; document.getElementById("NoiseInfo").style.display = "block";
showTour(); showTour();
HistNoiseData(); HistNoiseData();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment