Skip to content

Commit

Permalink
changed how distance to ad is determined, changed references
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrumsey committed Apr 20, 2024
1 parent 5938248 commit 7886483
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions OzStripsGUI/OzStripsGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>ozstrips.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\ozstrips\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
Expand Down
19 changes: 16 additions & 3 deletions OzStripsGUI/StripController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using vatsys;
Expand Down Expand Up @@ -266,12 +267,24 @@ public StripArrDepType ArrDepType

public double GetDistToAerodrome(String aerodrome)
{
Coordinate coord = Airspace2.GetAirport(aerodrome)?.LatLong;
try
{
if (coord != null)
Coordinate adCoord = Airspace2.GetAirport(aerodrome)?.LatLong;
Coordinate planeCoord = fdr.PredictedPosition.Location;
List<RDP.RadarTrack> RadarTracks = (from radarTrack in RDP.RadarTracks
where radarTrack.ActualAircraft.Callsign == fdr.Callsign
select radarTrack).ToList();

if (RadarTracks.Count > 0)
{
foreach (RDP.RadarTrack rTrack in RadarTracks)
{
planeCoord = rTrack.ActualAircraft.Position;
}
}
if (adCoord != null)
{
double distance = Conversions.CalculateDistance(coord, fdr.PredictedPosition.Location);
double distance = Conversions.CalculateDistance(adCoord, planeCoord);
return distance;
}
}
Expand Down
3 changes: 1 addition & 2 deletions ozstrips/ozstrips.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
<Private>False</Private>
</Reference>
<Reference Include="vatSys">
<HintPath>..\..\..\..\Program Files (x86)\vatSys\bin\vatSys.exe</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\..\Program Files (x86)\vatSys\bin\vatSys.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 7886483

Please sign in to comment.