Skip to content

Commit

Permalink
Auto reg disable added
Browse files Browse the repository at this point in the history
Added delays to start tracking dialogs
  • Loading branch information
sushiat committed Dec 23, 2023
1 parent 052582d commit fef8a02
Show file tree
Hide file tree
Showing 5 changed files with 328 additions and 5 deletions.
181 changes: 180 additions & 1 deletion OpenSky.Agent.Simulator/OpenAPIs/swagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7132,6 +7132,98 @@ public virtual async System.Threading.Tasks.Task<WorldMapFlightIEnumerableApiRes
}
}

/// <summary>
/// Get the flight trail for the specified flight on the world map.
/// </summary>
/// <remarks>
/// sushi.at, 23/12/2023.
/// </remarks>
/// <param name="flightID">Identifier for the flight.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<WorldMapFlightTrailApiResponse> GetWorldMapFlightTrailAsync(System.Guid flightID)
{
return GetWorldMapFlightTrailAsync(flightID, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get the flight trail for the specified flight on the world map.
/// </summary>
/// <remarks>
/// sushi.at, 23/12/2023.
/// </remarks>
/// <param name="flightID">Identifier for the flight.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<WorldMapFlightTrailApiResponse> 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<WorldMapFlightTrailApiResponse>(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();
}
}

/// <summary>
/// Pause the flight with the specified ID, does not save position or save file - upload these
/// <br/>before calling pause if they should be preserved.
Expand Down Expand Up @@ -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; }

/// <summary>
/// Gets or sets a value indicating whether the automatic registry setting in the simulator is disabled.
/// </summary>
[Newtonsoft.Json.JsonProperty("disableAutoRegistry", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool DisableAutoRegistry { get; set; }

/// <summary>
/// Gets or sets the empty weight in pounds.
/// </summary>
Expand Down Expand Up @@ -15018,7 +15116,7 @@ public partial class WorldMapFlight
public double Altitude { get; set; }

/// <summary>
/// Gets or sets the Destination for the.
/// Gets or sets the destination.
/// </summary>
[Newtonsoft.Json.JsonProperty("destination", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Destination { get; set; }
Expand All @@ -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; }

/// <summary>
/// Gets or sets the identifier of the flight.
/// </summary>
[Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid Id { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this flight is paused.
/// </summary>
Expand Down Expand Up @@ -15126,6 +15230,81 @@ public partial class WorldMapFlightIEnumerableApiResponse

}

/// <summary>
/// World map flight position report model (part of the trail)
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class WorldMapFlightPositionReport
{
/// <summary>
/// Gets or sets the altitude.
/// </summary>
[Newtonsoft.Json.JsonProperty("altitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Altitude { get; set; }

/// <summary>
/// Gets or sets the latitude.
/// </summary>
[Newtonsoft.Json.JsonProperty("latitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Latitude { get; set; }

/// <summary>
/// Gets or sets the longitude.
/// </summary>
[Newtonsoft.Json.JsonProperty("longitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Longitude { get; set; }

}

/// <summary>
/// World map flight trail model.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class WorldMapFlightTrail
{
/// <summary>
/// Gets or sets the position reports.
/// </summary>
[Newtonsoft.Json.JsonProperty("positionReports", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<WorldMapFlightPositionReport> PositionReports { get; set; }

}

/// <summary>
/// API standard response model.
/// </summary>
[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; }

/// <summary>
/// Gets or sets the error details (NULL if no error).
/// </summary>
[Newtonsoft.Json.JsonProperty("errorDetails", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ErrorDetails { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this response is reporting an error.
/// </summary>
[Newtonsoft.Json.JsonProperty("isError", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool IsError { get; set; }

/// <summary>
/// Gets or sets the message.
/// </summary>
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }

/// <summary>
/// Gets or sets the status.
/// </summary>
[Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Status { get; set; }

}

/// <summary>
/// World statistics overview model.
/// </summary>
Expand Down
121 changes: 120 additions & 1 deletion OpenSky.Agent.Simulator/OpenAPIs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -9998,7 +10046,7 @@
},
"destination": {
"type": "string",
"description": "Gets or sets the Destination for the.",
"description": "Gets or sets the destination.",
"nullable": true
},
"flightPhase": {
Expand All @@ -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."
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions OpenSky.Agent/Controls/OpenSkyWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit fef8a02

Please sign in to comment.