コード例 #1
0
ファイル: AFXControl.cs プロジェクト: DevJock/AFX_ColorCoder
        public static async void run()
        {
            demo = true;
            while (demo)
            {
                UpdateLights.addDevice(Names[r.Next(0, Names.Count)], $"{randomValues()},{randomValues()},{randomValues()},{randomValues()},");

                Console.WriteLine($"{UpdateLights.NumberOfDevices}, {UpdateLights.StackSize}");
                await Task.Delay(AFXCore.UpdateInterval);
            }
        }
コード例 #2
0
        public async void Update()
        {
            if (disable)
            {
                return;
            }
            List <ILight> lightsUsedNow = new List <ILight>();

            for (int i = 0; i < UpdateLights.NumberOfDevices; i++)
            {
                LightDevice device = UpdateLights.lightAtIndex(i) as LightDevice;
                if (lightsUsedNow.Contains(device))
                {
                    UpdateLights.pushToStack(device);
                    continue;
                }
                Colorize(AFX_Device, device.DeviceID, device.LightColor);
                UpdateLights.removeDevice(device);
            }
            UpdateLights.resetStack();
            await Task.Delay(UpdateInterval);

            Update();
        }
コード例 #3
0
ファイル: AFXControl.cs プロジェクト: DevJock/AFX_ColorCoder
 public static void setColorToLight(string Name, string ColorCSV)
 {
     UpdateLights.addDevice(Name, ColorCSV);
 }