Skip to content

Commit

Permalink
Update emission commands
Browse files Browse the repository at this point in the history
Update emission commands to the new 0.2.0 format.
  • Loading branch information
rurounijones committed Nov 17, 2021
1 parent ed44c8c commit 83a546f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
11 changes: 5 additions & 6 deletions Jupiter.Core/ViewModels/Commands/DisableRadarEmissionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Windows.Input;
using Grpc.Net.Client;
using RurouniJones.Jupiter.Dcs;

namespace RurouniJones.Jupiter.Core.ViewModels.Commands
{
Expand All @@ -21,14 +20,14 @@ public void Execute(object? parameter)
Debug.WriteLine($"DisableRadarEmission.Execute called for unit '{unitName}'");
try
{
/*using var channel = GrpcChannel.ForAddress($"http://{Global.HostName}:{Global.Port}");
var client = new Units.UnitsClient(channel);
client.EnableEmission(new EnableEmissionRequest
using var channel = GrpcChannel.ForAddress($"http://{Global.HostName}:{Global.Port}");
var client = new Dcs.Unit.UnitService.UnitServiceClient(channel);
client.SetEmissionAsync(new Dcs.Unit.SetEmissionRequest()
{
Name = unitName,
Enabled = false
Emitting = false
}
);*/
);
}
catch (Exception e)
{
Expand Down
15 changes: 7 additions & 8 deletions Jupiter.Core/ViewModels/Commands/EnableRadarEmissionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ public void Execute(object? parameter)
Debug.WriteLine($"EnableRadarEmission.Execute called for unit '{unitName}'");
try
{
/*
using var channel = GrpcChannel.ForAddress($"http://{Global.HostName}:{Global.Port}");
var client = new Units.UnitsClient(channel);
client.EnableEmission(new EnableEmissionRequest
{
Name = unitName,
Enabled = true
}
);*/
var client = new Dcs.Unit.UnitService.UnitServiceClient(channel);
client.SetEmissionAsync(new Dcs.Unit.SetEmissionRequest()
{
Name = unitName,
Emitting = true
}
);
}
catch (Exception e)
{
Expand Down

0 comments on commit 83a546f

Please sign in to comment.