Skip to content

Commit 2d0c47f

Browse files
Merge branch 'develop1.0'
2 parents 62ba9e6 + b208270 commit 2d0c47f

10 files changed

Lines changed: 416 additions & 42 deletions

File tree

ASCOM.Alpaca.Razor/ASCOM.Alpaca.Razor.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<PackageReference Include="ASCOM.Common.Components" Version="2.0.9" />
2121
<PackageReference Include="ASCOM.Exception.Library" Version="7.0.1" />
2222
<PackageReference Include="ASCOM.Tools" Version="2.0.9" />
23-
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
24-
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.3.1" />
23+
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
24+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.0.0" />
2525
</ItemGroup>
2626

2727
<PropertyGroup>

ASCOM.Alpaca.Razor/StartupHelpers.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.AspNetCore.Mvc;
77
using Microsoft.Extensions.DependencyInjection;
88
using Microsoft.OpenApi.Models;
9+
using Swashbuckle.AspNetCore.SwaggerUI;
910
using System;
1011
using System.Collections.Generic;
1112
using System.Linq;
@@ -82,6 +83,7 @@ public static void ConfigureSwagger(IApplicationBuilder app)
8283
c.SwaggerEndpoint("/swagger/Alpaca/swagger.json",
8384
$"Alpaca Endpoints - v1");
8485
c.SwaggerEndpoint("/swagger/OmniSim/swagger.json", "OmniSim Only Endpoints");
86+
c.DocExpansion(DocExpansion.None);
8587
});
8688
}
8789
}

ASCOM.Alpaca.Simulators/ASCOM.Alpaca.Simulators.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
<PackageReference Include="ASCOM.Tools" Version="2.0.9" />
3939
<PackageReference Include="Blazored.Toast" Version="4.2.1" />
4040
<PackageReference Include="LetsMake.GithubUpdateChecker" Version="0.1.0-rc2" />
41-
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
42-
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.3.1" />
41+
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="4.0.0" />
42+
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
43+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.0.0" />
4344
</ItemGroup>
4445

4546
<ItemGroup>

ASCOM.Alpaca.Simulators/ConsoleAndTraceLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public LogLevel LoggingLevel
3131

3232
/// <summary>
3333
/// Gets or sets a value indicating whether the log should write to the console at all.
34-
//// </summary>
34+
/// </summary>
3535
internal static bool LogToConsole
3636
{
3737
get => ServerSettings.LogToConsole;

ASCOM.Alpaca.Simulators/Controllers/SetupController.cs

Lines changed: 250 additions & 0 deletions
Large diffs are not rendered by default.

ASCOM.Alpaca.Simulators/Pages/Index.razor

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111

1212
<p>Server Transactions: @DeviceManager.RawTransactionID</p>
1313

14-
<a href="/swagger" target="_blank">View Swagger docs and interactive queries</a>
15-
<p>Please note that the Alpaca API documentation on the ASCOM website is the canonical version. There are several issues with this auto generated version that will be resolved in future versions. This is currently provided only for testing the simulators.</p>
14+
1615
</fieldset>
1716

17+
<fieldset>
18+
<legend>Swagger API Documentation</legend>
19+
<p>The OmniSim includes an interactive Swagger document for the Alpaca APIs and the OmniSim specific APIs. This includes json and yaml swagger files.</p>
20+
<a href="/swagger" target="_blank" style=" border:3px solid #003997; border-radius: 5px; padding: 3px; margin-bottom: 15px">View Swagger docs and interactive queries</a>
21+
<p>Please note that the Alpaca API documentation on the ASCOM website is the canonical version. There are several issues with this auto generated version that will be resolved in future versions. This is currently provided only for autogenerating clients and testing the simulators.</p>
22+
</fieldset>
23+
1824
@if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
1925
{
2026
<fieldset>

ASCOM.Alpaca.Simulators/Pages/LogLevelControl.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010

1111
@code {
12-
int currentCount = 0;
13-
1412
[Parameter]
1513
public OmniSim.BaseDriver.Driver Driver { get; set; }
1614

ASCOM.Alpaca.Simulators/Program.cs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public static void Main(string[] args)
132132
}
133133
catch (Exception ex)
134134
{
135+
WriteAndLog("Error processing external command" + ex.Message);
135136
}
136137
}
137138
});
@@ -161,37 +162,6 @@ public static void Main(string[] args)
161162
mutex.ReleaseMutex();
162163
}
163164
}
164-
165-
166-
/*try
167-
{
168-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
169-
{
170-
//Already running, start the browser, detects based on port in use
171-
var con1 = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections().Where(con => con.LocalEndPoint.Port == ServerSettings.ServerPort);
172-
if (IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections().Any(con => con.LocalEndPoint.Port == ServerSettings.ServerPort && (con.State == TcpState.Listen || con.State == TcpState.Established)))
173-
{
174-
WriteAndLog("Detected driver port already open, starting web browser on IP and Port. If this fails something else is using the port");
175-
StartBrowser(ServerSettings.ServerPort);
176-
return;
177-
}
178-
}
179-
else
180-
{
181-
//This was working fine for .Net Core 3.1. Initial tests for .Net 5 show a change in how single file deployments work on Linux
182-
//This should probably be changed to a Mutex or another similar lock
183-
if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1)
184-
{
185-
WriteAndLog("Detected driver already running, starting web browser on IP and Port");
186-
StartBrowser(ServerSettings.ServerPort);
187-
return;
188-
}
189-
}
190-
}
191-
catch (Exception ex)
192-
{
193-
Logging.LogError(ex.Message);
194-
}*/
195165
}
196166

197167
private static Task InitServers(string[] args)

0 commit comments

Comments
 (0)