From 397f421ba224158ec42efb9c67022940618e06b3 Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Sat, 23 Dec 2023 14:57:07 +0000 Subject: [PATCH 1/3] Add comma sep clarification to manufacturer airports --- OpenSky.Agent/Views/AircraftTypes.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSky.Agent/Views/AircraftTypes.xaml b/OpenSky.Agent/Views/AircraftTypes.xaml index 064804b..30a67c7 100644 --- a/OpenSky.Agent/Views/AircraftTypes.xaml +++ b/OpenSky.Agent/Views/AircraftTypes.xaml @@ -457,7 +457,7 @@ Name Version Manufacturer - Manufacturer airports + Manufacturer airports(comma separated) Category Engine model Fuel type override? @@ -604,7 +604,7 @@ Name Version Manufacturer - Manufacturer airports + Manufacturer airports(comma separated) Category Engine model Fuel type override? From 052582d8c1eab00f04757c6baa9d7910914e0686 Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Sat, 23 Dec 2023 16:28:19 +0000 Subject: [PATCH 2/3] Fixed and expanded sound packs folder scanning code --- OpenSky.Agent.Simulator/SpeechSoundPacks.cs | 196 +++++++++++++----- OpenSky.Agent.sln.DotSettings | 1 + .../Views/Models/SoundPackTesterViewModel.cs | 7 + OpenSky.Agent/Views/SoundPackTester.xaml | 6 + 4 files changed, 154 insertions(+), 56 deletions(-) diff --git a/OpenSky.Agent.Simulator/SpeechSoundPacks.cs b/OpenSky.Agent.Simulator/SpeechSoundPacks.cs index 743270d..c08ff60 100644 --- a/OpenSky.Agent.Simulator/SpeechSoundPacks.cs +++ b/OpenSky.Agent.Simulator/SpeechSoundPacks.cs @@ -12,6 +12,7 @@ namespace OpenSky.Agent.Simulator using System.IO; using System.Linq; using System.Media; + using System.Reflection; using System.Speech.Synthesis; using System.Text.RegularExpressions; using System.Threading; @@ -20,7 +21,7 @@ namespace OpenSky.Agent.Simulator /// ------------------------------------------------------------------------------------------------- /// - /// Speech sound packs manager. + /// Speech soundpacks manager. /// /// /// sushi.at, 24/12/2021. @@ -28,13 +29,6 @@ namespace OpenSky.Agent.Simulator /// ------------------------------------------------------------------------------------------------- public class SpeechSoundPacks { - /// ------------------------------------------------------------------------------------------------- - /// - /// The single static instance. - /// - /// ------------------------------------------------------------------------------------------------- - public static SpeechSoundPacks Instance { get; private set; } - /// ------------------------------------------------------------------------------------------------- /// /// The random generator. @@ -49,25 +43,6 @@ public class SpeechSoundPacks /// ------------------------------------------------------------------------------------------------- private readonly SpeechSynthesizer speech; - /// ------------------------------------------------------------------------------------------------- - /// - /// Initializes the speech sound packs. - /// - /// - /// sushi.at, 31/01/2022. - /// - /// - /// The selected sound pack. - /// - /// - /// The text to speech voice. - /// - /// ------------------------------------------------------------------------------------------------- - public static void InitializeSpeechSoundPacks(string selectedSoundPack, string textToSpeechVoice) - { - Instance = new SpeechSoundPacks(selectedSoundPack, textToSpeechVoice); - } - /// ------------------------------------------------------------------------------------------------- /// /// Initializes a new instance of the class. @@ -91,6 +66,7 @@ private SpeechSoundPacks(string selectedSoundPack, string textToSpeechVoice) // Initialize the speech synthesizer this.speech = new SpeechSynthesizer(); + this.InitLog = $"Preparing TTS module for voice: {textToSpeechVoice}"; if (!string.IsNullOrEmpty(textToSpeechVoice)) { try @@ -99,62 +75,151 @@ private SpeechSoundPacks(string selectedSoundPack, string textToSpeechVoice) } catch (Exception ex) { - Debug.WriteLine("Error setting text-to-speech voice from settings: " + ex); + Debug.WriteLine($"Error setting text-to-speech voice from settings: {ex}"); + this.InitLog += $"\r\nError setting text-to-speech voice from settings:\r\n{ex}"; } } + else + { + this.InitLog += "empty, skipping."; + } // Scan sound pack folder for recognized wav files - foreach (var soundPackDirectory in Directory.EnumerateDirectories(".\\SoundPacks")) + var localSoundPacksPath = string.Empty; + try { - var packName = soundPackDirectory.Split('\\').Last(); - var packFiles = Directory.GetFiles(soundPackDirectory); - var packDictionary = new Dictionary>(); - foreach (SpeechEvent spEvent in Enum.GetValues(typeof(SpeechEvent))) + localSoundPacksPath = Path.GetDirectoryName(".\\SoundPacks") ?? string.Empty; + if (!localSoundPacksPath.EndsWith("SoundPacks")) { - if (spEvent != SpeechEvent.ReadyForBoarding) + // Path doesn't exist + localSoundPacksPath = string.Empty; + } + } + catch + { + //Ignore + } + + var assemblyLocationSoundPacksPath = string.Empty; + try + { + assemblyLocationSoundPacksPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; + } + catch + { + //Ignore + } + + if (!string.IsNullOrEmpty(assemblyLocationSoundPacksPath)) + { + assemblyLocationSoundPacksPath = $"{assemblyLocationSoundPacksPath}\\SoundPacks"; + if (!Directory.Exists(assemblyLocationSoundPacksPath)) + { + assemblyLocationSoundPacksPath = string.Empty; + } + } + + var openSkyFolderPath = Environment.ExpandEnvironmentVariables("%localappdata%\\OpenSky\\SoundPacks"); + var openSkyAppDataSoundPacksPath = Directory.Exists(openSkyFolderPath) ? openSkyFolderPath : string.Empty; + + this.InitLog += $"\r\n\r\nLocal soundpacks folder : {localSoundPacksPath}"; + this.InitLog += $"\r\nAssembly location soundpacks folder: {assemblyLocationSoundPacksPath}"; + this.InitLog += $"\r\nOpenSky appdata soundpacks folder : {openSkyAppDataSoundPacksPath}"; + + var dirsToScan = new List(); + if (!string.IsNullOrEmpty(localSoundPacksPath)) + { + dirsToScan.Add(localSoundPacksPath); + } + + if (!string.IsNullOrEmpty(assemblyLocationSoundPacksPath) && !localSoundPacksPath.ToLowerInvariant().Equals(assemblyLocationSoundPacksPath.ToLowerInvariant())) + { + dirsToScan.Add(assemblyLocationSoundPacksPath); + } + + if (!string.IsNullOrEmpty(openSkyAppDataSoundPacksPath)) + { + dirsToScan.Add(openSkyAppDataSoundPacksPath); + } + + foreach (var packDir in dirsToScan) + { + this.InitLog += $"\r\n\r\nScanning directory for sound packs: {packDir}\r\n"; + foreach (var soundPackDirectory in Directory.EnumerateDirectories(packDir)) + { + this.InitLog += $"\r\nChecking pack directory: {soundPackDirectory}"; + var packName = soundPackDirectory.Split('\\').Last(); + var packFiles = Directory.GetFiles(soundPackDirectory); + var packDictionary = new Dictionary>(); + foreach (SpeechEvent spEvent in Enum.GetValues(typeof(SpeechEvent))) { - var eventConfig = spEvent.GetStringValue(); - if (eventConfig?.Contains("|") == true) + if (spEvent != SpeechEvent.ReadyForBoarding) { - var fileMask = eventConfig.Split('|')[0]; - foreach (var packFile in packFiles) + var eventConfig = spEvent.GetStringValue(); + if (eventConfig?.Contains("|") == true) { - if (Regex.IsMatch(packFile, fileMask)) + var fileMask = eventConfig.Split('|')[0]; + foreach (var packFile in packFiles) { - if (!packDictionary.ContainsKey(spEvent)) + if (Regex.IsMatch(packFile, fileMask)) { - packDictionary.Add(spEvent, new List()); - } + if (!packDictionary.ContainsKey(spEvent)) + { + packDictionary.Add(spEvent, new List()); + } - packDictionary[spEvent].Add(packFile); + packDictionary[spEvent].Add(packFile); + this.InitLog += $"\r\nFound pack file for event {spEvent}: {packFile}"; + } } } } } - } - // Check for special ReadyForBoarding meta event conditions - if (packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingBeginning) && packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingEnd) && packDictionary.ContainsKey(SpeechEvent.Number1) && - packDictionary.ContainsKey(SpeechEvent.Number2) && packDictionary.ContainsKey(SpeechEvent.Number3) && packDictionary.ContainsKey(SpeechEvent.Number4) && packDictionary.ContainsKey(SpeechEvent.Number5) && - packDictionary.ContainsKey(SpeechEvent.Number6) && packDictionary.ContainsKey(SpeechEvent.Number7) && packDictionary.ContainsKey(SpeechEvent.Number8) && packDictionary.ContainsKey(SpeechEvent.Number9) && - packDictionary.ContainsKey(SpeechEvent.Number0)) - { - packDictionary.Add(SpeechEvent.ReadyForBoarding, null); - } + // Check for special ReadyForBoarding meta event conditions + if (packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingBeginning) && packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingEnd) && packDictionary.ContainsKey(SpeechEvent.Number1) && + packDictionary.ContainsKey(SpeechEvent.Number2) && packDictionary.ContainsKey(SpeechEvent.Number3) && packDictionary.ContainsKey(SpeechEvent.Number4) && packDictionary.ContainsKey(SpeechEvent.Number5) && + packDictionary.ContainsKey(SpeechEvent.Number6) && packDictionary.ContainsKey(SpeechEvent.Number7) && packDictionary.ContainsKey(SpeechEvent.Number8) && packDictionary.ContainsKey(SpeechEvent.Number9) && + packDictionary.ContainsKey(SpeechEvent.Number0)) + { + packDictionary.Add(SpeechEvent.ReadyForBoarding, null); + this.InitLog += $"\r\nMarking meta-event ReadyForBoarding as available for pack: {packName}"; + } - // Does the pack contain any recognized files? - if (packDictionary.Count > 0) - { - this.SoundPacks.Add(packName, packDictionary); + // Does the pack contain any recognized files? + if (packDictionary.Count > 0) + { + this.SoundPacks.Add(packName, packDictionary); + this.InitLog += $"\r\nPack {packName} has valid events, adding to list.\r\n"; + } + else + { + this.InitLog += $"\r\nPack {packName} has NO valid events!!!, skipping.\r\n"; + } } } } catch (Exception ex) { Debug.WriteLine($"Error initializing sound packs: {ex}"); + this.InitLog += $"\r\n\r\nError initializing sound packs:\r\n{ex}"; } } + /// ------------------------------------------------------------------------------------------------- + /// + /// The single static instance. + /// + /// ------------------------------------------------------------------------------------------------- + public static SpeechSoundPacks Instance { get; private set; } + + /// ------------------------------------------------------------------------------------------------- + /// + /// Gets the initialize log. + /// + /// ------------------------------------------------------------------------------------------------- + public string InitLog { get; private set; } + /// ------------------------------------------------------------------------------------------------- /// /// Gets or sets the selected sound pack. @@ -169,6 +234,25 @@ private SpeechSoundPacks(string selectedSoundPack, string textToSpeechVoice) /// ------------------------------------------------------------------------------------------------- public Dictionary>> SoundPacks { get; } = new(); + /// ------------------------------------------------------------------------------------------------- + /// + /// Initializes the speech sound packs. + /// + /// + /// sushi.at, 31/01/2022. + /// + /// + /// The selected sound pack. + /// + /// + /// The text to speech voice. + /// + /// ------------------------------------------------------------------------------------------------- + public static void InitializeSpeechSoundPacks(string selectedSoundPack, string textToSpeechVoice) + { + Instance = new SpeechSoundPacks(selectedSoundPack, textToSpeechVoice); + } + /// ------------------------------------------------------------------------------------------------- /// /// Play the specified speech event from the selected or randomized sound pack, or use TTS as a diff --git a/OpenSky.Agent.sln.DotSettings b/OpenSky.Agent.sln.DotSettings index 890113d..ce7502b 100644 --- a/OpenSky.Agent.sln.DotSettings +++ b/OpenSky.Agent.sln.DotSettings @@ -611,6 +611,7 @@ OpenSky project ${CurrentDate.Year} True True True + True True True True diff --git a/OpenSky.Agent/Views/Models/SoundPackTesterViewModel.cs b/OpenSky.Agent/Views/Models/SoundPackTesterViewModel.cs index e512d0b..fe397c5 100644 --- a/OpenSky.Agent/Views/Models/SoundPackTesterViewModel.cs +++ b/OpenSky.Agent/Views/Models/SoundPackTesterViewModel.cs @@ -114,6 +114,13 @@ public string FlightNumber } } + /// ------------------------------------------------------------------------------------------------- + /// + /// Gets the initialize log. + /// + /// ------------------------------------------------------------------------------------------------- + public string InitLog => SpeechSoundPacks.Instance.InitLog; + /// ------------------------------------------------------------------------------------------------- /// /// Gets the play speech event command. diff --git a/OpenSky.Agent/Views/SoundPackTester.xaml b/OpenSky.Agent/Views/SoundPackTester.xaml index 9572a12..6d2bc7c 100644 --- a/OpenSky.Agent/Views/SoundPackTester.xaml +++ b/OpenSky.Agent/Views/SoundPackTester.xaml @@ -53,5 +53,11 @@ + + + Sound pack initialization log + + + From fef8a0217fac628459609611ae1645ec92d36c5e Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Sat, 23 Dec 2023 16:52:31 +0000 Subject: [PATCH 3/3] Auto reg disable added Added delays to start tracking dialogs --- OpenSky.Agent.Simulator/OpenAPIs/swagger.cs | 181 +++++++++++++++++- OpenSky.Agent.Simulator/OpenAPIs/swagger.json | 121 +++++++++++- OpenSky.Agent/Controls/OpenSkyWindow.cs | 4 +- .../Views/Models/FlightTrackingViewModel.cs | 24 ++- changelog.txt | 3 + 5 files changed, 328 insertions(+), 5 deletions(-) diff --git a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs index b7f0331..0712ae3 100644 --- a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs +++ b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs @@ -7132,6 +7132,98 @@ public virtual async System.Threading.Tasks.Task + /// Get the flight trail for the specified flight on the world map. + /// + /// + /// sushi.at, 23/12/2023. + /// + /// Identifier for the flight. + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetWorldMapFlightTrailAsync(System.Guid flightID) + { + return GetWorldMapFlightTrailAsync(flightID, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the flight trail for the specified flight on the world map. + /// + /// + /// sushi.at, 23/12/2023. + /// + /// Identifier for the flight. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetWorldMapFlightTrailAsync(System.Guid flightID, System.Threading.CancellationToken cancellationToken) + { + if (flightID == null) + throw new System.ArgumentNullException("flightID"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Flight/worldMap/trail/{flightID}"); + urlBuilder_.Replace("{flightID}", System.Uri.EscapeDataString(ConvertToString(flightID, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// /// Pause the flight with the specified ID, does not save position or save file - upload these ///
before calling pause if they should be preserved. @@ -9993,6 +10085,12 @@ public partial class AircraftType [Newtonsoft.Json.JsonProperty("detailedChecksDisabled", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool DetailedChecksDisabled { get; set; } + /// + /// Gets or sets a value indicating whether the automatic registry setting in the simulator is disabled. + /// + [Newtonsoft.Json.JsonProperty("disableAutoRegistry", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool DisableAutoRegistry { get; set; } + /// /// Gets or sets the empty weight in pounds. /// @@ -15018,7 +15116,7 @@ public partial class WorldMapFlight public double Altitude { get; set; } /// - /// Gets or sets the Destination for the. + /// Gets or sets the destination. /// [Newtonsoft.Json.JsonProperty("destination", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Destination { get; set; } @@ -15044,6 +15142,12 @@ public partial class WorldMapFlight [Newtonsoft.Json.JsonProperty("heading", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public double Heading { get; set; } + /// + /// Gets or sets the identifier of the flight. + /// + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Id { get; set; } + /// /// Gets or sets a value indicating whether this flight is paused. /// @@ -15126,6 +15230,81 @@ public partial class WorldMapFlightIEnumerableApiResponse } + /// + /// World map flight position report model (part of the trail) + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class WorldMapFlightPositionReport + { + /// + /// Gets or sets the altitude. + /// + [Newtonsoft.Json.JsonProperty("altitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Altitude { get; set; } + + /// + /// Gets or sets the latitude. + /// + [Newtonsoft.Json.JsonProperty("latitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Latitude { get; set; } + + /// + /// Gets or sets the longitude. + /// + [Newtonsoft.Json.JsonProperty("longitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Longitude { get; set; } + + } + + /// + /// World map flight trail model. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class WorldMapFlightTrail + { + /// + /// Gets or sets the position reports. + /// + [Newtonsoft.Json.JsonProperty("positionReports", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection PositionReports { get; set; } + + } + + /// + /// API standard response model. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class WorldMapFlightTrailApiResponse + { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public WorldMapFlightTrail Data { get; set; } + + /// + /// Gets or sets the error details (NULL if no error). + /// + [Newtonsoft.Json.JsonProperty("errorDetails", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ErrorDetails { get; set; } + + /// + /// Gets or sets a value indicating whether this response is reporting an error. + /// + [Newtonsoft.Json.JsonProperty("isError", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool IsError { get; set; } + + /// + /// Gets or sets the message. + /// + [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Message { get; set; } + + /// + /// Gets or sets the status. + /// + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Status { get; set; } + + } + /// /// World statistics overview model. /// diff --git a/OpenSky.Agent.Simulator/OpenAPIs/swagger.json b/OpenSky.Agent.Simulator/OpenAPIs/swagger.json index 8f7a4f5..8cd0999 100644 --- a/OpenSky.Agent.Simulator/OpenAPIs/swagger.json +++ b/OpenSky.Agent.Simulator/OpenAPIs/swagger.json @@ -3344,6 +3344,50 @@ } } }, + "/Flight/worldMap/trail/{flightID}": { + "get": { + "tags": [ + "Flight" + ], + "summary": "Get the flight trail for the specified flight on the world map.", + "description": "sushi.at, 23/12/2023.", + "operationId": "GetWorldMapFlightTrail", + "parameters": [ + { + "name": "flightID", + "in": "path", + "description": "Identifier for the flight.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/WorldMapFlightTrailApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorldMapFlightTrailApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/WorldMapFlightTrailApiResponse" + } + } + } + } + } + } + }, "/Flight/pause/{flightID}": { "post": { "tags": [ @@ -5005,6 +5049,10 @@ "type": "boolean", "description": "Gets or sets a value indicating whether the detailed checks are TEMPORARILY disabled - only\r\nuse this on patch days until a new version of the plane can be added." }, + "disableAutoRegistry": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the automatic registry setting in the simulator is disabled." + }, "emptyWeight": { "type": "number", "description": "Gets or sets the empty weight in pounds.", @@ -9998,7 +10046,7 @@ }, "destination": { "type": "string", - "description": "Gets or sets the Destination for the.", + "description": "Gets or sets the destination.", "nullable": true }, "flightPhase": { @@ -10019,6 +10067,11 @@ "description": "The magnetic heading.", "format": "double" }, + "id": { + "type": "string", + "description": "Gets or sets the identifier of the flight.", + "format": "uuid" + }, "isPaused": { "type": "boolean", "description": "Gets or sets a value indicating whether this flight is paused." @@ -10090,6 +10143,72 @@ "additionalProperties": false, "description": "API standard response model." }, + "WorldMapFlightPositionReport": { + "type": "object", + "properties": { + "altitude": { + "type": "number", + "description": "Gets or sets the altitude.", + "format": "double" + }, + "latitude": { + "type": "number", + "description": "Gets or sets the latitude.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "Gets or sets the longitude.", + "format": "double" + } + }, + "additionalProperties": false, + "description": "World map flight position report model (part of the trail)" + }, + "WorldMapFlightTrail": { + "type": "object", + "properties": { + "positionReports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorldMapFlightPositionReport" + }, + "description": "Gets or sets the position reports.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "World map flight trail model." + }, + "WorldMapFlightTrailApiResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/WorldMapFlightTrail" + }, + "errorDetails": { + "type": "string", + "description": "Gets or sets the error details (NULL if no error).", + "nullable": true + }, + "isError": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this response is reporting an error." + }, + "message": { + "type": "string", + "description": "Gets or sets the message.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "API standard response model." + }, "WorldStatisticsOverview": { "type": "object", "properties": { diff --git a/OpenSky.Agent/Controls/OpenSkyWindow.cs b/OpenSky.Agent/Controls/OpenSkyWindow.cs index 1d1b592..04a5b30 100644 --- a/OpenSky.Agent/Controls/OpenSkyWindow.cs +++ b/OpenSky.Agent/Controls/OpenSkyWindow.cs @@ -552,8 +552,8 @@ private void MessageBoxClosed(object sender, EventArgs args) { try { - // Wait 500 milliseconds before removing the message box, so the fade out animation has time to run - Thread.Sleep(500); + // Wait 750 milliseconds before removing the message box, so the fade out animation has time to run + Thread.Sleep(750); UpdateGUIDelegate removeNotification = () => { lock (this.messageBoxContainer) diff --git a/OpenSky.Agent/Views/Models/FlightTrackingViewModel.cs b/OpenSky.Agent/Views/Models/FlightTrackingViewModel.cs index 41c0eb2..918a960 100644 --- a/OpenSky.Agent/Views/Models/FlightTrackingViewModel.cs +++ b/OpenSky.Agent/Views/Models/FlightTrackingViewModel.cs @@ -994,7 +994,14 @@ private void StartTracking() } // Set the plane registration - this.Simulator.SetAircraftRegistry(this.Simulator.Flight?.Aircraft.Registry.RemoveSimPrefix()); + if (this.Simulator.Flight?.Aircraft.Type.DisableAutoRegistry != true) + { + var reg = this.Simulator.Flight?.Aircraft.Registry.RemoveSimPrefix(); + if (!string.IsNullOrEmpty(reg)) + { + this.Simulator.SetAircraftRegistry(reg); + } + } // Wait a bit to make sure all structs have updated, especially time in sim Thread.Sleep(this.Simulator.SampleRates[Requests.Secondary] + 1000); @@ -1036,6 +1043,9 @@ private void StartTracking() this.StartTrackingCommand.ReportProgress(() => this.StartTrackingCommand.CanExecute = true); return; } + + // Make sure we wait a bit before the next message box + Thread.Sleep(500); } else if (this.Simulator.WeightAndBalance.FuelTotalQuantity > (this.Simulator.Flight.FuelGallons ?? 0) + 1) { @@ -1119,6 +1129,9 @@ private void StartTracking() this.StartTrackingCommand.ReportProgress(() => this.StartTrackingCommand.CanExecute = true); return; } + + // Make sure we wait a bit before the next message box + Thread.Sleep(500); } if (Math.Abs(this.Simulator.WeightAndBalance.CgPercentLateral) > 0.01) @@ -1155,6 +1168,9 @@ private void StartTracking() this.StartTrackingCommand.ReportProgress(() => this.StartTrackingCommand.CanExecute = true); return; } + + // Make sure we wait a bit before the next message box + Thread.Sleep(500); } if (this.Simulator.WeightAndBalance.PayloadWeight > this.Simulator.WeightAndBalance.MaxPayloadWeight) @@ -1191,6 +1207,9 @@ private void StartTracking() this.StartTrackingCommand.ReportProgress(() => this.StartTrackingCommand.CanExecute = true); return; } + + // Make sure we wait a bit before the next message box + Thread.Sleep(500); } if (this.Simulator.WeightAndBalance.TotalWeight > this.Simulator.WeightAndBalance.MaxGrossWeight) @@ -1226,6 +1245,9 @@ private void StartTracking() this.StartTrackingCommand.ReportProgress(() => this.StartTrackingCommand.CanExecute = true); return; } + + // Make sure we wait a bit before the next message box + Thread.Sleep(500); } if (!this.Simulator.GroundHandlingComplete && this.Simulator.SecondaryTracking.EngineRunning) diff --git a/changelog.txt b/changelog.txt index 68510a3..e46b65f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,9 @@ Version 0.5.12 (ALPHA5) -------------------------------------------------------------------------------------- - Fixed default AvGas override for new aircraft - Map view now using OSM, bing maps key no longer necessary, removed from settings +- Fixed and expanded sound packs folder scanning logic, custom sound packs support + added in directory %localappdata%\OpenSky\SoundPacks +- Further improvement of tracking start questions -------------------------------------------------------------------------------------- Version 0.5.11 (ALPHA5)