Skip to content

Commit

Permalink
Assorted questions, feedback and tweaks #11
Browse files Browse the repository at this point in the history
Tweaks and suggestions thanks to Chris clwgh)
  • Loading branch information
alkissack committed Sep 16, 2023
1 parent 6ec3df2 commit 9b9e086
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
14 changes: 7 additions & 7 deletions public_html/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ BingMapsAPIKey = "";
MapzenAPIKey = null;


UseDefaultTerrianRings = true; // default Terrian rings color, otherwise colored by altitude (color defined in TerrianColorByAlt)
UseTerrianLineDash = false; // true: dashed or false: solid terrian rings
TerrianLineWidth = 1; // line width of terrian rings
TerrianAltitudes = [9842,39370]; // altitudes in ft as in alt parameter TerrianColorByAlt, replace XXXXXXX with your code: sudo wget -O /usr/share/dump1090-fa/html/upintheair.json "www.heywhatsthat.com/api/upintheair.json?id=XXXXXXX&refraction=0.25&alts=3000,12000"
TerrianColorByAlt = { // colours depending on altitude (UseDefaultTerrianRings must be false and TerrianAltitudes must be set), default same as colours of planes in air, alt in ft
UseDefaultTerrainRings = true; // default Terrian rings color, otherwise colored by altitude (color defined in TerrainColorByAlt)
UseTerrainLineDash = true ; // true: dashed or false: solid terrain rings
TerrainLineWidth = 1; // line width of terrain rings
TerrainAltitudes = [9842,39370]; // altitudes in ft as in alt parameter TerrainColorByAlt, replace XXXXXXX with your code: sudo wget -O /usr/share/dump1090-fa/html/upintheair.json "www.heywhatsthat.com/api/upintheair.json?id=XXXXXXX&refraction=0.25&alts=3000,12000"
TerrainColorByAlt = { // colours depending on altitude (UseDefaultTerrainRings must be false and TerrainAltitudes must be set), default same as colours of planes in air, alt in ft
h: [ { alt: 2000, val: 20 }, // orange
{ alt: 10000, val: 140 }, // light green
{ alt: 40000, val: 300 } ], // magenta
Expand Down Expand Up @@ -175,7 +175,7 @@ MidRangeHeight = 10000 ; // ft - mid range ring - Set -1 to disable collect
MidRangeLikely = 125 ; // nm - practical max
MidRangeShow = true ; // set to show mid range currently captured (assuming MidRangeHeight is set too)

MaxRangeHeight = 50000 ;
MaxRangeHeight = 99999 ;
MaxRangeLikely = 300 ; // nm - practical max 300
MaxRangeShow = true ; // set to show max range currently captured

Expand Down Expand Up @@ -205,5 +205,5 @@ ShowHTMLColumns = true ; // *** If you turn this off, use the original-ind
// ----------------------------------------------------------------------------------------------------------------------------
ShowMyFindsLayer = false ; // Private plot (non-aircraft related)
ShowSleafordRange = false ; // This shows a range layer based on 53N -0.5W A more reasltic range layer for my antenna location -- AK9T
SleafordMySql = false ; // Don't set this without reviewing the code - it is for me and a local mySql server on 192.168.1.11
SleafordMySql = false ; // Don't set this without reviewing the code - it is for me and a local mySql server on 192.168.1.11
// ----------------------------------------------------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<span class="sidebarButton pointer" onclick="selectAllPlanes();">Select All Aircraft</span>
<span class="sidebarButton pointer" onclick="selectMilPlanes();">Select Specials</span> <!-- AKISSACK Ref: AK9G -->
<span class="sidebarButton pointer" onclick="deselectAllPlanes();">DeSelect Aircraft</span>
<span class="sidebarButton pointer" onclick="resetRangePlot();">Reset Range</span> <!-- AKISSACK Ref: ref: AK8K -->
<span class="sidebarButton pointer" ondblclick="resetRangePlot();">Reset Range</span> <!-- AKISSACK Ref: ref: AK8K -->

</div>
</td>
Expand Down
22 changes: 11 additions & 11 deletions public_html/planeObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,25 +702,25 @@ PlaneObject.prototype.updateTick = function (
// AKISSACK store range plot details Ref AK8H
// ------------------------------------------------

// MINUMUM RANGE RINGS - MinRangeHeight is set in config.js as the upper bound for this ring
// - MinRangeLikely is set in config.js and is maximum likely distance for MinRangeHeight
// MINUMUM RANGE RINGS - MinRangeHeight is set in config.js as the upper bound for this ring
// - MinRangeLikely is set in config.js and is maximum likely distance for MinRangeHeight
if (this.altitude <= MinRangeHeight) {
if ( MinRngRange[this.siteBearing] < this.siteNm && this.siteNm < MinRangeLikely ) { // Update sessionStorage and also update MariaDb if in use
MinRngRange[this.siteBearing] = this.siteNm;
MinRngLat[this.siteBearing] = this.position[1];
MinRngLon[this.siteBearing] = this.position[0];
if (TypeOfStorageSession == 'Session') {
if (TypeOfStorageSession == 'Session') {
sessionStorage.setItem("MinRngRange", JSON.stringify(MinRngRange));
sessionStorage.setItem("MinRngLat", JSON.stringify(MinRngLat));
sessionStorage.setItem("MinRngLon", JSON.stringify(MinRngLon));
} else {
} else {
localStorage.setItem("MinRngRange", JSON.stringify(MinRngRange));
localStorage.setItem("MinRngLat", JSON.stringify(MinRngLat));
localStorage.setItem("MinRngLon", JSON.stringify(MinRngLon));
}
//console.log(("000" + this.siteBearing).slice(-3) + "° " + ("000" + this.siteNm).slice(-3)+"nm logged as MIN");
}
//console.log(("000" + this.siteBearing).slice(-3) + "° " + ("000" + this.siteNm).slice(-3)+"nm logged as MIN");
if (SleafordMySql) {
//console.log(("000" + this.siteBearing).slice(-3) + "° " + ("000" + this.siteNm).slice(-3)+"nm logged as MID "+this.fl);
//console.log(("000" + this.siteBearing).slice(-3) + "° " + ("000" + this.siteNm).slice(-3)+"nm logged as MID "+this.fl);
updateMySqlRange(
"min",
this.siteBearing,
Expand All @@ -734,8 +734,8 @@ PlaneObject.prototype.updateTick = function (
}
}

// MIDDLE RANGE RINGS - MidRangeHeight is set in config.js as the upper bound for this ring
// - MidRangeLikely is set in config.js and is maximum likely distance for MidRangeHeight
// MIDDLE RANGE RINGS - MidRangeHeight is set in config.js as the upper bound for this ring
// - MidRangeLikely is set in config.js and is maximum likely distance for MidRangeHeight
if (this.altitude <= MidRangeHeight) {
if (MidRngRange[this.siteBearing] < this.siteNm && this.siteNm < MidRangeLikely) {
MidRngRange[this.siteBearing] = this.siteNm;
Expand Down Expand Up @@ -766,8 +766,8 @@ PlaneObject.prototype.updateTick = function (
}
}

// MAXIMUM RANGE RINGS - MaxRangeHeight is set in config.js as the upper bound for this ring.
// - MaxRangeLikely is set in config.js and is maximum likely distance for MaxRangeHeight
// MAXIMUM RANGE RINGS - MaxRangeHeight is set in config.js as the upper bound for this ring.
// - MaxRangeLikely is set in config.js and is maximum likely distance for MaxRangeHeight
// - These are theoretical absolute maximums to weed out bad plots
if (this.altitude <= MaxRangeHeight) {
if ( MaxRngRange[this.siteBearing] < this.siteNm && this.siteNm < MaxRangeLikely) {
Expand Down
39 changes: 20 additions & 19 deletions public_html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function initialize() {
start_load_history();
});

// AKISSACK Range plot - Now able to read from local (or session) storage if available Ref: AK8C
// AKISSACK Range plot - Now able to read from local (or session) storage if available Ref: AK8C
if (TypeOfStorageSession == 'Session') {
if (sessionStorage.getItem("MaxRngLon") && sessionStorage.getItem("MaxRngLat") && sessionStorage.getItem("MaxRngRange")) {
console.log("Loading max range");
Expand Down Expand Up @@ -578,14 +578,14 @@ function initialize_map() {
sortByDistance();
} else {
SitePosition = null;
PlaneRowTemplate.cells[9].style.display = "none"; // hide distance column
PlaneRowTemplate.cells[9].style.display = "none"; // hide distance column
document.getElementById("distance").style.display = "none"; // hide distance header
sortByAltitude();
}

// Maybe hide flag info
if (!ShowFlags) {
PlaneRowTemplate.cells[1].style.display = "none"; // hide flag column
PlaneRowTemplate.cells[1].style.display = "none"; // hide flag column
document.getElementById("flag").style.display = "none"; // hide flag header
document.getElementById("infoblock_country").style.display = "none"; // hide country row
}
Expand Down Expand Up @@ -1140,9 +1140,10 @@ function initialize_map() {
OLMap = new ol.Map({
target: "map_canvas",
layers: layers,

view: new ol.View({
center: ol.proj.fromLonLat([CenterLon, CenterLat]),
//zoomFactor: 2,
center: ol.proj.fromLonLat([CenterLon, CenterLat]),
//zoomFactor: 1,
zoom: ZoomLvl,
}),
controls: [
Expand Down Expand Up @@ -1724,26 +1725,26 @@ function initialize_map() {
request.done(function (data) {
var ringStyle;

if (UseDefaultTerrianRings) {
if (UseDefaultTerrainRings) {
ringStyle = new ol.style.Style({
fill: null,
stroke: new ol.style.Stroke({
color: "#000000",
lineDash: UseTerrianLineDash ? [4, 4] : null,
width: TerrianLineWidth,
color: "#0000ff",
lineDash: UseTerrainLineDash ? [4, 4] : null,
width: TerrainLineWidth,
}),
});
} else {
ringStyle = [];

for (var i = 0; i < TerrianAltitudes.length; ++i) {
for (var i = 0; i < TerrainAltitudes.length; ++i) {
ringStyle.push(
new ol.style.Style({
fill: null,
stroke: new ol.style.Stroke({
color: getTerrianColorByAlti(TerrianAltitudes[i]),
lineDash: UseTerrianLineDash ? [4, 4] : null,
width: TerrianLineWidth,
color: getTerrainColorByAlti(TerrianAltitudes[i]),
lineDash: UseTerrainLineDash ? [4, 4] : null,
width: TerrainLineWidth,
}),
})
);
Expand All @@ -1761,7 +1762,7 @@ function initialize_map() {
geom.transform("EPSG:4326", "EPSG:3857");

var feature = new ol.Feature(geom);
if (UseDefaultTerrianRings) {
if (UseDefaultTerrainRings) {
feature.setStyle(ringStyle);
} else {
feature.setStyle(ringStyle[i]);
Expand Down Expand Up @@ -2717,7 +2718,7 @@ function showMap() {
$("#splitter").show();
$("#sudo_buttons").show();
$("#show_map_button").hide();
$("#sidebar_container").width("470px");
$("#sidebar_container").width("auto");
setColumnVisibility();
setSelectedInfoBlockVisibility();
updateMapSize();
Expand Down Expand Up @@ -3072,13 +3073,13 @@ function getAirframesModeSLinkIcao(code) {
return "";
}

function getTerrianColorByAlti(alti) {
var s = TerrianColorByAlt.s;
var l = TerrianColorByAlt.l;
function getTerrainColorByAlti(alti) {
var s = TerrainColorByAlt.s;
var l = TerrainColorByAlt.l;

// find the pair of points the current altitude lies between,
// and interpolate the hue between those points
var hpoints = TerrianColorByAlt.h;
var hpoints = TerrainColorByAlt.h;
var h = hpoints[0].val;
for (var i = hpoints.length - 1; i >= 0; --i) {
if (alti > hpoints[i].alt) {
Expand Down
10 changes: 5 additions & 5 deletions public_html/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ html, body {

#sidebar_container {
display: flex;
width: 500px; /* AKISSACK ------------ Ref: AK9F */
width: auto; /* AKISSACK ------------ Ref: AK9F */
left: 0 !important;
}

Expand Down Expand Up @@ -123,7 +123,7 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
#spinny { width: 128px; height: 128px; position: absolute; top: 50%; left: 50%; margin: -64px 0 0 -64px; }
#loader_progress { width: 250px; height: 20px; position: absolute; top: 50%; left: 50%; margin: 128px 0 0 -125px; }

#tableinfo { font-size: 10pt; font-family: monospace;} /* AKISSACK ------------ Ref: AK9F */
#tableinfo { font-size: 10pt; font-family: Menlo-Regular, monospace;} /* AKISSACK ------------ Ref: AK9F */
/* #tableinfo { font-size: small; } */

#sudo_buttons {
Expand All @@ -150,11 +150,11 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
}

.verticalRateTriangle {
font-family: "Courier New",monospace;
font-family: Menlo-Regular,monospace;
}

.icaoCodeColumn {
font-family: monospace;
font-family: Menlo-Regular, monospace;
text-transform: uppercase;
}

Expand All @@ -165,7 +165,7 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
.squawk7500 { font-weight: bold; background-color: #ff5555; }
.squawk7600 { font-weight: bold; background-color: #00ffff; }
.squawk7700 { font-weight: bold; background-color: #ffff00; }
.selected { background-color: #dddddd; }
.selected { background-color: #dddd66; }
.plane_table_row { cursor: pointer; }
.hidden { display: none; }

Expand Down

0 comments on commit 9b9e086

Please sign in to comment.