Implemented layer LED assignment

Added a centralised ProfileEditorSurface for communication between VMs
Prefixed Surface, Device and Led with Artemis to differentiate them better
This commit is contained in:
Robert committed 2019-11-29 17:37:22 +01:00
1 parent 8a596f1426
commit f32edcf502
50 files changed
+556 -662

No files matched your search

@@ -11,15 +11,15 @@ using Rectangle = System.Drawing.Rectangle;
namespace Artemis.Core.Models.Surface
{
public class Device : PropertyChangedBase
public class ArtemisDevice : PropertyChangedBase
{
internal Device(IRGBDevice rgbDevice, Plugin plugin, Surface surface)
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface)
{
RgbDevice = rgbDevice;
Plugin = plugin;
Surface = surface;
DeviceEntity = new DeviceEntity();
Leds = rgbDevice.Select(l => new DeviceLed(l, this)).ToList().AsReadOnly();
Leds = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
Rotation = 0;
Scale = 1;
@@ -29,13 +29,13 @@ namespace Artemis.Core.Models.Surface
CalculateRenderProperties();
}
internal Device(IRGBDevice rgbDevice, Plugin plugin, Surface surface, DeviceEntity deviceEntity)
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface, DeviceEntity deviceEntity)
{
RgbDevice = rgbDevice;
Plugin = plugin;
Surface = surface;
DeviceEntity = deviceEntity;
Leds = rgbDevice.Select(l => new DeviceLed(l, this)).ToList().AsReadOnly();
Leds = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
}
public Rectangle RenderRectangle { get; private set; }
@@ -43,9 +43,9 @@ namespace Artemis.Core.Models.Surface
public IRGBDevice RgbDevice { get; }
public Plugin Plugin { get; }
public Surface Surface { get; }
public ArtemisSurface Surface { get; }
public DeviceEntity DeviceEntity { get; }
public ReadOnlyCollection<DeviceLed> Leds { get; set; }
public ReadOnlyCollection<ArtemisLed> Leds { get; set; }
public double X
{
@@ -5,9 +5,9 @@ using Rectangle = System.Drawing.Rectangle;
namespace Artemis.Core.Models.Surface
{
public class DeviceLed : PropertyChangedBase
public class ArtemisLed : PropertyChangedBase
{
public DeviceLed(Led led, Device device)
public ArtemisLed(Led led, ArtemisDevice device)
{
RgbLed = led;
Device = device;
@@ -15,7 +15,7 @@ namespace Artemis.Core.Models.Surface
}
public Led RgbLed { get; }
public Device Device { get; }
public ArtemisDevice Device { get; }
public Rectangle RenderRectangle { get; private set; }
public Rectangle AbsoluteRenderRectangle { get; private set; }
@@ -7,9 +7,9 @@ using Stylet;
namespace Artemis.Core.Models.Surface
{
public class Surface : PropertyChangedBase
public class ArtemisSurface : PropertyChangedBase
{
internal Surface(RGBSurface rgbSurface, string name, double scale)
internal ArtemisSurface(RGBSurface rgbSurface, string name, double scale)
{
SurfaceEntity = new SurfaceEntity {DeviceEntities = new List<DeviceEntity>()};
EntityId = Guid.NewGuid();
@@ -20,12 +20,12 @@ namespace Artemis.Core.Models.Surface
IsActive = false;
// Devices are not populated here but as they are detected
Devices = new List<Device>();
Devices = new List<ArtemisDevice>();
ApplyToEntity();
}
internal Surface(RGBSurface rgbSurface, SurfaceEntity surfaceEntity, double scale)
internal ArtemisSurface(RGBSurface rgbSurface, SurfaceEntity surfaceEntity, double scale)
{
SurfaceEntity = surfaceEntity;
EntityId = surfaceEntity.Id;
@@ -36,14 +36,14 @@ namespace Artemis.Core.Models.Surface
IsActive = surfaceEntity.IsActive;
// Devices are not populated here but as they are detected
Devices = new List<Device>();
Devices = new List<ArtemisDevice>();
}
public RGBSurface RgbSurface { get; }
public double Scale { get; private set; }
public string Name { get; set; }
public bool IsActive { get; internal set; }
public List<Device> Devices { get; internal set; }
public List<ArtemisDevice> Devices { get; internal set; }
internal SurfaceEntity SurfaceEntity { get; set; }
internal Guid EntityId { get; set; }