From 83a546f4ba014fb2b65a7184ab468e13a6d5c135 Mon Sep 17 00:00:00 2001 From: Jeffrey Jones Date: Wed, 17 Nov 2021 22:59:59 +0900 Subject: [PATCH] Update emission commands Update emission commands to the new 0.2.0 format. --- .../Commands/DisableRadarEmissionCommand.cs | 11 +++++------ .../Commands/EnableRadarEmissionCommand.cs | 15 +++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Jupiter.Core/ViewModels/Commands/DisableRadarEmissionCommand.cs b/Jupiter.Core/ViewModels/Commands/DisableRadarEmissionCommand.cs index 1bce277..b0b22df 100644 --- a/Jupiter.Core/ViewModels/Commands/DisableRadarEmissionCommand.cs +++ b/Jupiter.Core/ViewModels/Commands/DisableRadarEmissionCommand.cs @@ -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 { @@ -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) { diff --git a/Jupiter.Core/ViewModels/Commands/EnableRadarEmissionCommand.cs b/Jupiter.Core/ViewModels/Commands/EnableRadarEmissionCommand.cs index a8e133f..62d50e5 100644 --- a/Jupiter.Core/ViewModels/Commands/EnableRadarEmissionCommand.cs +++ b/Jupiter.Core/ViewModels/Commands/EnableRadarEmissionCommand.cs @@ -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) {