Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce extending to the same position type only #19

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ Sector -> Volumes(VolumeName)
Volumes.xml
Meta -> Line
Volume(Name) -> Boundaries(Name)
Volume(ARA) -> Boundaries(ARAFURA)
Volume(ARA) -> Boundaries(ARAFURA)
8 changes: 4 additions & 4 deletions atc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -298,9 +298,9 @@ export async function getOnlinePositions() {
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.volumes.length > 0 && sector.Callsign.toUpperCase().endsWith(onlineController.callsign.toUpperCase().slice(-3)));
// If nothing found, continue.
if (!frequencySectors) return;
var extendedSector;
Expand Down Expand Up @@ -350,4 +350,4 @@ function getDistanceInKm(sector1, sector2) {

function deg2rad(deg) {
return deg * (Math.PI/180)
}
}