From 48d9879645ee76fce26ad3b4a078ababb936fee8 Mon Sep 17 00:00:00 2001 From: conorm125 Date: Tue, 27 Oct 2020 20:07:26 +0000 Subject: [PATCH] added bsic config file --- .vs/RGBController2/v16/.suo | Bin 130560 -> 148992 bytes RGBController2/Boards/ArduinoBoard.cs | 7 +- RGBController2/Boards/CUEDeviceBoard.cs | 141 ++++++++++++++++++ RGBController2/Boards/IBoards.cs | 2 + RGBController2/RGBController2.csproj | 13 ++ RGBController2/RGBController2.csproj.user | 3 + .../LightingModes/StaticViewModel.cs | 12 +- RGBController2/ViewModels/MainViewModel.cs | 108 +++++++++++++- RGBController2/ViewModels/Tabs/ArduinoTab.cs | 15 +- .../ViewModels/Tabs/CUEDeviceTab.cs | 98 ++++++++++++ RGBController2/ViewModels/Tabs/ITab.cs | 3 +- RGBController2/ViewModels/Tabs/Tab.cs | 15 ++ .../Views/Dialogs/NewTabDialogView.xaml | 5 +- .../Views/LightingModes/StaticView.xaml | 1 + .../Views/LightingModes/StaticView.xaml.cs | 2 +- RGBController2/Views/MainWindow.xaml | 5 +- RGBController2/Views/MainWindow.xaml.cs | 4 +- .../Views/Tabs/CUEDeviceTabView.xaml | 23 +++ .../Views/Tabs/CUEDeviceTabView.xaml.cs | 29 ++++ .../netcoreapp3.1/RGBController2.assets.cache | Bin 12182 -> 12877 bytes ...RGBController2.csproj.FileListAbsolute.txt | 69 +++++---- ...BController2.csprojAssemblyReference.cache | Bin 424 -> 137575 bytes .../RGBController2.designer.deps.json | 15 ++ .../RGBController2_MarkupCompile.i.cache | 10 +- .../RGBController2.csproj.nuget.dgspec.json | 4 + .../obj/RGBController2.csproj.nuget.g.targets | 3 + RGBController2/obj/project.assets.json | 43 ++++++ 27 files changed, 561 insertions(+), 69 deletions(-) create mode 100644 RGBController2/Boards/CUEDeviceBoard.cs create mode 100644 RGBController2/ViewModels/Tabs/CUEDeviceTab.cs create mode 100644 RGBController2/Views/Tabs/CUEDeviceTabView.xaml create mode 100644 RGBController2/Views/Tabs/CUEDeviceTabView.xaml.cs diff --git a/.vs/RGBController2/v16/.suo b/.vs/RGBController2/v16/.suo index 5e5e530d8c9133e21d3329a867937e0d0e569011..15e1dcd6987f3de40e34b1e7590ccc83cab91a82 100644 GIT binary patch literal 148992 zcmeHQ31Ae}`JW9Ch!)tyb}@SJjsP?>94VcXqNnGrPHVVJ7+Zy_xss-S2zf z`@Zjev-$bGw{7^@fv-!tYlbvJ`rnQmDO>Y=1pHazew-u~z&{f3za2Yv@G--40TTdt zWM3K30t=)7{=(?DTFDPLDD|TEtY71$QIWnbHF<6Q6(@|kO< zQay5Shp$#zWs*v4@OUZ9aUvd#02qa5EVz8{Q24(EpkG{txStHD1so4J2#^n8_|M=H&rDPA%izueF;BxF$ z0azFI?G(U%>izz3nNAVhJyC`^aE}5U3#bM#>=3y1s(&opnX3OdxYGgi)cea+w-Ig= zV1atyqPh#=E>`_+)n)otuFg2|IZc)UmIHi%E`T2p0CWRR2Lu5er(r-3Uz?p!H0W8x{&i~CDpE&Xs%>QQOy@?gVCC2|y&i{Kb1_pBeb9@{CV0*Go zX4fp_Kb-UbHz?q~>ilP!d5y+1fd@FR3A6Ex^M5Y@;}8dM{#OEszW9vue|JCwK+J#Q zV(t7NkNR@{{{?Uufba2QA23fsy!p>K2P4ians>elKj%NgIR7UBIRAOCy~OOJu-@5Qx`dcR2X{Fkc#B)H!OoD6URP63<> zSPD1|-~zM)+5k+?1GgQ}0r-ykOyo1r?pa9xY_!KYfO7%o0nP_p09XgO5b#}q7!OAI zUyXRz0ImgG2e=-<_pDsEBJOQ~+W~hZ@t&2m?Ks9QV5R>_FI^0{1aK+fGQj14D*#sl zZU7|e{~Hl@6X0gREr9OskC=@C?mxuZYPJ5` zQ2rm1_{LQQN;UxMwhJp^5U$mIkMg!89gO^$?|yh-HUDYof0mh73-S#i-+8EO2qUps z>Xi3jVax}POw!dx7wR8F3mC-}VN;PmX(?Xy$hjGmd@pu0Mc9p%V7ym=vr-8vrxt%@ zGPR?`jrW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PkSiAg$A~Ca2|a!}Xx*djdlHc;dh5LEhnEe!gK| z9>IRTJ|13Pp`IQ=VO~KVo}NLTA-z4r!^1;-W)ufRW#y%YXH81a3oPbk_CotAbr&4h zIX_{Xe{u2j@F1U%P#>=_kKX=%!5+T8K0zM6gZ;fcy!?B4dHRO=hX#ds%_zoj5h!G& zCrkZ%gO z!m89=aih&`gz+suVlu4TeIN3H&vts;6@TipkwtCxUL zRj+0cY9ql%_$OQ}R|Y^C-!KwXPjSd?bq*OXlqyLoUMT5HG}NI_z9Rg2Trusy7Y_J^ z1Aeaa_Zbe@=~)h#pY#(l|22QV&|XOAOB^A9ecChlPv)lU$W05}QU#H9B`$(1@ajhJ zeRHK?Tk$=Zm}@3&J{%fsZhG$0x2HR8-pPLSY0Ix{1M9k8&O&Y*{>vAT#Qo2Kw?aS% zWrlcoLQgahzTr9MLSbE@N+@kpp%m)5mp63aCWpYaPMwCKBzHE#Z~><`^Y`B8y^Vwc zb!u}#4RD@;YA2sH2JGujs)WwZ&{|$p!ktw@JbqG4Zc63}jzSez2MCU)_~*m8^eK7x z12$EDGH>oE_;B@j*l#f)LGD+Q5!qpC@NCmAe?M|V{M90N&www5BN9HyTZnw9Dz;)9 z?0?z>+43+~LCw7ah3&OFaHMtFYJmY)dkZ5VLi@>hbfY=PIhtz}Our<`!|o)m-UYyJ z9Q5X%CPJBwYIvH>yc@?3+#Y!F@JG8V)rI4GCFUnrcnfbnrXu>!HXg{Xa24k9yddGV dCr%lk=PK;83dx!L`229^I{by + /// Contructs oject to control Cue devices. Note: this does not connect to a device. + /// + public CUEDeviceBoard() + { + List device = new List(); + // Find which devices are available + if (CueSDK.IsSDKAvailable(CorsairDeviceType.Headset)) + device.Add(CorsairDeviceType.Headset); + if (CueSDK.IsSDKAvailable(CorsairDeviceType.HeadsetStand)) + device.Add(CorsairDeviceType.HeadsetStand); + if (CueSDK.IsSDKAvailable(CorsairDeviceType.Keyboard)) + device.Add(CorsairDeviceType.Keyboard); + if (CueSDK.IsSDKAvailable(CorsairDeviceType.Mouse)) + device.Add(CorsairDeviceType.Mouse); + if (CueSDK.IsSDKAvailable(CorsairDeviceType.Mousemat)) + device.Add(CorsairDeviceType.Mousemat); + + _availableDevices = device.ToArray(); + _connected = false; + } + + /// + /// Connects to and initilises the given device. + /// + /// The type of device to connect to + public void ConnectToDevice(CorsairDeviceType deviceType) + { + try + { + CueSDK.Initialize(); + + switch(deviceType) + { + case CorsairDeviceType.Headset: + _device = CueSDK.HeadsetSDK; + break; + case CorsairDeviceType.HeadsetStand: + _device = CueSDK.HeadsetStandSDK; + break; + case CorsairDeviceType.Keyboard: + _device = CueSDK.KeyboardSDK; + break; + case CorsairDeviceType.Mouse: + _device = CueSDK.MouseSDK; + break; + case CorsairDeviceType.Mousemat: + _device = CueSDK.MousematSDK; + break; + } + + if (_device == null) + throw new WrapperException("No CUE device found"); + _device.Brush = (CUE.NET.Brushes.SolidColorBrush)Color.Transparent; // This 'enables' manual color changes. + + // Sets the device to blue, this should probally be changed to a different colour + SolidColorBrush solidColorBrush = new SolidColorBrush(Color.Blue); + _device.Brush = solidColorBrush; + _device.Update(); + _connected = true; + } + catch (CUEException ex) + { + MessageBox.Show("CUE Exception! ErrorCode: " + Enum.GetName(typeof(CorsairError), ex.Error)); + } + catch (WrapperException ex) + { + MessageBox.Show("Wrapper Exception! Message:" + ex.Message); + } + } + + /// + /// Sets all of the LEDs to the chosen RGB colour. + /// + /// The red value + /// The green value + /// The blue value + public void SetAllLeds(byte red, byte green, byte blue) + { + if (Connected) + { + SolidColorBrush solidColorBrush = new SolidColorBrush(Color.FromArgb(255, (byte)red, (byte)green, (byte)blue)); + _device.Brush = solidColorBrush; + _device.Update(); + } + } + + /// + /// Turns off all of the LEDs for that device. + /// + public void TurnOffAllLeds() + { + if (Connected) + { + SolidColorBrush solidColorBrush = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0)); + _device.Brush = solidColorBrush; + _device.Update(); + } + } + + } +} diff --git a/RGBController2/Boards/IBoards.cs b/RGBController2/Boards/IBoards.cs index a5a6a26..71c00b0 100644 --- a/RGBController2/Boards/IBoards.cs +++ b/RGBController2/Boards/IBoards.cs @@ -6,6 +6,8 @@ namespace RGBController2.Boards { public interface IBoard { + public bool Connected { get; } + /// /// Sets all of the LEDs to the chosen RGB colour. /// diff --git a/RGBController2/RGBController2.csproj b/RGBController2/RGBController2.csproj index e0026a6..e638e63 100644 --- a/RGBController2/RGBController2.csproj +++ b/RGBController2/RGBController2.csproj @@ -22,8 +22,21 @@ + + + + Code + + + + + + Designer + + + \ No newline at end of file diff --git a/RGBController2/RGBController2.csproj.user b/RGBController2/RGBController2.csproj.user index bfd799f..89d0e03 100644 --- a/RGBController2/RGBController2.csproj.user +++ b/RGBController2/RGBController2.csproj.user @@ -36,6 +36,9 @@ Designer + + Designer + Designer diff --git a/RGBController2/ViewModels/LightingModes/StaticViewModel.cs b/RGBController2/ViewModels/LightingModes/StaticViewModel.cs index b489d6b..bbf700f 100644 --- a/RGBController2/ViewModels/LightingModes/StaticViewModel.cs +++ b/RGBController2/ViewModels/LightingModes/StaticViewModel.cs @@ -82,8 +82,8 @@ namespace RGBController2.ViewModels.LightingModes public ICommand SendCommand { get; set; } - private ArduinoBoard _arduinoBoard; - public StaticViewModel(ArduinoBoard arduinoBoard) + private IBoard _ledBoard; + public StaticViewModel(IBoard ledBoard) { SendCommand = new ActionCommand(o => SendButtonClick("SenderButton")); @@ -98,7 +98,7 @@ namespace RGBController2.ViewModels.LightingModes ColourSend = new SolidColorBrush(Color.FromRgb((byte)RedColourSend, (byte)GreenColourSend, (byte)BlueColourSend)); // This is here to allow us to interface with the board stored in the MainViewModel // ideally this would involved pointers but C# does not seem to like pointers - _arduinoBoard = arduinoBoard; + _ledBoard = ledBoard; // ToDo load from previous values } @@ -111,10 +111,10 @@ namespace RGBController2.ViewModels.LightingModes private void SendButtonClick(object sender) { - if (_arduinoBoard != null) - if (_arduinoBoard.Conected) + if (_ledBoard != null) + if (_ledBoard.Connected) { - _arduinoBoard.SetAllLeds((byte)RedColourSend, (byte)GreenColourSend, (byte)BlueColourSend); + _ledBoard.SetAllLeds((byte)RedColourSend, (byte)GreenColourSend, (byte)BlueColourSend); RedColourCurrent = RedColourSend; GreenColourCurrent = GreenColourSend; BlueColourCurrent = BlueColourSend; diff --git a/RGBController2/ViewModels/MainViewModel.cs b/RGBController2/ViewModels/MainViewModel.cs index 428bf81..5ed9be0 100644 --- a/RGBController2/ViewModels/MainViewModel.cs +++ b/RGBController2/ViewModels/MainViewModel.cs @@ -2,28 +2,71 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Text; using System.Windows.Input; using RGBController2.Commands; using RGBController2.ViewModels.Tabs; using RGBController2.ViewModels.Dialogs; +using System.ComponentModel; +using System.Windows; +using System.Xml; namespace RGBController2.ViewModels { class MainViewModel { - private readonly ObservableCollection _tabs; + private readonly ObservableCollection _tabs; public ICommand NewTabCommand { get; } - public static ICollection Tabs { get; set; } + public static ICollection Tabs { get; set; } public MainViewModel() { NewTabCommand = new ActionCommand(p => NewTab()); - _tabs = new ObservableCollection(); + _tabs = new ObservableCollection(); _tabs.CollectionChanged += Tabs_CollectionChanged; Tabs = _tabs; + + // Check here that the config file exists + + // Load the config file + using (XmlReader reader = XmlReader.Create("config.xml")) + { + string name = ""; + string type = ""; + while (reader.Read()) + { + if (reader.IsStartElement()) + { + //return only when you have START tag + switch (reader.Name.ToString()) + { + case "name": + name = reader.ReadString(); + break; + case "type": + type = reader.ReadString(); + break; + } + } + // Create the tab here + if (name != "" && type != "") + { + switch(type) + { + case "arduino": + _tabs.Add(new ArduinoTab(name)); + break; + case "cue": + _tabs.Add(new CueDeviceTab(name)); + break; + } + + name = ""; + type = ""; + } + } + } } private void Tabs_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) @@ -46,7 +89,7 @@ namespace RGBController2.ViewModels private void OnTabCloseRequested(object sender, EventArgs e) { - Tabs.Remove((ITab) sender); + Tabs.Remove((Tab) sender); } private void NewTab() @@ -58,9 +101,62 @@ namespace RGBController2.ViewModels // Use the results from the dialog when creating the new tab if (dialog.Success) { - Tabs.Add(new ArduinoTab(dialog.DeviceName)); + switch(dialog.SelectedDeviceType) + { + case 0: // Arduino + Tabs.Add(new ArduinoTab(dialog.DeviceName)); + break; + case 1: + Tabs.Add(new CueDeviceTab(dialog.DeviceName)); + break; + } } } + /// + /// This function is called when the application is closed. + /// This allows the configuration to be saved to disk. + /// + /// + /// + public void OnWindowClosing(object sender, CancelEventArgs e) + { + // ToDo - Save the config to disk + // This may need to be saved somwhere better, for now we will just save it + // with the executable + XmlWriter xmlWriter = XmlWriter.Create("config.xml"); + xmlWriter.WriteStartDocument(); + + xmlWriter.WriteStartElement("tabs"); + xmlWriter.WriteAttributeString("count", Tabs.Count.ToString()); + foreach (var tab in Tabs) + { + xmlWriter.WriteStartElement("tab"); + xmlWriter.WriteStartElement("name"); + xmlWriter.WriteString(tab.Name); + xmlWriter.WriteEndElement(); + + switch (tab.TabType) + { + case Tab.tabType.Arduino: + xmlWriter.WriteStartElement("type"); + xmlWriter.WriteString("arduino"); + xmlWriter.WriteEndElement(); + break; + case Tab.tabType.CUE: + xmlWriter.WriteStartElement("type"); + xmlWriter.WriteString("cue"); + xmlWriter.WriteEndElement(); + break; + } + xmlWriter.WriteEndElement(); + } + + xmlWriter.WriteEndDocument(); + xmlWriter.Close(); + + + } + } } diff --git a/RGBController2/ViewModels/Tabs/ArduinoTab.cs b/RGBController2/ViewModels/Tabs/ArduinoTab.cs index 5696eeb..576178c 100644 --- a/RGBController2/ViewModels/Tabs/ArduinoTab.cs +++ b/RGBController2/ViewModels/Tabs/ArduinoTab.cs @@ -10,6 +10,7 @@ namespace RGBController2.ViewModels.Tabs { public class ArduinoTab : Tab, INotifyPropertyChanged { + public event PropertyChangedEventHandler PropertyChanged; private enum LightingModes { @@ -45,12 +46,12 @@ namespace RGBController2.ViewModels.Tabs _selectedPort = value; // Connect to the port here _arduinoBoard = new ArduinoBoard(_selectedPort); - if (_arduinoBoard.Conected) + if (_arduinoBoard.Connected) { ConnectionStatus = "Device Connected"; // Set the page to static lighting mode to allow the user to change the // lighting mode now that we are connected to the arduino - _selectedLightingMode = new StaticViewModel(_arduinoBoard); + SelectedLightingMode = new StaticViewModel(_arduinoBoard); OnPropertyChanged(nameof(SelectedLightingMode)); } else @@ -68,15 +69,9 @@ namespace RGBController2.ViewModels.Tabs set { _lightingMode = (LightingModes) value; } } - private BaseViewModel _selectedLightingMode; - public BaseViewModel SelectedLightingMode - { - get { return _selectedLightingMode; } - set { _selectedLightingMode = value; } - } - public ArduinoTab(string name) { + TabType = tabType.Arduino; Name = name; ConnectionStatus = "Device Disconnected"; _selectedPort = ""; @@ -86,7 +81,7 @@ namespace RGBController2.ViewModels.Tabs _availablePorts = ports; // This is a temporary viewmodel that is used before the user has connected to a device - _selectedLightingMode = new InformationViewModel(); + SelectedLightingMode = new InformationViewModel(); } protected void OnPropertyChanged(string propertyName) diff --git a/RGBController2/ViewModels/Tabs/CUEDeviceTab.cs b/RGBController2/ViewModels/Tabs/CUEDeviceTab.cs new file mode 100644 index 0000000..1fece08 --- /dev/null +++ b/RGBController2/ViewModels/Tabs/CUEDeviceTab.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO.Ports; +using RGBController2.Boards; +using System.ComponentModel; +using RGBController2.ViewModels.LightingModes; +using CUE.NET.Devices.Generic.Enums; + +namespace RGBController2.ViewModels.Tabs +{ + public class CueDeviceTab : Tab, INotifyPropertyChanged + { + + public event PropertyChangedEventHandler PropertyChanged; + private enum LightingModes + { + StaticMode = 0, + AnimationMode, + QuakeMode + } + + private CUEDeviceBoard _cueDeviceBoard; + + private CorsairDeviceType[] _availableDevices; + public CorsairDeviceType[] AvailableDevices + { + get { return _availableDevices; } + } + + private CorsairDeviceType _selectedDevice; + public CorsairDeviceType SelectedDevice + { + get { return _selectedDevice; } + set + { + if (value != _selectedDevice) + { + // Connect to the device + _cueDeviceBoard.ConnectToDevice(value); + if (_cueDeviceBoard.Connected) + { + ConnectionStatus = "Device Connected"; + // Set the page to static lighting mode to allow the user to change the + // lighting mode now that we are connected to the CUE Device + SelectedLightingMode = new StaticViewModel(_cueDeviceBoard); + OnPropertyChanged(nameof(SelectedLightingMode)); + } + else + ConnectionStatus = "Failed to connect to device"; + OnPropertyChanged(nameof(ConnectionStatus)); + } + } + } + + private string _conntectionStatus; + public string ConnectionStatus + { + get { return _conntectionStatus; } + set { _conntectionStatus = value; } + } + + + + private LightingModes _lightingMode; + public int LightingMode + { + get { return (int)_lightingMode; } + set { _lightingMode = (LightingModes) value; } + } + + private BaseViewModel _selectedLightingMode; + + public CueDeviceTab(string name) + { + TabType = tabType.CUE; + Name = name; + ConnectionStatus = "Device Disconnected"; + + // Create the device object + _cueDeviceBoard = new CUEDeviceBoard(); + + // Get a list of the available cue devices + _availableDevices = _cueDeviceBoard.AvailableDevices; + + // This is a temporary viewmodel that is used before the user has connected to a device + _selectedLightingMode = new InformationViewModel(); + } + + protected void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} diff --git a/RGBController2/ViewModels/Tabs/ITab.cs b/RGBController2/ViewModels/Tabs/ITab.cs index 58e00fc..942b80b 100644 --- a/RGBController2/ViewModels/Tabs/ITab.cs +++ b/RGBController2/ViewModels/Tabs/ITab.cs @@ -1,4 +1,5 @@ -using System; +using RGBController2.ViewModels; +using System; using System.Windows.Input; namespace RGBController2 diff --git a/RGBController2/ViewModels/Tabs/Tab.cs b/RGBController2/ViewModels/Tabs/Tab.cs index f102afc..6a7d0e2 100644 --- a/RGBController2/ViewModels/Tabs/Tab.cs +++ b/RGBController2/ViewModels/Tabs/Tab.cs @@ -6,11 +6,26 @@ namespace RGBController2.ViewModels.Tabs { public abstract class Tab : ITab { + public enum tabType + { + Unknown, + Arduino, + CUE + } + + public tabType TabType = tabType.Unknown; + public Tab() { CloseCommand = new ActionCommand(p => CloseRequested?.Invoke(this, EventArgs.Empty)); } + private BaseViewModel _selectedLightingMode; + public BaseViewModel SelectedLightingMode + { + get { return _selectedLightingMode; } + set { _selectedLightingMode = value; } + } public string Name { get; set; } public ICommand CloseCommand { get; } public event EventHandler CloseRequested; diff --git a/RGBController2/Views/Dialogs/NewTabDialogView.xaml b/RGBController2/Views/Dialogs/NewTabDialogView.xaml index 668393f..aa58942 100644 --- a/RGBController2/Views/Dialogs/NewTabDialogView.xaml +++ b/RGBController2/Views/Dialogs/NewTabDialogView.xaml @@ -5,12 +5,13 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:RGBController2.Views.Dialogs" mc:Ignorable="d" - Title="NewTabDialogView" Height="150" Width="300"> + ResizeMode="NoResize" + Title="New Tab" Height="150" Width="300">