Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-photo committed Aug 30, 2024
1 parent 900b5a2 commit 5167cb6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 76 deletions.
1 change: 1 addition & 0 deletions ninaAPI/AdvancedAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public AdvancedAPI(ICameraMediator camera,
{
SetHostNames();
Server = new API();
Server.Start();
}
});
}
Expand Down
68 changes: 0 additions & 68 deletions ninaAPI/Options.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,74 +95,6 @@
</StackPanel>
</StackPanel>

<Separator
Width="20"
Height="10"
Background="Transparent" />

<TextBlock
Margin="0,20,0,15"
FontSize="22"
FontWeight="Bold"
Text="Security" />

<StackPanel Orientation="Horizontal">
<TextBlock
Width="200"
Margin="0,5,5,5"
Text="Use Security" />
<CheckBox Margin="5,0,0,0" IsChecked="{Binding Secure}" />
</StackPanel>

<StackPanel
Margin="0,5,0,0"
Orientation="Horizontal"
Visibility="{Binding SecureVisibility}">
<TextBlock
Width="200"
Margin="0,5,5,5"
Text="Path to trusted SSL certificate" />
<TextBox
Width="350"
Margin="5"
Text="{Binding CertificatePath}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding SecureVisibility}">
<TextBlock
Width="200"
Margin="0,5,5,5"
Text="Certificate Password" />
<TextBox
Width="100"
Margin="5"
Text="{Binding CertificatePassword}" />
</StackPanel>

<StackPanel
Margin="0,5,0,0"
Orientation="Horizontal"
Visibility="{Binding SecureVisibility}">
<TextBlock
Width="200"
Margin="0,5,5,5"
Text="Api Key" />
<TextBox
Width="150"
Margin="5"
Text="{Binding ApiKey}" />
<Button
Width="180"
Margin="5"
Command="{Binding GenerateApiKeyCommand}"
Content="Generate new Api Key"
ToolTip="Generates a 12-digit secure key" />
<Button
Width="180"
Margin="5"
Command="{Binding SetApiKeyCommand}"
Content="Set Api Key"
ToolTip="This button sets the entered key as the API key. Remember this key, the plugin doesn't store it! If you forget the key, you can just create a new one" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ResourceDictionary>
4 changes: 2 additions & 2 deletions ninaAPI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

// [MANDATORY] The assembly versioning
//Should be incremented for each new release build of a plugin
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.0.1")]
[assembly: AssemblyFileVersion("2.0.0.1")]

// [MANDATORY] The name of your plugin
[assembly: AssemblyTitle("Advanced API")]
Expand Down
6 changes: 2 additions & 4 deletions ninaAPI/WebService/V1/WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ public WebSocket(string urlPath) : base(urlPath, true)
public static List<HttpResponse> Images = new List<HttpResponse>();
public static List<HttpResponse> Events = new List<HttpResponse>();

private async void ImageSaved(object sender, ImageSavedEventArgs e)
private void ImageSaved(object sender, ImageSavedEventArgs e)
{
if (!e.MetaData.Image.ImageType.Equals("LIGHT"))
return;

HttpResponse response = new HttpResponse() { Type = HttpResponse.TypeSocket };
e.Image = null;
e.Statistics.Histogram.Clear();

response.Response = new Dictionary<string, object>()
{
Expand All @@ -95,7 +93,7 @@ private async void ImageSaved(object sender, ImageSavedEventArgs e)

Images.Add(response);

await Send(response);
Send(response);
}

private async void LogProcessor_NINALogEventSaved(object sender, NINALogEvent e)
Expand Down
4 changes: 2 additions & 2 deletions ninaAPI/WebService/V2/WebSocketV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public WebSocketV2(string urlPath) : base(urlPath, true)
public static List<HttpResponse> Images = new List<HttpResponse>();
public static List<HttpResponse> Events = new List<HttpResponse>();

private async void ImageSaved(object sender, ImageSavedEventArgs e)
private void ImageSaved(object sender, ImageSavedEventArgs e)
{
if (!e.MetaData.Image.ImageType.Equals("LIGHT"))
return;
Expand Down Expand Up @@ -102,7 +102,7 @@ private async void ImageSaved(object sender, ImageSavedEventArgs e)
Images.Add(response);
Events.Add(imageEvent);

await Send(response);
Send(response);
}

private async void LogProcessor_NINALogEventSaved(object sender, NINALogEvent e)
Expand Down

0 comments on commit 5167cb6

Please sign in to comment.