RGB.NET - Updated for latest development branch

This commit is contained in:
Robert committed 2021-02-07 22:29:30 +01:00
1 parent 81b8f5bf48
commit 606c1b80f2
13 files changed
+77 -29

No files matched your search

@@ -35,7 +35,7 @@ namespace Artemis.UI.Screens.Settings.Debug
}
}
public bool CanOpenImageDirectory => Device.RgbDevice.DeviceInfo.Image != null;
public bool CanOpenImageDirectory => Device.Layout?.Image != null;
// ReSharper disable UnusedMember.Global
@@ -70,7 +70,7 @@ namespace Artemis.UI.Screens.Settings.Debug
try
{
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.GetDirectoryName(Device.RgbDevice.DeviceInfo.Image.AbsolutePath));
Process.Start(Environment.GetEnvironmentVariable("WINDIR") + @"\explorer.exe", Path.GetDirectoryName(Device.Layout.Image.AbsolutePath));
}
catch (Exception e)
{
@@ -14,9 +14,10 @@ namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
{
private readonly IInputService _inputService;
private readonly IMessageService _messageService;
private readonly IRgbService _rgbService;
private readonly ListLedGroup _ledGroup;
public SurfaceDeviceDetectInputViewModel(ArtemisDevice device, IInputService inputService, IMessageService messageService)
public SurfaceDeviceDetectInputViewModel(ArtemisDevice device, IInputService inputService, IMessageService messageService, IRgbService rgbService)
{
Device = device;
Title = $"{Device.RgbDevice.DeviceInfo.DeviceName} - Detect input";
@@ -24,11 +25,12 @@ namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
_inputService = inputService;
_messageService = messageService;
_rgbService = rgbService;
_inputService.IdentifyDevice(Device);
_inputService.DeviceIdentified += InputServiceOnDeviceIdentified;
// Create a LED group way at the top
_ledGroup = new ListLedGroup(Device.Leds.Select(l => l.RgbLed))
_ledGroup = new ListLedGroup(_rgbService.Surface, Device.Leds.Select(l => l.RgbLed))
{
Brush = new SolidColorBrush(new Color(255, 255, 0)),
ZIndex = 999
@@ -43,7 +45,7 @@ namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
{
base.OnDialogClosed(sender, e);
_inputService.DeviceIdentified -= InputServiceOnDeviceIdentified;
_ledGroup.Detach();
_ledGroup.Detach(_rgbService.Surface);
}
private void InputServiceOnDeviceIdentified(object sender, EventArgs e)