diff --git a/OpenSky.Agent.SimConnectMSFS/Properties/AssemblyInfo.cs b/OpenSky.Agent.SimConnectMSFS/Properties/AssemblyInfo.cs index c0efc0b..ded03f2 100644 --- a/OpenSky.Agent.SimConnectMSFS/Properties/AssemblyInfo.cs +++ b/OpenSky.Agent.SimConnectMSFS/Properties/AssemblyInfo.cs @@ -17,5 +17,5 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("1f9cbede-669d-4510-bca2-e6ad29d6a498")] -[assembly: AssemblyVersion("0.5.12")] -[assembly: AssemblyFileVersion("0.5.12")] +[assembly: AssemblyVersion("0.5.13")] +[assembly: AssemblyFileVersion("0.5.13")] diff --git a/OpenSky.Agent.Simulator/OpenSkyColors.xaml b/OpenSky.Agent.Simulator/OpenSkyColors.xaml index 87c900e..5bc81e4 100644 --- a/OpenSky.Agent.Simulator/OpenSkyColors.xaml +++ b/OpenSky.Agent.Simulator/OpenSkyColors.xaml @@ -20,7 +20,7 @@ Orange - Black + #666 White diff --git a/OpenSky.Agent.Simulator/Properties/AssemblyInfo.cs b/OpenSky.Agent.Simulator/Properties/AssemblyInfo.cs index d589778..7c4dde2 100644 --- a/OpenSky.Agent.Simulator/Properties/AssemblyInfo.cs +++ b/OpenSky.Agent.Simulator/Properties/AssemblyInfo.cs @@ -18,6 +18,6 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("30c467e8-2eee-41e5-be01-0142a61ba171")] -[assembly: AssemblyVersion("0.5.12")] -[assembly: AssemblyFileVersion("0.5.12")] +[assembly: AssemblyVersion("0.5.13")] +[assembly: AssemblyFileVersion("0.5.13")] [assembly: InternalsVisibleTo("OpenSky.Agent")] diff --git a/OpenSky.Agent.Simulator/Simulator.Flight.cs b/OpenSky.Agent.Simulator/Simulator.Flight.cs index 16a13d3..2054096 100644 --- a/OpenSky.Agent.Simulator/Simulator.Flight.cs +++ b/OpenSky.Agent.Simulator/Simulator.Flight.cs @@ -332,7 +332,6 @@ public Flight Flight { if (value.NavlogFixes?.Count > 0) { - this.SimbriefOfpLoaded = true; foreach (var flightNavlogFix in value.NavlogFixes) { this.SimbriefRouteLocations.Add(new Location(flightNavlogFix.Latitude, flightNavlogFix.Longitude)); @@ -397,7 +396,6 @@ public Flight Flight this.flightLoadingTempModels = null; this.StopTracking(false); this.lastFlightLogAutoSave = DateTime.MinValue; - this.simbriefOfpLoaded = false; this.OnlineNetworkConnectionDuration = TimeSpan.Zero; this.OnlineNetworkConnectionStarted = null; this.VatsimClientConnection = null; diff --git a/OpenSky.Agent.Simulator/Simulator.simBrief.cs b/OpenSky.Agent.Simulator/Simulator.simBrief.cs index 29a28ac..1049588 100644 --- a/OpenSky.Agent.Simulator/Simulator.simBrief.cs +++ b/OpenSky.Agent.Simulator/Simulator.simBrief.cs @@ -8,15 +8,10 @@ namespace OpenSky.Agent.Simulator { using System; using System.Collections.Generic; - using System.Diagnostics; - using System.Diagnostics.CodeAnalysis; - using System.Windows; - using System.Xml.Linq; using Microsoft.Maps.MapControl.WPF; using OpenSky.Agent.Simulator.Models; - using OpenSky.Agent.Simulator.Tools; /// ------------------------------------------------------------------------------------------------- /// @@ -32,20 +27,6 @@ public partial class Simulator /// ------------------------------------------------------------------------------------------------- private readonly List simbriefWaypointMarkers = new(); - /// ------------------------------------------------------------------------------------------------- - /// - /// True if simbrief ofp was loaded for this flight. - /// - /// ------------------------------------------------------------------------------------------------- - private bool simbriefOfpLoaded; - - /// ------------------------------------------------------------------------------------------------- - /// - /// Occurs when simbrief ofp loaded property changed. - /// - /// ------------------------------------------------------------------------------------------------- - public event EventHandler SimbriefOfpLoadedChanged; - /// ------------------------------------------------------------------------------------------------- /// /// Occurs when SimConnect adds a new simbrief waypoint marker. @@ -53,201 +34,11 @@ public partial class Simulator /// ------------------------------------------------------------------------------------------------- public event EventHandler SimbriefWaypointMarkerAdded; - /// ------------------------------------------------------------------------------------------------- - /// - /// Gets a value indicating whether a simbrief ofp was loaded for the current flight. - /// - /// ------------------------------------------------------------------------------------------------- - public bool SimbriefOfpLoaded - { - get => this.simbriefOfpLoaded; - - private set - { - if (Equals(this.simbriefOfpLoaded, value)) - { - return; - } - - this.simbriefOfpLoaded = value; - this.OnPropertyChanged(); - this.SimbriefOfpLoadedChanged?.Invoke(this, value); - } - } - /// ------------------------------------------------------------------------------------------------- /// /// Gets the Simbrief route location collection to draw a poly line on the map. /// /// ------------------------------------------------------------------------------------------------- public LocationCollection SimbriefRouteLocations { get; } - - /// ------------------------------------------------------------------------------------------------- - /// - /// Import simbrief flight plan navlog fixes. - /// - /// - /// sushi.at, 22/03/2021. - /// - /// - /// The ofp. - /// - /// ------------------------------------------------------------------------------------------------- - [SuppressMessage("ReSharper", "PossibleNullReferenceException")] - public void ImportSimbrief(XElement ofp) - { - if (this.SimbriefOfpLoaded) - { - return; - } - - Debug.WriteLine("SimConnect is importing simbrief flight plan"); - - // Departure airport is not part of the navlog so add a position for the polyline for it - var originLat = double.Parse((string)ofp.Element("origin").Element("pos_lat")); - var originLon = double.Parse((string)ofp.Element("origin").Element("pos_long")); - UpdateGUIDelegate addOriginLocation = () => this.SimbriefRouteLocations.Add(new Location(originLat, originLon)); - Application.Current.Dispatcher.Invoke(addOriginLocation); - - var fixes = ofp.Element("navlog").Elements("fix"); - foreach (var fix in fixes) - { - var ident = (string)fix.Element("ident"); - var latitude = double.Parse((string)fix.Element("pos_lat")); - var longitude = double.Parse((string)fix.Element("pos_long")); - var type = (string)fix.Element("type"); - - UpdateGUIDelegate addLocation = () => - { - this.SimbriefRouteLocations.Add(new Location(latitude, longitude)); - if (type != "apt") - { - Debug.WriteLine($"SimConnect creating simbrief waypoint marker {ident}"); - var newMarker = new SimbriefWaypointMarker(latitude, longitude, ident, type); - this.simbriefWaypointMarkers.Add(newMarker); - this.SimbriefWaypointMarkerAdded?.Invoke(this, newMarker); - } - }; - Application.Current.Dispatcher.BeginInvoke(addLocation); - } - - // Route - var sbOriginICAO = (string)ofp.Element("origin")?.Element("icao_code"); - var sbDestinationICAO = (string)ofp.Element("destination")?.Element("icao_code"); - var sbRoute = (string)ofp.Element("general")?.Element("route"); - if (!string.IsNullOrEmpty(sbRoute)) - { - // Add airports and runways to route - var sbOriginRunway = (string)ofp.Element("origin")?.Element("plan_rwy"); - var sbDestinationRunway = (string)ofp.Element("destination")?.Element("plan_rwy"); - if (!string.IsNullOrEmpty(sbOriginICAO)) - { - var prefix = sbOriginICAO; - if (!string.IsNullOrEmpty(sbOriginRunway)) - { - prefix += $"/{sbOriginRunway}"; - } - - sbRoute = $"{prefix} {sbRoute}"; - } - - if (!string.IsNullOrEmpty(sbDestinationICAO)) - { - var postFix = sbDestinationICAO; - if (!string.IsNullOrEmpty(sbDestinationRunway)) - { - postFix += $"/{sbDestinationRunway}"; - } - - sbRoute += $" {postFix}"; - } - - UpdateGUIDelegate updateRoute = () => - { - this.Flight.Route = sbRoute; - this.OnPropertyChanged(nameof(this.Flight)); - }; - Application.Current.Dispatcher.BeginInvoke(updateRoute); - } - - // Alternate route - var sbAlternateICAO = (string)ofp.Element("alternate")?.Element("icao_code"); - var sbAlternateRoute = (string)ofp.Element("alternate")?.Element("route"); - if (!string.IsNullOrEmpty(sbAlternateRoute)) - { - // Add airport and runway to route - var sbAlternateRunway = (string)ofp.Element("alternate")?.Element("plan_rwy"); - if (!string.IsNullOrEmpty(sbAlternateICAO)) - { - var postFix = sbAlternateICAO; - if (!string.IsNullOrEmpty(sbAlternateRunway)) - { - postFix += $"/{sbAlternateRunway}"; - } - - sbAlternateRoute += $" {postFix}"; - } - - UpdateGUIDelegate updateAlternateRoute = () => - { - this.Flight.AlternateRoute = sbAlternateRoute; - this.OnPropertyChanged(nameof(this.Flight)); - }; - Application.Current.Dispatcher.BeginInvoke(updateAlternateRoute); - } - - var sbOfpHtml = (string)ofp.Element("text")?.Element("plan_html"); - if (!string.IsNullOrEmpty(sbOfpHtml)) - { - // todo maybe can use this in the future if we find more performant html rendering control - //if (!sbOfpHtml.StartsWith("")) - //{ - // const string style = "body { background-color: #29323c; color: #c2c2c2; margin: -1px; } div { margin-top: 10px; margin-left: 10px; margin-bottom: -10px; }"; - // sbOfpHtml = $"{sbOfpHtml}"; - //} - - // Remove comments - while (sbOfpHtml.Contains("", start, StringComparison.InvariantCultureIgnoreCase); - if (start != -1 && end != -1) - { - sbOfpHtml = sbOfpHtml.Substring(0, start) + sbOfpHtml.Substring(end + 3); - } - } - - // Replace page breaks - sbOfpHtml = sbOfpHtml.Replace("

