|
|
@ -148,22 +148,52 @@ function updateGraphs(stats) {
|
|
|
|
console.log(stats);
|
|
|
|
console.log(stats);
|
|
|
|
|
|
|
|
|
|
|
|
var temperatureData = stats['temperatureData'];
|
|
|
|
var temperatureData = stats['temperatureData'];
|
|
|
|
|
|
|
|
if (typeof temperatureData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-temperatureData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Temperature</h2><hr><div id='canvas-wrapper1'></div></div><hr></div>");
|
|
|
|
updateTemperatureGraph(convertStatsToGraphData(temperatureData));
|
|
|
|
updateTemperatureGraph(convertStatsToGraphData(temperatureData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-temperatureData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var lightData = stats['lightData'];
|
|
|
|
var lightData = stats['lightData'];
|
|
|
|
|
|
|
|
if (typeof lightData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-lightData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Light</h2><hr><div id='canvas-wrapper2'></div></div><hr></div>");
|
|
|
|
updateLightGraph(convertStatsToGraphData(lightData));
|
|
|
|
updateLightGraph(convertStatsToGraphData(lightData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-lightData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var motionData = stats['motionData'];
|
|
|
|
var motionData = stats['motionData'];
|
|
|
|
|
|
|
|
if (typeof motionData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-motionData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Motion</h2><hr><div id='canvas-wrapper3'></div></div><hr></div>");
|
|
|
|
updateMotionGraph(convertStatsToGraphData(motionData));
|
|
|
|
updateMotionGraph(convertStatsToGraphData(motionData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-motionData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sonarData = stats['sonarData'];
|
|
|
|
var sonarData = stats['sonarData'];
|
|
|
|
|
|
|
|
if (typeof sonarData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-sonarData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Sonar</h2><hr><div id='canvas-wrapper4'></div></div><hr></div>");
|
|
|
|
updateSonarGraph(convertStatsToGraphData(sonarData));
|
|
|
|
updateSonarGraph(convertStatsToGraphData(sonarData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-sonarData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var fanData = stats['fanData'];
|
|
|
|
var fanData = stats['fanData'];
|
|
|
|
|
|
|
|
if (typeof fanData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-fanData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Fan Status</h2><hr><div id='canvas-wrapper5'></div></div><hr></div>");
|
|
|
|
updateFanGraph(convertStateStatsToGraphData(fanData));
|
|
|
|
updateFanGraph(convertStateStatsToGraphData(fanData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-fanData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var bulbData = stats['bulbData'];
|
|
|
|
var bulbData = stats['bulbData'];
|
|
|
|
|
|
|
|
if (typeof bulbData != 'undefined'){
|
|
|
|
|
|
|
|
$('#div-bulbData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Bulb Status</h2><hr><div id='canvas-wrapper6'></div></div><hr></div>");
|
|
|
|
updateBulbGraph(convertStateStatsToGraphData(bulbData));
|
|
|
|
updateBulbGraph(convertStateStatsToGraphData(bulbData));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$('#div-bulbData').html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
scaleGraphs();
|
|
|
|
scaleGraphs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|