File tree 2 files changed +12
-14
lines changed
Jupiter.Core/ViewModels/Commands
2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 2
2
using System . Diagnostics ;
3
3
using System . Windows . Input ;
4
4
using Grpc . Net . Client ;
5
- using RurouniJones . Jupiter . Dcs ;
6
5
7
6
namespace RurouniJones . Jupiter . Core . ViewModels . Commands
8
7
{
@@ -21,14 +20,14 @@ public void Execute(object? parameter)
21
20
Debug . WriteLine ( $ "DisableRadarEmission.Execute called for unit '{ unitName } '") ;
22
21
try
23
22
{
24
- /* using var channel = GrpcChannel.ForAddress($"http://{Global.HostName}:{Global.Port}");
25
- var client = new Units.UnitsClient (channel);
26
- client.EnableEmission (new EnableEmissionRequest
23
+ using var channel = GrpcChannel . ForAddress ( $ "http://{ Global . HostName } :{ Global . Port } ") ;
24
+ var client = new Dcs . Unit . UnitService . UnitServiceClient ( channel ) ;
25
+ client . SetEmissionAsync ( new Dcs . Unit . SetEmissionRequest ( )
27
26
{
28
27
Name = unitName ,
29
- Enabled = false
28
+ Emitting = false
30
29
}
31
- );*/
30
+ ) ;
32
31
}
33
32
catch ( Exception e )
34
33
{
Original file line number Diff line number Diff line change @@ -21,15 +21,14 @@ public void Execute(object? parameter)
21
21
Debug . WriteLine ( $ "EnableRadarEmission.Execute called for unit '{ unitName } '") ;
22
22
try
23
23
{
24
- /*
25
24
using var channel = GrpcChannel . ForAddress ( $ "http://{ Global . HostName } :{ Global . Port } ") ;
26
- var client = new Units.UnitsClient (channel);
27
- client.EnableEmission (new EnableEmissionRequest
28
- {
29
- Name = unitName,
30
- Enabled = true
31
- }
32
- );*/
25
+ var client = new Dcs . Unit . UnitService . UnitServiceClient ( channel ) ;
26
+ client . SetEmissionAsync ( new Dcs . Unit . SetEmissionRequest ( )
27
+ {
28
+ Name = unitName ,
29
+ Emitting = true
30
+ }
31
+ ) ;
33
32
}
34
33
catch ( Exception e )
35
34
{
You can’t perform that action at this time.
0 commit comments