Skip to content

Commit

Permalink
Implement Alpaca HTML and JSON management interfaces plus small changes
Browse files Browse the repository at this point in the history
Improve processing of very large camera image arrays
The Remote Server will now restart after setting HTTP.SYS permissions in order to pick up the changed permissions
Add Location field to Remote Server setup form.
Up-level Newtonsoft.Json from v12.0.1 to v12.0.2
  • Loading branch information
Peter-Simpson committed Jun 19, 2019
1 parent 3cdf55b commit f4b4709
Show file tree
Hide file tree
Showing 19 changed files with 1,434 additions and 785 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.1</Version>
<Version>12.0.2</Version>
</PackageReference>
<PackageReference Include="RestSharp">
<Version>106.6.9</Version>
Expand Down
6 changes: 6 additions & 0 deletions Remote Client Device Base Classes/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
</configuration>
6 changes: 6 additions & 0 deletions Remote Client Local Server/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.1</Version>
<Version>12.0.2</Version>
</PackageReference>
<PackageReference Include="RestSharp">
<Version>106.6.9</Version>
Expand Down
4 changes: 2 additions & 2 deletions Remote Client Local Server/ServerConfigurationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void BtnGetRemoteConfiguration_Click(object sender, EventArgs e)
TL.LogMessage("GetConfiguration", "Setting timeout");
RemoteClientDriver.SetClientTimeout(client, 10);

string managementUri = string.Format("{0}{1}/{2}", SharedConstants.MANAGEMENT_URL_BASE, SharedConstants.API_VERSION_V1, SharedConstants.MANGEMENT_CONFIGURATION);
string managementUri = string.Format("{0}{1}/{2}", SharedConstants.REMOTE_SERVER_MANAGEMENT_URL_BASE, SharedConstants.API_VERSION_V1, SharedConstants.REMOTE_SERVER_MANGEMENT_GET_CONFIGURATION);
RestRequest request = new RestRequest(managementUri.ToLowerInvariant(), Method.GET)
{
RequestFormat = DataFormat.Json
Expand Down Expand Up @@ -201,7 +201,7 @@ private void BtnReloadConfiguration_Click(object sender, EventArgs e)
TL.LogMessage("Reload", "Setting timeout");
RemoteClientDriver.SetClientTimeout(client, 10);

string managementUri = string.Format("{0}{1}/{2}", SharedConstants.MANAGEMENT_URL_BASE, SharedConstants.API_VERSION_V1, SharedConstants.MANGEMENT_CONFIGURATION);
string managementUri = string.Format("{0}{1}/{2}", SharedConstants.REMOTE_SERVER_MANAGEMENT_URL_BASE, SharedConstants.API_VERSION_V1, SharedConstants.REMOTE_SERVER_MANGEMENT_GET_CONFIGURATION);
RestRequest request = new RestRequest(managementUri.ToLowerInvariant(), Method.GET)
{
RequestFormat = DataFormat.Json
Expand Down
Binary file added Remote Server/ASCOMAlpacaMidRes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions Remote Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ static void Main()
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ServerForm());
ServerForm serverForm = new ServerForm();
Application.Run(serverForm);

if (serverForm.RestartApplication) Application.Restart(); // Restart the application if the network permissions have been changed

#if DEBUG // When debugging, include a log to show the time of close down
TraceLogger TL = new TraceLogger("ASCOMRemoteEnded")
Expand All @@ -39,6 +42,7 @@ static void Main()
TL = null;
#endif
}

static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
TraceLogger TL = new TraceLogger("RemoteAccessServerException")
Expand All @@ -50,7 +54,6 @@ static void Application_ThreadException(object sender, ThreadExceptionEventArgs

TL.Enabled = false;
TL.Dispose();
TL = null;

//MessageBox.Show(e.Exception.Message, "Unhandled Thread Exception, see RemoteAccessServerException log for details.");
Environment.Exit(0);
Expand All @@ -67,8 +70,6 @@ static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEv
Process.Start(TL.LogFileName);
TL.Enabled = false;
TL.Dispose();
TL = null;
//MessageBox.Show(exception.Message, "Unhandled UI Exception, see RemoteAccessServerException log for details.");
Environment.Exit(0);
}
}
Expand Down
Loading

0 comments on commit f4b4709

Please sign in to comment.