diff --git a/OpenSky.Agent.Simulator/Simulator.Metar.cs b/OpenSky.Agent.Simulator/Simulator.Metar.cs index f678a68..22d1ee0 100644 --- a/OpenSky.Agent.Simulator/Simulator.Metar.cs +++ b/OpenSky.Agent.Simulator/Simulator.Metar.cs @@ -23,21 +23,21 @@ public partial class Simulator /// The alternate metar. /// /// ------------------------------------------------------------------------------------------------- - private string alternateMetar = "???"; + private string alternateMetar = "???\n"; /// ------------------------------------------------------------------------------------------------- /// /// Destination metar. /// /// ------------------------------------------------------------------------------------------------- - private string destinationMetar = "???"; + private string destinationMetar = "???\n"; /// ------------------------------------------------------------------------------------------------- /// /// The origin metar. /// /// ------------------------------------------------------------------------------------------------- - private string originMetar = "???"; + private string originMetar = "???\n"; /// ------------------------------------------------------------------------------------------------- /// @@ -122,10 +122,14 @@ public void RefreshMetar() { var url = $"https://aviationweather.gov/api/data/metar?ids={this.Flight.Origin.Icao}"; this.OriginMetar = client.DownloadString(url); + if (string.IsNullOrEmpty(this.OriginMetar)) + { + this.OriginMetar = "Unavailable\n"; + } } else { - this.OriginMetar = "???"; + this.OriginMetar = "???\n"; } } catch (Exception ex) @@ -140,10 +144,14 @@ public void RefreshMetar() { var url = $"https://aviationweather.gov/api/data/metar?ids={this.Flight.Destination.Icao}"; this.DestinationMetar = client.DownloadString(url); + if (string.IsNullOrEmpty(this.DestinationMetar)) + { + this.DestinationMetar = "Unavailable\n"; + } } else { - this.DestinationMetar = "???"; + this.DestinationMetar = "???\n"; } } catch (Exception ex) @@ -158,10 +166,14 @@ public void RefreshMetar() { var url = $"https://aviationweather.gov/api/data/metar?ids={this.Flight.Alternate.Icao}"; this.AlternateMetar = client.DownloadString(url); + if (string.IsNullOrEmpty(this.AlternateMetar)) + { + this.AlternateMetar = "Unavailable\n"; + } } else { - this.AlternateMetar = "???"; + this.AlternateMetar = "???\n"; } } catch (Exception ex) diff --git a/OpenSky.Agent.Simulator/Simulator.Process.cs b/OpenSky.Agent.Simulator/Simulator.Process.cs index 008b6e2..754e9d0 100644 --- a/OpenSky.Agent.Simulator/Simulator.Process.cs +++ b/OpenSky.Agent.Simulator/Simulator.Process.cs @@ -379,7 +379,7 @@ private void ProcessPrimaryTracking() } // Are we close to landing? - this.SampleRates[Requests.LandingAnalysis] = this.WasAirborne && ppt.New.RadioHeight < 500 ? 25 : 500; + this.SampleRates[Requests.LandingAnalysis] = this.WasAirborne && ppt.New.RadioHeight < 200 ? 25 : 500; this.OnPropertyChanged(nameof(this.SampleRates)); // Was the sim paused/un-paused? diff --git a/OpenSky.Agent/Views/Models/LandingReportViewModel.cs b/OpenSky.Agent/Views/Models/LandingReportViewModel.cs index 94f9da8..a7e61c9 100644 --- a/OpenSky.Agent/Views/Models/LandingReportViewModel.cs +++ b/OpenSky.Agent/Views/Models/LandingReportViewModel.cs @@ -66,7 +66,7 @@ public LandingReportViewModel() this.FlightNumberHeader = $"Flight #{this.Simulator.Flight?.FullFlightNumber}\r\nLanding Report"; // Fetch the initial already existing landing report(s) - if (this.Simulator.FinalTouchDownIndex > 0) + if (this.Simulator.FinalTouchDownIndex >= 0) { for (var i = this.Simulator.FinalTouchDownIndex; i < this.Simulator.LandingReports.Count; i++) {