diff --git a/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj b/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj
index b50d61617..a35f6590c 100644
--- a/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj
+++ b/src/Artemis.Plugins.Devices.Corsair/Artemis.Plugins.Devices.Corsair.csproj
@@ -72,10 +72,10 @@
-
+
PreserveNewest
-
+
PreserveNewest
diff --git a/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs b/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs
index 6635f8a88..e20f81def 100644
--- a/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs
+++ b/src/Artemis.Plugins.Devices.Corsair/CorsairDevice.cs
@@ -20,8 +20,8 @@ namespace Artemis.Plugins.Devices.Corsair
public override void EnablePlugin()
{
PathHelper.ResolvingAbsolutePath += (sender, args) => ResolveAbsolutePath(typeof(CorsairRGBDevice<>), sender, args);
- CorsairDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "CUESDK.dll"));
- CorsairDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "CUESDK.dll"));
+ CorsairDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "CUESDK.x64_2017.dll"));
+ CorsairDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "CUESDK_2017.dll"));
_rgbService.AddDeviceProvider(DeviceProvider);
}
diff --git a/src/Artemis.Plugins.Devices.Corsair/x64/CUESDK.dll b/src/Artemis.Plugins.Devices.Corsair/x64/CUESDK.x64_2017.dll
similarity index 100%
rename from src/Artemis.Plugins.Devices.Corsair/x64/CUESDK.dll
rename to src/Artemis.Plugins.Devices.Corsair/x64/CUESDK.x64_2017.dll
diff --git a/src/Artemis.Plugins.Devices.Corsair/x86/CUESDK.dll b/src/Artemis.Plugins.Devices.Corsair/x86/CUESDK_2017.dll
similarity index 100%
rename from src/Artemis.Plugins.Devices.Corsair/x86/CUESDK.dll
rename to src/Artemis.Plugins.Devices.Corsair/x86/CUESDK_2017.dll
diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj
index c7650c883..b1c65bcf8 100644
--- a/src/Artemis.UI/Artemis.UI.csproj
+++ b/src/Artemis.UI/Artemis.UI.csproj
@@ -174,6 +174,13 @@
True
Resources.resx
+
+
+
+
+
+
+
@@ -206,6 +213,34 @@
Code
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Artemis.UI/SDK bug b/src/Artemis.UI/SDK bug
new file mode 100644
index 000000000..cbf620a34
--- /dev/null
+++ b/src/Artemis.UI/SDK bug
@@ -0,0 +1,50 @@
+Ok so with the following code:
+
+```cpp
+bool errorCheck(const std::string &msg) {
+ auto error = CorsairGetLastError();
+ if (error != CorsairError::CE_Success) {
+ std::cerr << msg << " (Error: " << toString(error) << ')' << std::endl;
+ return true;
+ }
+
+ return false;
+}
+
+int main(int argc, char *argv[])
+{
+ CorsairPerformProtocolHandshake();
+ if (errorCheck("Handshake error")) {
+ getchar();
+ return -1;
+ }
+
+ const auto devicesCount = CorsairGetDeviceCount();
+ for (int i = 0; i < devicesCount; ++i) {
+ const auto info = CorsairGetDeviceInfo(i);
+ if (!info) {
+ errorCheck("Get device info error");
+ continue;
+ }
+
+ std::cout << "Model: " << info->model << "Logical layout: " << info->logicalLayout << std::endl;
+ }
+
+ getchar();
+ return 0;
+}
+```
+
+I'm getting this output, which is as expected:
+```
+Model: K95 RGB PLATINUMLogical layout: 13
+```
+
+Then when I put the PC to full stand-by and wake it up again the code returns the following:
+```
+Model: K95 RGB PLATINUMLogical layout: 0
+```
+
+Windows 10 Home 1903
+iCUE v. 3.22.74
+SDK: 3.0.301
\ No newline at end of file
diff --git a/src/Artemis.UI/Screens/Module/ModuleRootView.xaml b/src/Artemis.UI/Screens/Module/ModuleRootView.xaml
index 9bd2d971e..0a0582796 100644
--- a/src/Artemis.UI/Screens/Module/ModuleRootView.xaml
+++ b/src/Artemis.UI/Screens/Module/ModuleRootView.xaml
@@ -6,9 +6,11 @@
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:module="clr-namespace:Artemis.UI.Screens.Module"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance module:ModuleRootViewModel}">
+
@@ -17,7 +19,9 @@
-
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs b/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs
index 3cf0b7fe1..a299832c5 100644
--- a/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs
+++ b/src/Artemis.UI/Screens/Module/ModuleRootViewModel.cs
@@ -1,4 +1,5 @@
-using Artemis.Core.Plugins.Abstract;
+using System.Threading.Tasks;
+using Artemis.Core.Plugins.Abstract;
using Artemis.UI.Ninject.Factories;
using Stylet;
@@ -6,21 +7,34 @@ namespace Artemis.UI.Screens.Module
{
public class ModuleRootViewModel : Conductor.Collection.OneActive
{
+ private readonly IProfileEditorViewModelFactory _profileEditorViewModelFactory;
+
public ModuleRootViewModel(Core.Plugins.Abstract.Module module, IProfileEditorViewModelFactory profileEditorViewModelFactory)
{
Module = module;
+ _profileEditorViewModelFactory = profileEditorViewModelFactory;
- // Add the profile editor and module VMs
- var profileEditor = profileEditorViewModelFactory.CreateModuleViewModel(Module);
- Items.Add(profileEditor);
- Items.AddRange(Module.GetViewModels());
-
- // Activate the profile editor
- ActiveItem = profileEditor;
+ Task.Run(AddTabsAsync);
}
public string Title => Module?.DisplayName;
public Core.Plugins.Abstract.Module Module { get; }
public int FixedHeaderCount => Items.Count;
+
+ private async Task AddTabsAsync()
+ {
+ // Give the screen a moment to active without freezing the UI thread
+ await Task.Delay(400);
+
+ // Create the profile editor and module VMs
+ var profileEditor = _profileEditorViewModelFactory.CreateModuleViewModel(Module);
+ var moduleViewModels = Module.GetViewModels();
+
+ Items.Add(profileEditor);
+ Items.AddRange(moduleViewModels);
+
+ // Activate the profile editor
+ ActiveItem = profileEditor;
+ }
}
}
\ No newline at end of file
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml
new file mode 100644
index 000000000..0f7850149
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs
new file mode 100644
index 000000000..b7e1e7e9d
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions
+{
+ public class DisplayConditionViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml
new file mode 100644
index 000000000..b72bf2077
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs
new file mode 100644
index 000000000..7bf9b1a8e
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions
+{
+ class DisplayConditionsViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesView.xaml
new file mode 100644
index 000000000..cc288498f
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesViewModel.cs
new file mode 100644
index 000000000..5f2db30a7
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertiesViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.ElementProperties
+{
+ class ElementPropertiesViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyView.xaml
new file mode 100644
index 000000000..717b0d49b
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyViewModel.cs
new file mode 100644
index 000000000..47b1f5273
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ElementProperties/ElementPropertyViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.ElementProperties
+{
+ public class ElementPropertyViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementView.xaml
new file mode 100644
index 000000000..74cb1b04b
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementViewModel.cs
new file mode 100644
index 000000000..fe46522df
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.LayerElements
+{
+ public class LayerElementViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsView.xaml
new file mode 100644
index 000000000..f0d304dc4
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsViewModel.cs
new file mode 100644
index 000000000..594150b1b
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerElements/LayerElementsViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.LayerElements
+{
+ public class LayerElementsViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersView.xaml
new file mode 100644
index 000000000..af0e8100a
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersViewModel.cs
new file mode 100644
index 000000000..6efa9ec85
--- /dev/null
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Layers/LayersViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Artemis.UI.Screens.Module.ProfileEditor.Layers
+{
+ public class LayersViewModel
+ {
+ }
+}
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorView.xaml
index 5c0285449..21c6f6617 100644
--- a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorView.xaml
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorView.xaml
@@ -17,8 +17,34 @@
+
+
+
@@ -145,7 +171,8 @@
-
+
+
Initializing LED visualization...
diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs
index 99aa9d7c2..31000990c 100644
--- a/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs
+++ b/src/Artemis.UI/Screens/Module/ProfileEditor/ProfileEditorViewModel.cs
@@ -76,7 +76,10 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
{
// Gotta call IsInitializing on the UI thread or its never gets picked up
IsInitializing = true;
- Devices.Add(profileDeviceViewModel);
+ lock (Devices)
+ {
+ Devices.Add(profileDeviceViewModel);
+ }
});
}
// Update existing devices
@@ -87,8 +90,11 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
// Sort the devices by ZIndex
Execute.OnUIThread(() =>
{
- foreach (var device in Devices.OrderBy(d => d.ZIndex).ToList())
- Devices.Move(Devices.IndexOf(device), device.ZIndex - 1);
+ lock (Devices)
+ {
+ foreach (var device in Devices.OrderBy(d => d.ZIndex).ToList())
+ Devices.Move(Devices.IndexOf(device), device.ZIndex - 1);
+ }
});
}
diff --git a/src/Artemis.UI/Screens/RootView.xaml b/src/Artemis.UI/Screens/RootView.xaml
index 12842873b..54360be7e 100644
--- a/src/Artemis.UI/Screens/RootView.xaml
+++ b/src/Artemis.UI/Screens/RootView.xaml
@@ -7,6 +7,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:abstract="clr-namespace:Artemis.Core.Plugins.Abstract;assembly=Artemis.Core"
+ xmlns:screens="clr-namespace:Artemis.UI.Screens"
mc:Ignorable="d"
GlowBrush="{DynamicResource AccentColorBrush}"
FontFamily="{StaticResource DefaultFont}"
@@ -16,6 +17,32 @@
d:DataContext="{d:DesignInstance screens:RootViewModel}"
SaveWindowPosition="True"
Icon="/Artemis.UI;component/Resources/logo-512.png">
+
+
+
@@ -112,34 +139,24 @@
-
+
-
-
+
+
-
+
-
+
-
+
+
diff --git a/src/Artemis.UI/Screens/RootViewModel.cs b/src/Artemis.UI/Screens/RootViewModel.cs
index 0c28c248e..64658c841 100644
--- a/src/Artemis.UI/Screens/RootViewModel.cs
+++ b/src/Artemis.UI/Screens/RootViewModel.cs
@@ -11,11 +11,13 @@ using Artemis.UI.Screens.News;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Screens.SurfaceEditor;
using Artemis.UI.Screens.Workshop;
+using MahApps.Metro.Controls;
+using MaterialDesignThemes.Wpf.Transitions;
using Stylet;
namespace Artemis.UI.Screens
{
- public class RootViewModel : Conductor.Collection.OneActive
+ public class RootViewModel : Conductor
{
private readonly ICollection _artemisViewModels;
private readonly IModuleViewModelFactory _moduleViewModelFactory;
@@ -27,10 +29,9 @@ namespace Artemis.UI.Screens
_pluginService = pluginService;
_moduleViewModelFactory = moduleViewModelFactory;
- // Add the built-in items
- Items.AddRange(artemisViewModels);
// Activate the home item
ActiveItem = _artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel));
+ ActiveItemReady = true;
// Sync up with the plugin service
Modules = new BindableCollection();
@@ -46,18 +47,19 @@ namespace Artemis.UI.Screens
public bool MenuOpen { get; set; }
public ListBoxItem SelectedPage { get; set; }
public Core.Plugins.Abstract.Module SelectedModule { get; set; }
+ public bool ActiveItemReady { get; set; }
public async Task NavigateToSelectedModule()
{
if (SelectedModule == null)
return;
+ MenuOpen = false;
+ SelectedPage = null;
+
// Create a view model for the given plugin info (which will be a module)
var viewModel = await Task.Run(() => _moduleViewModelFactory.CreateModuleViewModel(SelectedModule));
ActivateItem(viewModel);
-
- SelectedPage = null;
- MenuOpen = false;
}
private void PluginServiceOnPluginEnabled(object sender, PluginEventArgs e)
@@ -91,11 +93,18 @@ namespace Artemis.UI.Screens
await NavigateToSelectedModule();
}
- private void OnSelectedPageChanged(object sender, PropertyChangedEventArgs e)
+ private async void OnSelectedPageChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName != "SelectedPage" || SelectedPage == null)
return;
+ SelectedModule = null;
+ MenuOpen = false;
+ ActiveItemReady = false;
+
+ // Let the menu close smoothly to avoid a sluggish feeling
+ await Task.Delay(400);
+
switch (SelectedPage.Name)
{
case "Home":
@@ -115,8 +124,7 @@ namespace Artemis.UI.Screens
break;
}
- SelectedModule = null;
- MenuOpen = false;
+ ActiveItemReady = true;
}
}
}
\ No newline at end of file