From 16dee851577315ce38dad1ed68e26a5f17768d75 Mon Sep 17 00:00:00 2001 From: Cooper <105491171+azfv@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:58:53 +1000 Subject: [PATCH 1/5] Make extending sectors process for CTR only --- atc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atc.js b/atc.js index a05cf4a..aed38ec 100644 --- a/atc.js +++ b/atc.js @@ -247,7 +247,7 @@ export async function getOnlineControllers(){ return; } // Check if they are controller for the right region. - if (!sectors.some(sector => sector.Callsign == controller.callsign.toUpperCase())) + if (!sectors.some(sector => sector.Callsign == controller.callsign.toUpperCase())) { return; } @@ -295,7 +295,7 @@ export async function getOnlinePositions() { activeFrequencies.push(convertedFrequency); }); // if only 1 frequency, nothing else to do. - if (activeFrequencies.length <= 1) return; + if (activeFrequencies.length <= 1 || !sector.Callsign.toUpperCase().includes("CTR")) return; // activeFrequencies.forEach(function(activeFrequency) { // Get all the sectors that use that frequency (but only CTR). @@ -350,4 +350,4 @@ function getDistanceInKm(sector1, sector2) { function deg2rad(deg) { return deg * (Math.PI/180) -} \ No newline at end of file +} From fc83f42f1f7a45f75573b0016ef9d220feb00ab6 Mon Sep 17 00:00:00 2001 From: Cooper <105491171+azfv@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:59:09 +1000 Subject: [PATCH 2/5] Update TODO.md --- TODO.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index b9ea2ca..907f124 100644 --- a/TODO.md +++ b/TODO.md @@ -5,6 +5,7 @@ * Join AFV freqs with sectors to show online. * Fix the on the ground altitude maths * Make light theme AD parts darker +* Add implementation for TMA extensions (Coral & Tasmania) * Markers and labels are too small on the ground. * Query OSM via Overpass API for aeroway=parking_position // Get aerodrome polygon @@ -148,4 +149,4 @@ Sector -> Volumes(VolumeName) Volumes.xml Meta -> Line Volume(Name) -> Boundaries(Name) -Volume(ARA) -> Boundaries(ARAFURA) \ No newline at end of file +Volume(ARA) -> Boundaries(ARAFURA) From 98370f30647e4ae04ca8ceb59fb4fd5ec2f98c12 Mon Sep 17 00:00:00 2001 From: Cooper <105491171+azfv@users.noreply.github.com> Date: Sun, 21 Apr 2024 03:26:17 +1000 Subject: [PATCH 3/5] Enforce extending to the same position type only --- atc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atc.js b/atc.js index aed38ec..c9953ea 100644 --- a/atc.js +++ b/atc.js @@ -295,12 +295,12 @@ export async function getOnlinePositions() { activeFrequencies.push(convertedFrequency); }); // if only 1 frequency, nothing else to do. - if (activeFrequencies.length <= 1 || !sector.Callsign.toUpperCase().includes("CTR")) return; + if (activeFrequencies.length <= 1) return; // activeFrequencies.forEach(function(activeFrequency) { - // Get all the sectors that use that frequency (but only CTR). + // Get all the sectors that use that frequency (but only the same position type as the primary position). var frequencySectors = sectors.filter(sector => sector.Frequency == activeFrequency - && sector.Callsign.toUpperCase().includes("CTR")); + && sector.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3))); // If nothing found, continue. if (!frequencySectors) return; var extendedSector; From d55cbdd58b1c3bbadf5f46efe1bca4ee2fc44168 Mon Sep 17 00:00:00 2001 From: Cooper <105491171+azfv@users.noreply.github.com> Date: Sun, 21 Apr 2024 03:29:47 +1000 Subject: [PATCH 4/5] Update TODO.md --- TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO.md b/TODO.md index 907f124..389788f 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,6 @@ * Join AFV freqs with sectors to show online. * Fix the on the ground altitude maths * Make light theme AD parts darker -* Add implementation for TMA extensions (Coral & Tasmania) * Markers and labels are too small on the ground. * Query OSM via Overpass API for aeroway=parking_position // Get aerodrome polygon From c384e989a20c6518538de833f7a4389579394fa1 Mon Sep 17 00:00:00 2001 From: Cooper <105491171+azfv@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:26:20 +1000 Subject: [PATCH 5/5] Add check to confirm extending sector has a volume --- atc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atc.js b/atc.js index c9953ea..93c36d9 100644 --- a/atc.js +++ b/atc.js @@ -300,7 +300,7 @@ export async function getOnlinePositions() { activeFrequencies.forEach(function(activeFrequency) { // Get all the sectors that use that frequency (but only the same position type as the primary position). var frequencySectors = sectors.filter(sector => sector.Frequency == activeFrequency - && sector.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3))); + && sector.volumes.length > 0 && sector.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3))); // If nothing found, continue. if (!frequencySectors) return; var extendedSector;