Surface - Removed the ArtemisSurface and reworked device loading

This commit is contained in:
Robert committed 2021-02-16 21:46:08 +01:00
1 parent 7ccc9c54fb
commit 056b2bface
50 files changed
+1292 -1506

No files matched your search

@@ -9,12 +9,12 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
{
// I hate this about DI, oh well
public FolderViewModel(ProfileElement folder,
IRgbService rgbService,
IProfileEditorService profileEditorService,
IDialogService dialogService,
IProfileTreeVmFactory profileTreeVmFactory,
ILayerBrushService layerBrushService,
ISurfaceService surfaceService) :
base(folder, profileEditorService, dialogService, profileTreeVmFactory, layerBrushService, surfaceService)
ILayerBrushService layerBrushService) :
base(folder, rgbService, profileEditorService, dialogService, profileTreeVmFactory, layerBrushService)
{
}
@@ -8,12 +8,12 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
public class LayerViewModel : TreeItemViewModel
{
public LayerViewModel(ProfileElement layer,
IRgbService rgbService,
IProfileEditorService profileEditorService,
IDialogService dialogService,
IProfileTreeVmFactory profileTreeVmFactory,
ILayerBrushService layerBrushService,
ISurfaceService surfaceService) :
base(layer, profileEditorService, dialogService, profileTreeVmFactory, layerBrushService, surfaceService)
ILayerBrushService layerBrushService) :
base(layer, rgbService, profileEditorService, dialogService, profileTreeVmFactory, layerBrushService)
{
}
@@ -18,23 +18,23 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
{
private readonly IDialogService _dialogService;
private readonly ILayerBrushService _layerBrushService;
private readonly IRgbService _rgbService;
private readonly IProfileEditorService _profileEditorService;
private readonly IProfileTreeVmFactory _profileTreeVmFactory;
private readonly ISurfaceService _surfaceService;
private ProfileElement _profileElement;
protected TreeItemViewModel(ProfileElement profileElement,
IRgbService rgbService,
IProfileEditorService profileEditorService,
IDialogService dialogService,
IProfileTreeVmFactory profileTreeVmFactory,
ILayerBrushService layerBrushService,
ISurfaceService surfaceService)
ILayerBrushService layerBrushService)
{
_rgbService = rgbService;
_profileEditorService = profileEditorService;
_dialogService = dialogService;
_profileTreeVmFactory = profileTreeVmFactory;
_layerBrushService = layerBrushService;
_surfaceService = surfaceService;
ProfileElement = profileElement;
@@ -144,7 +144,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
if (brush != null)
layer.ChangeLayerBrush(brush);
layer.AddLeds(_surfaceService.ActiveSurface.Devices.SelectMany(d => d.Leds));
layer.AddLeds(_rgbService.EnabledDevices.SelectMany(d => d.Leds));
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.ChangeSelectedProfileElement(layer);
}