diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index be5d7746a..f8040f588 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -82,9 +82,6 @@ ..\packages\RGB.NET.Decorators.0.1.25\lib\net45\RGB.NET.Decorators.dll - - ..\packages\RGB.NET.Devices.Corsair.0.1.25\lib\net45\RGB.NET.Devices.Corsair.dll - ..\packages\RGB.NET.Groups.0.1.25\lib\net45\RGB.NET.Groups.dll @@ -99,8 +96,8 @@ - - ..\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll @@ -145,7 +142,6 @@ - diff --git a/src/Artemis.Core/RGB.NET/GraphicsDecorator.cs b/src/Artemis.Core/RGB.NET/GraphicsDecorator.cs index 9a1103761..ae909234d 100644 --- a/src/Artemis.Core/RGB.NET/GraphicsDecorator.cs +++ b/src/Artemis.Core/RGB.NET/GraphicsDecorator.cs @@ -1,4 +1,5 @@ using System.Drawing; +using System.Linq; using RGB.NET.Core; using RGB.NET.Groups; using Color = RGB.NET.Core.Color; @@ -12,11 +13,10 @@ namespace Artemis.Core.RGB.NET public GraphicsDecorator(ListLedGroup ledGroup) { -// var width = ledGroup.GetLeds().Max(l => l.LedRectangle.X + l.LedRectangle.Width); -// var height = ledGroup.GetLeds().Max(l => l.LedRectangle.Y + l.LedRectangle.Height); - var width = 500; - var height = 500; - _bitmap = new DirectBitmap(width, height); + var width = ledGroup.GetLeds().Max(l => l.AbsoluteLedRectangle.X + l.AbsoluteLedRectangle.Width); + var height = ledGroup.GetLeds().Max(l => l.AbsoluteLedRectangle.Y + l.AbsoluteLedRectangle.Height); + + _bitmap = new DirectBitmap((int) width, (int) height); } public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color) diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs index db0a1be6a..19915612e 100644 --- a/src/Artemis.Core/Services/CoreService.cs +++ b/src/Artemis.Core/Services/CoreService.cs @@ -40,7 +40,6 @@ namespace Artemis.Core.Services // Initialize the services await Task.Run(() => _pluginService.LoadPlugins()); - await _rgbService.LoadDevices(); OnInitialized(); } @@ -61,7 +60,7 @@ namespace Artemis.Core.Services // Render all active modules using (var g = _rgbService.GraphicsDecorator.GetGraphics()) { - g.Clear(Color.Red); + g.Clear(Color.Black); foreach (var module in modules) module.Render(args.DeltaTime, _rgbService.Surface, g); diff --git a/src/Artemis.Core/Services/Interfaces/IRgbService.cs b/src/Artemis.Core/Services/Interfaces/IRgbService.cs index ed52287cb..9a4d3a185 100644 --- a/src/Artemis.Core/Services/Interfaces/IRgbService.cs +++ b/src/Artemis.Core/Services/Interfaces/IRgbService.cs @@ -1,5 +1,4 @@ using System; -using System.Threading.Tasks; using Artemis.Core.Events; using Artemis.Core.RGB.NET; using RGB.NET.Core; @@ -8,10 +7,9 @@ namespace Artemis.Core.Services.Interfaces { public interface IRgbService : IArtemisService { - bool LoadingDevices { get; } RGBSurface Surface { get; set; } GraphicsDecorator GraphicsDecorator { get; } - Task LoadDevices(); + void AddDeviceProvider(IRGBDeviceProvider deviceProvider); void Dispose(); /// @@ -23,15 +21,5 @@ namespace Artemis.Core.Services.Interfaces /// Occurs when a single device has reloaded /// event EventHandler DeviceReloaded; - - /// - /// Occurs when loading all devices has started - /// - event EventHandler StartingLoadingDevices; - - /// - /// Occurs when loading all devices has finished - /// - event EventHandler FinishedLoadedDevices; } } \ No newline at end of file diff --git a/src/Artemis.Core/Services/RgbService.cs b/src/Artemis.Core/Services/RgbService.cs index ca4fe8a03..372bbcdb2 100644 --- a/src/Artemis.Core/Services/RgbService.cs +++ b/src/Artemis.Core/Services/RgbService.cs @@ -6,7 +6,6 @@ using Artemis.Core.RGB.NET; using Artemis.Core.Services.Interfaces; using RGB.NET.Brushes; using RGB.NET.Core; -using RGB.NET.Devices.Corsair; using RGB.NET.Groups; namespace Artemis.Core.Services @@ -39,49 +38,30 @@ namespace Artemis.Core.Services public RGBSurface Surface { get; set; } public GraphicsDecorator GraphicsDecorator { get; private set; } - - /// - public async Task LoadDevices() + + public void AddDeviceProvider(IRGBDeviceProvider deviceProvider) { - OnStartedLoadingDevices(); + Surface.LoadDevices(deviceProvider); + Surface.AlignDevices(); - await Task.Run(() => - { - // TODO SpoinkyNL 8-1-18: Keep settings into account - // This one doesn't work well without ASUS devices installed - // Surface.LoadDevices(AsusDeviceProvider.Instance); - // Surface.LoadDevices(CoolerMasterDeviceProvider.Instance); - Surface.LoadDevices(CorsairDeviceProvider.Instance); - // Surface.LoadDevices(DMXDeviceProvider.Instance); - // Surface.LoadDevices(LogitechDeviceProvider.Instance); - // Surface.LoadDevices(MsiDeviceProvider.Instance); - // Surface.LoadDevices(NovationDeviceProvider.Instance); - // Surface.LoadDevices(RazerDeviceProvider.Instance); + lock (_loadedDevices) + { + foreach (var surfaceDevice in deviceProvider.Devices) + { + if (!_loadedDevices.Contains(surfaceDevice)) + { + _loadedDevices.Add(surfaceDevice); + OnDeviceLoaded(new DeviceEventArgs(surfaceDevice)); + } + else + OnDeviceReloaded(new DeviceEventArgs(surfaceDevice)); + } + } - // TODO SpoinkyNL 8-1-18: Load alignment - Surface.AlignDevices(); - - lock (_loadedDevices) - { - foreach (var surfaceDevice in Surface.Devices) - { - if (!_loadedDevices.Contains(surfaceDevice)) - { - _loadedDevices.Add(surfaceDevice); - OnDeviceLoaded(new DeviceEventArgs(surfaceDevice)); - } - else - OnDeviceReloaded(new DeviceEventArgs(surfaceDevice)); - } - } - }); - - // Apply the application wide brush and decorator - var background = new ListLedGroup(Surface.Leds) {Brush = new SolidColorBrush(new Color(255, 255, 255, 255))}; - GraphicsDecorator = new GraphicsDecorator(background); - background.Brush.AddDecorator(GraphicsDecorator); - - OnFinishedLoadedDevices(); + // Apply the application wide brush and decorator + var background = new ListLedGroup(Surface.Leds) { Brush = new SolidColorBrush(new Color(255, 255, 255, 255)) }; + GraphicsDecorator = new GraphicsDecorator(background); + background.Brush.AddDecorator(GraphicsDecorator); } public void Dispose() @@ -101,8 +81,6 @@ namespace Artemis.Core.Services public event EventHandler DeviceLoaded; public event EventHandler DeviceReloaded; - public event EventHandler StartingLoadingDevices; - public event EventHandler FinishedLoadedDevices; private void OnDeviceLoaded(DeviceEventArgs e) { @@ -113,19 +91,7 @@ namespace Artemis.Core.Services { DeviceReloaded?.Invoke(this, e); } - - private void OnStartedLoadingDevices() - { - LoadingDevices = true; - StartingLoadingDevices?.Invoke(this, EventArgs.Empty); - } - - private void OnFinishedLoadedDevices() - { - LoadingDevices = false; - FinishedLoadedDevices?.Invoke(this, EventArgs.Empty); - } - + #endregion } } \ No newline at end of file diff --git a/src/Artemis.Core/packages.config b/src/Artemis.Core/packages.config index 4c44ad240..e060ef6e0 100644 --- a/src/Artemis.Core/packages.config +++ b/src/Artemis.Core/packages.config @@ -10,9 +10,8 @@ - - + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj b/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj new file mode 100644 index 000000000..17c81f079 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj @@ -0,0 +1,85 @@ + + + + + Debug + AnyCPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D} + Library + Properties + Artemis.Plugins.Devices.Corsair + Artemis.Plugins.Devices.Corsair + v4.7.2 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll + False + + + ..\packages\RGB.NET.Devices.Corsair.0.1.25\lib\net45\RGB.NET.Devices.Corsair.dll + + + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + False + + + + + + + + + + + + + + + {9B811F9B-86B9-4771-87AF-72BAE7078A36} + Artemis.Core + False + + + + + + + PreserveNewest + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + (robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /E /NFL /NDL /NJH /NJS /nc /ns /np) ^& IF %25ERRORLEVEL%25 LEQ 4 exit /B 0 + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs b/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs new file mode 100644 index 000000000..6fc3c11e2 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs @@ -0,0 +1,41 @@ +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using Artemis.Core.Plugins.Abstract; +using Artemis.Core.Plugins.Models; +using Artemis.Core.Services.Interfaces; +using RGB.NET.Devices.Corsair; + +namespace Artemis.Plugins.Devices.Corsair +{ + // ReSharper disable once UnusedMember.Global + public class CorsairDevice : Device + { + private readonly IRgbService _rgbService; + + public CorsairDevice(PluginInfo pluginInfo, IRgbService rgbService) : base(pluginInfo) + { + _rgbService = rgbService; + } + + public override void EnablePlugin() + { + CorsairDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "CUESDK.dll")); + CorsairDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "CUESDK.dll")); + _rgbService.AddDeviceProvider(CorsairDeviceProvider.Instance); + } + + public override void DisablePlugin() + { + // TODO: Remove the device provider from the surface + } + + public override void Dispose() + { + // TODO: This will probably not go well without first removing the device provider + // CorsairDeviceProvider.Instance.ResetDevices(); + // CorsairDeviceProvider.Instance.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Corsair/Properties/AssemblyInfo.cs b/src/Artemis.Plugins.Devices.Corsair/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..837eaee2f --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Artemis.Plugins.Devices.CorsairDevice")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Artemis.Plugins.Devices.CorsairDevice")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a779b2f8-c253-4c4b-8634-6eb8f594e96d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Artemis.Plugins.Devices.Corsair/app.config b/src/Artemis.Plugins.Devices.Corsair/app.config new file mode 100644 index 000000000..ee2d2a7c2 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Corsair/packages.config b/src/Artemis.Plugins.Devices.Corsair/packages.config new file mode 100644 index 000000000..da764fca9 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Corsair/plugin.json b/src/Artemis.Plugins.Devices.Corsair/plugin.json new file mode 100644 index 000000000..82afc1e32 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Corsair/plugin.json @@ -0,0 +1,10 @@ +{ + "Guid": "926629ab-8170-42f3-be18-22c694aa91cd", + "Name": "Corsair Devices", + "Version": { + "Major": 1, + "Minor": 0, + "Build": 0 + }, + "Main": "Artemis.Plugins.Devices.Corsair.dll" +} diff --git a/src/Artemis.Plugins.LayerTypes.Brush/Artemis.Plugins.LayerTypes.Brush.csproj b/src/Artemis.Plugins.LayerTypes.Brush/Artemis.Plugins.LayerTypes.Brush.csproj index c75ff6124..fad0435d5 100644 --- a/src/Artemis.Plugins.LayerTypes.Brush/Artemis.Plugins.LayerTypes.Brush.csproj +++ b/src/Artemis.Plugins.LayerTypes.Brush/Artemis.Plugins.LayerTypes.Brush.csproj @@ -48,8 +48,9 @@ - - ..\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + False @@ -84,6 +85,6 @@ - (robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /NFL /NDL /NJH /NJS /nc /ns /np) ^& IF %25ERRORLEVEL%25 LEQ 4 exit /B 0 + (robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /E /NFL /NDL /NJH /NJS /nc /ns /np) ^& IF %25ERRORLEVEL%25 LEQ 4 exit /B 0 \ No newline at end of file diff --git a/src/Artemis.Plugins.LayerTypes.Brush/app.config b/src/Artemis.Plugins.LayerTypes.Brush/app.config index 552bc9380..d05a8de20 100644 --- a/src/Artemis.Plugins.LayerTypes.Brush/app.config +++ b/src/Artemis.Plugins.LayerTypes.Brush/app.config @@ -6,6 +6,10 @@ + + + + diff --git a/src/Artemis.Plugins.LayerTypes.Brush/packages.config b/src/Artemis.Plugins.LayerTypes.Brush/packages.config index 9bae427f8..177f104ab 100644 --- a/src/Artemis.Plugins.LayerTypes.Brush/packages.config +++ b/src/Artemis.Plugins.LayerTypes.Brush/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj b/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj index df3fb150e..fdeb10fc3 100644 --- a/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj +++ b/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj @@ -52,8 +52,9 @@ ..\packages\System.Drawing.Common.4.5.0\lib\net461\System.Drawing.Common.dll False - - ..\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + False @@ -67,6 +68,7 @@ + @@ -92,6 +94,6 @@ - (robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /NFL /NDL /NJH /NJS /nc /ns /np) ^& IF %25ERRORLEVEL%25 LEQ 4 exit /B 0 + (robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /E /NFL /NDL /NJH /NJS /nc /ns /np) ^& IF %25ERRORLEVEL%25 LEQ 4 exit /B 0 \ No newline at end of file diff --git a/src/Artemis.Core/UtilitiesRemoveMe.cs b/src/Artemis.Plugins.Modules.General/ColorHelpers.cs similarity index 75% rename from src/Artemis.Core/UtilitiesRemoveMe.cs rename to src/Artemis.Plugins.Modules.General/ColorHelpers.cs index 455944d7d..a4ec05f5a 100644 --- a/src/Artemis.Core/UtilitiesRemoveMe.cs +++ b/src/Artemis.Plugins.Modules.General/ColorHelpers.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -namespace Artemis.Core +namespace Artemis.Plugins.Modules.General { public static class ColorHelpers { @@ -29,22 +29,6 @@ namespace Artemis.Core return returnColor; } - public static Color GetRandomRainbowMediaColor() - { - var colors = new List(); - for (var i = 0; i < 3; i++) - colors.Add((byte) _rand.Next(0, 256)); - - var highest = colors.Max(); - var lowest = colors.Min(); - colors[colors.FindIndex(c => c == highest)] = 255; - colors[colors.FindIndex(c => c == lowest)] = 0; - - var returnColor = Color.FromArgb(255, colors[0], colors[1], colors[2]); - - return returnColor; - } - public static Color ShiftColor(Color c, int shiftAmount) { int newRed = c.R; @@ -79,12 +63,7 @@ namespace Artemis.Core private static int BringIntInColorRange(int i) { - if (i < 0) - return 0; - if (i > 255) - return 255; - - return i; + return Math.Min(255, Math.Max(0, i)); } } } \ No newline at end of file diff --git a/src/Artemis.Plugins.Modules.General/GeneralModule.cs b/src/Artemis.Plugins.Modules.General/GeneralModule.cs index beddcd704..7e4db098d 100644 --- a/src/Artemis.Plugins.Modules.General/GeneralModule.cs +++ b/src/Artemis.Plugins.Modules.General/GeneralModule.cs @@ -19,6 +19,7 @@ namespace Artemis.Plugins.Modules.General private readonly PluginSettings _settings; private readonly RGBSurface _surface; private Dictionary _colors; + private double _circlePosition; public GeneralModule(PluginInfo pluginInfo, IRgbService rgbService, PluginSettings settings) : base(pluginInfo) { @@ -28,8 +29,9 @@ namespace Artemis.Plugins.Modules.General _surface = rgbService.Surface; _colors = new Dictionary(); - - rgbService.FinishedLoadedDevices += (sender, args) => PopulateColors(); + + rgbService.DeviceLoaded += (sender, args) => PopulateColors(); + rgbService.DeviceReloaded += (sender, args) => PopulateColors(); var testSetting = _settings.GetSetting("TestSetting", DateTime.Now); } @@ -55,6 +57,14 @@ namespace Artemis.Plugins.Modules.General public override void Render(double deltaTime, RGBSurface surface, Graphics graphics) { + _circlePosition += deltaTime * 200; + if (_circlePosition > 500) + _circlePosition = -200; + var rect = new Rectangle((int) _circlePosition * 4, 0 , 200, 200); + graphics.FillEllipse(new SolidBrush(Color.Blue), rect); + return; + + // Lets do this in the least performant way possible foreach (var surfaceLed in _surface.Leds) { if (!_colors.ContainsKey(surfaceLed)) diff --git a/src/Artemis.Plugins.Modules.General/app.config b/src/Artemis.Plugins.Modules.General/app.config index 552bc9380..d05a8de20 100644 --- a/src/Artemis.Plugins.Modules.General/app.config +++ b/src/Artemis.Plugins.Modules.General/app.config @@ -6,6 +6,10 @@ + + + + diff --git a/src/Artemis.Plugins.Modules.General/packages.config b/src/Artemis.Plugins.Modules.General/packages.config index bc59d252d..651f46fbb 100644 --- a/src/Artemis.Plugins.Modules.General/packages.config +++ b/src/Artemis.Plugins.Modules.General/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index a997aa09b..bfe22e6ac 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -108,9 +108,6 @@ ..\packages\RGB.NET.Decorators.0.1.25\lib\net45\RGB.NET.Decorators.dll - - ..\packages\RGB.NET.Devices.Corsair.0.1.25\lib\net45\RGB.NET.Devices.Corsair.dll - ..\packages\RGB.NET.Groups.0.1.25\lib\net45\RGB.NET.Groups.dll @@ -309,13 +306,11 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - diff --git a/src/Artemis.UI/ViewModels/Controls/RgbDevice/RgbLedViewModel.cs b/src/Artemis.UI/ViewModels/Controls/RgbDevice/RgbLedViewModel.cs index 16d5904fd..29f5745c4 100644 --- a/src/Artemis.UI/ViewModels/Controls/RgbDevice/RgbLedViewModel.cs +++ b/src/Artemis.UI/ViewModels/Controls/RgbDevice/RgbLedViewModel.cs @@ -71,13 +71,37 @@ namespace Artemis.UI.ViewModels.Controls.RgbDevice public void Update() { - FillColor = Color.FromRgb((byte) Math.Round(255 * Led.Color.R), (byte) Math.Round(255 * Led.Color.G), (byte) Math.Round(255 * Led.Color.B)); - X = Led.LedRectangle.X; - Y = Led.LedRectangle.Y; - Width = Led.LedRectangle.Width; - Height = Led.LedRectangle.Height; + // Not leveraging on OnPropertyChanged since that'll update for each updated property + var changed = false; - if (DisplayDrawing != null) + var newFillColor = Color.FromRgb((byte) Math.Round(255 * Led.Color.R), (byte) Math.Round(255 * Led.Color.G), (byte) Math.Round(255 * Led.Color.B)); + if (!newFillColor.Equals(FillColor)) + { + FillColor = newFillColor; + changed = true; + } + if (Math.Abs(Led.LedRectangle.X - X) > 0.1) + { + X = Led.LedRectangle.X; + changed = true; + } + if (Math.Abs(Led.LedRectangle.Y - Y) > 0.1) + { + Y = Led.LedRectangle.Y; + changed = true; + } + if (Math.Abs(Led.LedRectangle.Width - Width) > 0.1) + { + Width = Led.LedRectangle.Width; + changed = true; + } + if (Math.Abs(Led.LedRectangle.Height - Height) > 0.1) + { + Height = Led.LedRectangle.Height; + changed = true; + } + + if (DisplayDrawing != null && changed) { Execute.OnUIThread(() => { diff --git a/src/Artemis.UI/ViewModels/Screens/RootViewModel.cs b/src/Artemis.UI/ViewModels/Screens/RootViewModel.cs index eb2addcd5..f360e80cb 100644 --- a/src/Artemis.UI/ViewModels/Screens/RootViewModel.cs +++ b/src/Artemis.UI/ViewModels/Screens/RootViewModel.cs @@ -28,7 +28,7 @@ namespace Artemis.UI.ViewModels.Screens // Sync up with the plugin service Modules = new BindableCollection(); - Modules.AddRange(_pluginService.GetPluginsOfType()); + // Modules.AddRange(_pluginService.GetPluginsOfType()); _pluginService.PluginEnabled += PluginServiceOnPluginEnabled; _pluginService.PluginDisabled += PluginServiceOnPluginDisabled; diff --git a/src/Artemis.UI/packages.config b/src/Artemis.UI/packages.config index a5a3637f3..a83696401 100644 --- a/src/Artemis.UI/packages.config +++ b/src/Artemis.UI/packages.config @@ -17,9 +17,7 @@ - - diff --git a/src/Artemis.sln b/src/Artemis.sln index fafe33bcb..9e17bca28 100644 --- a/src/Artemis.sln +++ b/src/Artemis.sln @@ -7,6 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.UI", "Artemis.UI\Ar ProjectSection(ProjectDependencies) = postProject {E592F239-FAA0-4840-9C85-46E5867D06D5} = {E592F239-FAA0-4840-9C85-46E5867D06D5} {0F288A66-6EB0-4589-8595-E33A3A3EAEA2} = {0F288A66-6EB0-4589-8595-E33A3A3EAEA2} + {A779B2F8-C253-4C4B-8634-6EB8F594E96D} = {A779B2F8-C253-4C4B-8634-6EB8F594E96D} EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Storage", "Artemis.Storage\Artemis.Storage.csproj", "{E489E5E3-1A65-4AF5-A1EA-F9805FD19A65}" @@ -19,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.Modules.Gen EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.LayerTypes.Brush", "Artemis.Plugins.LayerTypes.Brush\Artemis.Plugins.LayerTypes.Brush.csproj", "{0F288A66-6EB0-4589-8595-E33A3A3EAEA2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.Devices.Corsair", "Artemis.Plugins.Devices.Corsair\Artemis.Plugins.Devices.Corsair.csproj", "{A779B2F8-C253-4C4B-8634-6EB8F594E96D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -67,6 +70,14 @@ Global {0F288A66-6EB0-4589-8595-E33A3A3EAEA2}.Release|Any CPU.Build.0 = Release|Any CPU {0F288A66-6EB0-4589-8595-E33A3A3EAEA2}.Release|x64.ActiveCfg = Release|Any CPU {0F288A66-6EB0-4589-8595-E33A3A3EAEA2}.Release|x64.Build.0 = Release|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Debug|x64.ActiveCfg = Debug|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Debug|x64.Build.0 = Debug|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Release|Any CPU.Build.0 = Release|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Release|x64.ActiveCfg = Release|Any CPU + {A779B2F8-C253-4C4B-8634-6EB8F594E96D}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -74,6 +85,7 @@ Global GlobalSection(NestedProjects) = preSolution {E592F239-FAA0-4840-9C85-46E5867D06D5} = {E830A02B-A7E5-4A6B-943F-76B0A542630C} {0F288A66-6EB0-4589-8595-E33A3A3EAEA2} = {E830A02B-A7E5-4A6B-943F-76B0A542630C} + {A779B2F8-C253-4C4B-8634-6EB8F594E96D} = {E830A02B-A7E5-4A6B-943F-76B0A542630C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C203080A-4473-4CC2-844B-F552EA43D66A}