Added warning label when 7x00 squawk is shown.

"Please don't call authorities"-warning label is show on map if any special squawk is show.

	modified:   public_html/gmap.html
	modified:   public_html/script.js
	modified:   public_html/style.css
This commit is contained in:
terribl 2013-06-02 16:51:38 +03:00
parent 92d665e0da
commit e91b0a6be1
3 changed files with 29 additions and 4 deletions

View file

@ -55,5 +55,10 @@
<div id="plane_extension"></div> <div id="plane_extension"></div>
</div> </div>
</div> </div>
<div id="SpecialSquawkWarning">
<b>Squak 7x00 is reported and shown.</b><br>
This is most likely an error in reciving or decoding.<br>
Please do not call the local authorities, they already know about it if it is valid squak.
</div>
</body> </body>
</html> </html>

View file

@ -5,6 +5,7 @@ var PlanesOnMap = 0;
var PlanesOnTable = 0; var PlanesOnTable = 0;
var PlanesToReap = 0; var PlanesToReap = 0;
var SelectedPlane = null; var SelectedPlane = null;
var SpecialSqawk = false;
var iSortCol=-1; var iSortCol=-1;
var bSortASC=true; var bSortASC=true;
@ -19,6 +20,7 @@ ZoomLvl = Number(localStorage['ZoomLvl']) || CONST_ZOOMLVL;
function fetchData() { function fetchData() {
$.getJSON('/dump1090/data.json', function(data) { $.getJSON('/dump1090/data.json', function(data) {
PlanesOnMap = 0 PlanesOnMap = 0
SpecialSquawk = false;
// Loop through all the planes in the data packet // Loop through all the planes in the data packet
for (var j=0; j < data.length; j++) { for (var j=0; j < data.length; j++) {
@ -29,6 +31,16 @@ function fetchData() {
} else { } else {
var plane = jQuery.extend(true, {}, planeObject); var plane = jQuery.extend(true, {}, planeObject);
} }
/* For special squawk tests
if (data[j].hex == '48413x') {
data[j].squawk = '7700';
} //*/
// Set SpecialSquawk-value
if (data[j].squawk == '7500' || data[j].squawk == '7600' || data[j].squawk == '7700') {
SpecialSquawk = true;
}
// Call the function update // Call the function update
plane.funcUpdateData(data[j]); plane.funcUpdateData(data[j]);
@ -38,9 +50,6 @@ function fetchData() {
} }
PlanesOnTable = data.length; PlanesOnTable = data.length;
/* For special squawk tests */
//Planes['867840'].squawk = '7700';
}); });
} }
@ -455,6 +464,12 @@ function refreshTableInfo() {
document.getElementById('planes_table').innerHTML = html; document.getElementById('planes_table').innerHTML = html;
if (SpecialSquawk) {
$('#SpecialSquawkWarning').css('display', 'inline');
} else {
$('#SpecialSquawkWarning').css('display', 'none');
}
// Click event for table // Click event for table
$('#planes_table').find('tr').click( function(){ $('#planes_table').find('tr').click( function(){
var hex = $(this).find('td:first').text(); var hex = $(this).find('td:first').text();

View file

@ -7,7 +7,12 @@ div#map_canvas { height: 100%; margin-right: 420px; }
div#sidebar_container { float: left; width: 410px; margin-left: -410px; height: 100%; overflow: auto; } div#sidebar_container { float: left; width: 410px; margin-left: -410px; height: 100%; overflow: auto; }
table#optionsTabs { width: 100%; font-size: small; font-family: monospace; background-color: #ddd; border: 1px; border-color: #000000;} div#SpecialSquawkWarning { position: absolute; bottom: 25px; right: 430px; border: 2px solid red;
background-color: #FFFFA3; opacity: 0.75; filter:alpha(opacity=75); padding: 5px;
display: none; text-align: center; }
table#optionsTabs { width: 100%; font-size: small; font-family: monospace; background-color: #ddd;
border: 1px; border-color: #000000;}
#tableinfo { font-size: x-small; font-family: monospace; } #tableinfo { font-size: x-small; font-family: monospace; }
#sudo_buttons { font-size: x-small; font-family: monospace; } #sudo_buttons { font-size: x-small; font-family: monospace; }