Ejemplo n.º 1
0
        public void TestMotherboards()
        {
            AuraSDK sdk = new AuraSDK();

            if (sdk.Motherboards.Length == 0)
            {
                Assert.Inconclusive();
            }

            foreach (Motherboard motherboard in sdk.Motherboards)
            {
                motherboard.SetMode(DeviceMode.Software);

                Color[] colors = new Color[motherboard.LedCount];

                for (int i = 0; i < colors.Length; i++)
                {
                    colors[i] = testColors[i % testColors.Length];
                }

                motherboard.SetColors(colors);
            }

            sdk.Unload();
        }
Ejemplo n.º 2
0
        private void SetupNetwork(string ip)
        {
            _localIp         = ip;
            _sendToAddress   = IPAddress.Parse(ip);
            _sendingEndPoint = new IPEndPoint(_sendToAddress, 56700);

            try
            {
                CueSDK.Initialize();
                if (CueSDK.KeyboardSDK != null)
                {
                    CueSDK.KeyboardSDK.Brush = (SolidColorBrush)System.Drawing.Color.Transparent;
                }
                if (CueSDK.MouseSDK != null)
                {
                    CueSDK.MouseSDK.Brush = (SolidColorBrush)System.Drawing.Color.Transparent;
                }
                Mouse    = CueSDK.MouseSDK;
                Keyboard = CueSDK.KeyboardSDK;
                if (Keyboard != null)
                {
                    KeyboardLedDictionary = Keyboard.Leds.ToDictionary(x => x.Id.ToString(), x => x);
                }
            }
            catch (Exception e) { }

            auraSDK = new AuraSDK();
        }
Ejemplo n.º 3
0
        public void TestMotherboardByteColors()
        {
            AuraSDK sdk = new AuraSDK();

            if (sdk.Motherboards.Length == 0)
            {
                Assert.Inconclusive();
            }

            foreach (Motherboard motherboard in sdk.Motherboards)
            {
                motherboard.SetMode(DeviceMode.Software);

                byte[] colors = new byte[motherboard.LedCount * 3];

                for (int i = 0; i < motherboard.LedCount; i++)
                {
                    Color color = testColors[i % testColors.Length];
                    colors[i * 3]     = color.R;
                    colors[i * 3 + 1] = color.B;
                    colors[i * 3 + 2] = color.G;
                }

                motherboard.SetColors(colors);
            }

            sdk.Unload();
        }
Ejemplo n.º 4
0
        public void TestMotherboardGpuColors()
        {
            AuraSDK sdk = new AuraSDK();

            if (sdk.GPUs.Length == 0)
            {
                Assert.Inconclusive();
            }

            foreach (GPU gpu in sdk.GPUs)
            {
                gpu.SetMode(DeviceMode.Software);

                byte[] colors = new byte[gpu.LedCount * 3];

                for (int i = 0; i < gpu.LedCount; i++)
                {
                    Color color = testColors[i % testColors.Length];
                    colors[i * 3]     = color.R;
                    colors[i * 3 + 1] = color.B;
                    colors[i * 3 + 2] = color.G;
                }

                gpu.SetColors(colors);
            }

            sdk.Unload();
        }
Ejemplo n.º 5
0
        /*
         * Return:
         * -1 if AURA_SDK.dll is missing
         * 0 if no Motherboards found
         * 1 if Motherboards found
         *
         *
         */

        public int ChangeColors(int r, int g, int b)
        {
            try
            {
                AuraSDK sdk = new AuraSDK(@"lib/AURA_SDK.dll");
                if (sdk.Motherboards.Length == 0)
                {
                    return(0);
                }

                foreach (Motherboard motherboard in sdk.Motherboards)
                {
                    motherboard.SetMode(DeviceMode.Software);

                    Color[] colors = new Color[motherboard.LedCount];

                    for (int i = 0; i < colors.Length; i++)
                    {
                        colors[i] = new Color((byte)r, (byte)g, (byte)b);
                    }

                    motherboard.SetColors(colors);
                }
                sdk.Unload();
                return(1);
            }
            catch (System.IO.FileNotFoundException)
            {
                System.Windows.MessageBox.Show("AURA_SDK.dll missing");
                return(-1);
            }
        }
