mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Implemented devices and LEDs in profile editor
This commit is contained in:
1 parent
83b9e5ce1a
commit
993ac1d595
13 files changed
+402
-49
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
using System.Windows;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.ProfileEditor
|
||||
@@ -8,18 +9,44 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
|
||||
{
|
||||
private readonly List<ProfileLedViewModel> _leds;
|
||||
|
||||
public ProfileDeviceViewModel(IRGBDevice device)
|
||||
public ProfileDeviceViewModel(Device device)
|
||||
{
|
||||
Device = device;
|
||||
_leds = new List<ProfileLedViewModel>();
|
||||
|
||||
foreach (var led in Device)
|
||||
_leds.Add(new ProfileLedViewModel(led));
|
||||
if (Device.RgbDevice != null)
|
||||
{
|
||||
foreach (var led in Device.RgbDevice)
|
||||
_leds.Add(new ProfileLedViewModel(led));
|
||||
}
|
||||
}
|
||||
|
||||
public Device Device { get; set; }
|
||||
|
||||
public double X
|
||||
{
|
||||
get => Device.X;
|
||||
set => Device.X = value;
|
||||
}
|
||||
|
||||
public double Y
|
||||
{
|
||||
get => Device.Y;
|
||||
set => Device.Y = value;
|
||||
}
|
||||
|
||||
public int ZIndex
|
||||
{
|
||||
get => Device.ZIndex;
|
||||
set => Device.ZIndex = value;
|
||||
}
|
||||
|
||||
public IRGBDevice Device { get; }
|
||||
public IReadOnlyCollection<ProfileLedViewModel> Leds => _leds.AsReadOnly();
|
||||
|
||||
public Rect DeviceRectangle => Device.RgbDevice == null
|
||||
? new Rect()
|
||||
: new Rect(X, Y, Device.RgbDevice.Size.Width, Device.RgbDevice.Size.Height);
|
||||
|
||||
public void Update()
|
||||
{
|
||||
foreach (var ledViewModel in _leds)
|
||||
|
||||
Reference in new issue
Block a user