", "\r\n\r\n"); - - // Remove html tags - while (sbOfpHtml.Contains("<")) - { - var start = sbOfpHtml.IndexOf("<", StringComparison.InvariantCultureIgnoreCase); - var end = sbOfpHtml.IndexOf(">", start, StringComparison.InvariantCultureIgnoreCase); - if (start != -1 && end != -1) - { - // Are we removing an image? - if (sbOfpHtml.Substring(start, 4) == " - { - this.Flight.OfpHtml = sbOfpHtml; - this.OnPropertyChanged(nameof(this.Flight)); - }; - Application.Current.Dispatcher.BeginInvoke(setOfp); - } - - this.SimbriefOfpLoaded = true; - } } } \ No newline at end of file diff --git a/OpenSky.Agent.UdpXPlane11/Properties/AssemblyInfo.cs b/OpenSky.Agent.UdpXPlane11/Properties/AssemblyInfo.cs index 21d7209..718e1a2 100644 --- a/OpenSky.Agent.UdpXPlane11/Properties/AssemblyInfo.cs +++ b/OpenSky.Agent.UdpXPlane11/Properties/AssemblyInfo.cs @@ -17,5 +17,5 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("dfbda2b8-5775-4766-be86-d729fcf20de1")] -[assembly: AssemblyVersion("0.5.12")] -[assembly: AssemblyFileVersion("0.5.12")] +[assembly: AssemblyVersion("0.5.13")] +[assembly: AssemblyFileVersion("0.5.13")] diff --git a/OpenSky.Agent/Properties/AssemblyInfo.cs b/OpenSky.Agent/Properties/AssemblyInfo.cs index 64bfb2c..d63e246 100644 --- a/OpenSky.Agent/Properties/AssemblyInfo.cs +++ b/OpenSky.Agent/Properties/AssemblyInfo.cs @@ -21,8 +21,8 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] -[assembly: AssemblyVersion("0.5.12")] -[assembly: AssemblyFileVersion("0.5.12")] +[assembly: AssemblyVersion("0.5.13")] +[assembly: AssemblyFileVersion("0.5.13")] // This allows us to detect debug mode in XAML #if DEBUG diff --git a/OpenSky.Agent/Views/FlightTracking.xaml b/OpenSky.Agent/Views/FlightTracking.xaml index 1745919..211d4d4 100644 --- a/OpenSky.Agent/Views/FlightTracking.xaml +++ b/OpenSky.Agent/Views/FlightTracking.xaml @@ -59,7 +59,7 @@ - + @@ -77,7 +77,7 @@ - + Flight plan @@ -86,7 +86,6 @@ - @@ -107,10 +106,9 @@ - + Tracking conditions @@ -234,7 +232,7 @@ - + Tracking Status @@ -288,7 +286,7 @@ Note: You can close this window and OpenSky will monitor your flight in the background... - + Weights and Balances @@ -323,7 +321,7 @@