Ejemplo n.º 6
0
        public static void Main()
        {
            String currentDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            String auraSDKPath      = $"{currentDirectory}\\Libraries\\AuraSDK\\sdk\\AURA_SDK.dll";

            var sdk = new AuraSDK(path: auraSDKPath);

            AuraDevice board = sdk.Motherboards[0];
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting...");
            if (!IsElevated)
            {
                Console.WriteLine("Please run as administrator.");
                Console.WriteLine("Press any key to exit...");
                while (!(Console.KeyAvailable))
                {
                    ;
                }
                return;
            }

            AuraSDK auraSDK = new AuraSDK();
            int     result  = auraSDK.DetectAuraDevices();

            if (result != 0)
            {
                Console.WriteLine("Error during initialize: " + result);
                return;
            }

            Console.WriteLine("Found " + auraSDK.MBControllersCount + " motherboard controller(s)");
            Console.WriteLine("Found " + auraSDK.GPUControllersCount + " gpu controller(s)");
            Console.WriteLine("Found keybaord: " + auraSDK.IsKeyboardPresent);
            Console.WriteLine("Found mouse: " + auraSDK.IsMousePresent);

            if (auraSDK.MBControllersCount > 0)
            {
                Console.WriteLine("Press Escape to exit...");
                while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
                {
                    int    ledCount = auraSDK.GetMBLedCount(0);
                    byte[] colors   = new byte[ledCount * 3];

                    for (var i = 0; i < 2 && i < ledCount; i++)
                    {
                        for (var j = i; j < ledCount; j += 3)
                        {
                            colors[i] = 255;
                            auraSDK.SetMBLedColor(0, colors);
                            Thread.Sleep(100);

                            var current = auraSDK.GetMBLedColor(0);
                            Console.WriteLine($"R:{current[0]} G:{current[1]} B:{current[2]}");
                        }
                    }
                }
            }

            Console.WriteLine("Done");
        }
Ejemplo n.º 8
0
        public void Start()
        {
            _auraSdk = new AuraSDK();
            var success = _auraSdk.DetectAuraDevices();

            if (success != 0 || _auraSdk.MBControllersCount < 0)
            {
                Logger.Error("Invalid Aura setup");
                return;
            }

            _port = new SerialPort(_portNo);
            _port.Open();
            _timer.Start();
        }
Ejemplo n.º 9
0
        public void TestMouseFailsIfNotEnoughColors()
        {
            AuraSDK sdk = new AuraSDK();

            if (sdk.Mice.Length == 0)
            {
                Assert.Inconclusive();
            }

            Color[] colors = new Color[sdk.Mice[0].LedCount + 1];

            for (int i = 0; i < colors.Length; i++)
            {
                colors[i] = testColors[i % testColors.Length];
            }

            Assert.ThrowsException <ArgumentException>(() => sdk.Mice[0].SetColors(colors));

            sdk.Unload();
        }
Ejemplo n.º 10
0
        public void TestGpus()
        {
            AuraSDK sdk = new AuraSDK();

            foreach (GPU gpu in sdk.GPUs)
            {
                gpu.SetMode(DeviceMode.Software);

                Color[] colors = new Color[gpu.LedCount];

                for (int i = 0; i < colors.Length; i++)
                {
                    colors[i] = new Color(0, 255, 0);
                }

                gpu.SetColors(colors);
            }

            sdk.Unload();
        }
Ejemplo n.º 11
0
        public void TestLoadUnloadRelativeDirectory()
        {
            AuraSDK sdk = new AuraSDK(@"lib\AURA_SDK_lib.dll");

            sdk.Unload();
        }
Ejemplo n.º 12
0
        public void TestLoadUnload()
        {
            AuraSDK sdk = new AuraSDK();

            sdk.Unload();
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting...");
            if (!IsElevated)
            {
                Console.WriteLine("Please run as administrator.");
                Console.WriteLine("Press any key to exit...");
                while (!(Console.KeyAvailable))
                {
                    ;
                }
                return;
            }

            AuraSDK auraSDK = new AuraSDK();
            int     result  = auraSDK.DetectAuraDevices();

            if (result != 0)
            {
                Console.WriteLine("Error during initialize: " + result);
                return;
            }

            Console.WriteLine("Found " + auraSDK.MBControllersCount + " motherboard controller(s)");
            Console.WriteLine("Found " + auraSDK.GPUControllersCount + " gpu controller(s)");
            Console.WriteLine("Found keybaord: " + auraSDK.IsKeyboardPresent);
            Console.WriteLine("Found mouse: " + auraSDK.IsMousePresent);

            if (auraSDK.MBControllersCount > 0)
            {
                Console.WriteLine("Press Escape to exit...");
                while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
                {
                    int    ledCount = auraSDK.GetMBLedCount(0);
                    byte[] colors   = new byte[ledCount * 3];
                    colors[0]  = 255;
                    colors[3]  = 255;
                    colors[6]  = 255;
                    colors[9]  = 255;
                    colors[12] = 255;
                    auraSDK.SetMBLedColor(0, colors);
                    Thread.Sleep(100);
                    colors[1]  = 255;
                    colors[4]  = 255;
                    colors[7]  = 255;
                    colors[10] = 255;
                    colors[13] = 255;
                    auraSDK.SetMBLedColor(0, colors);
                    Thread.Sleep(100);

                    colors[2]  = 255;
                    colors[5]  = 255;
                    colors[8]  = 255;
                    colors[11] = 255;
                    colors[14] = 255;
                    auraSDK.SetMBLedColor(0, colors);
                    Thread.Sleep(100);
                }
            }

            Console.WriteLine("Done");
        }