Inheritance: BufferImporter
Exemplo n.º 1
0
        public Nutcracker3Scene(IEnumerable <string> args)
        {
            candyLight = new StrobeColorDimmer("Candy Light");
            testButton = new DigitalInput("Test");

            allPixels1 = new VirtualPixel1D(256);
            allPixels2 = new VirtualPixel1D(256);
            allPixels1.SetAll(Color.White, 0);
            allPixels2.SetAll(Color.White, 0);

            var lorImport = new Import.LorImport(@"C:\Users\HLindestaf\Downloads\coke_song\Coke-Cola Christmas.lms");

            var channelNames = lorImport.GetChannels.Select(x => lorImport.GetChannelName(x)).ToList();

            channelNames.ForEach(x => Console.WriteLine(x));

            int pixelPosition = 0;

            var circuits = lorImport.GetChannels.GetEnumerator();

            while (true)
            {
                //                Controller.IChannelIdentity channelR, channelG, channelB;
                Controller.IChannelIdentity channel;

                if (!circuits.MoveNext())
                {
                    break;
                }
                channel = circuits.Current;

                VirtualPixel1D pixel1d;
                int            pixelNum;
                if (pixelPosition < 256)
                {
                    pixel1d  = allPixels1;
                    pixelNum = pixelPosition;
                }
                else
                {
                    pixel1d  = allPixels2;
                    pixelNum = pixelPosition - 256;
                }

                var pixel = lorImport.MapDevice(
                    channel,
                    name => new SinglePixel(name, pixel1d, pixelNum));

                log.Debug("Mapping channel [{0}] to pixel {1} [{2}]",
                          channel,
                          pixelPosition,
                          pixel.Name);

                pixelPosition++;
            }

            lorTimeline = lorImport.CreateTimeline(1);
        }
Exemplo n.º 2
0
        public Nutcracker3Scene(IEnumerable<string> args)
        {
            candyLight = new StrobeColorDimmer("Candy Light");
            testButton = new DigitalInput("Test");

            allPixels1 = new VirtualPixel1D(256);
            allPixels2 = new VirtualPixel1D(256);
            allPixels1.SetAll(Color.White, 0);
            allPixels2.SetAll(Color.White, 0);

            var lorImport = new Import.LorImport(@"C:\Users\HLindestaf\Downloads\coke_song\Coke-Cola Christmas.lms");

            var channelNames = lorImport.GetChannels.Select(x => lorImport.GetChannelName(x)).ToList();
            channelNames.ForEach(x => Console.WriteLine(x));

            int pixelPosition = 0;

            var circuits = lorImport.GetChannels.GetEnumerator();

            while (true)
            {
                //                Controller.IChannelIdentity channelR, channelG, channelB;
                Controller.IChannelIdentity channel;

                if (!circuits.MoveNext())
                    break;
                channel = circuits.Current;

                VirtualPixel1D pixel1d;
                int pixelNum;
                if (pixelPosition < 256)
                {
                    pixel1d = allPixels1;
                    pixelNum = pixelPosition;
                }
                else
                {
                    pixel1d = allPixels2;
                    pixelNum = pixelPosition - 256;
                }

                var pixel = lorImport.MapDevice(
                    channel,
                    name => new SinglePixel(name, pixel1d, pixelNum));

                log.Debug("Mapping channel [{0}] to pixel {1} [{2}]",
                    channel,
                    pixelPosition,
                    pixel.Name);

                pixelPosition++;
            }

            lorTimeline = lorImport.CreateTimeline(1);
        }
Exemplo n.º 3
0
        public Nutcracker1Scene(IEnumerable <string> args)
        {
            testButton = new DigitalInput("Test");

            allPixels = new VirtualPixel1D(60);
            allPixels.SetAll(Color.White, 0);

            var lorImport = new Import.LorImport(@"..\..\..\Test Files\HAUK~HALLOWEEN1.lms");

            int pixelPosition = 0;

            var circuits = lorImport.GetChannels.GetEnumerator();

            while (true)
            {
                Controller.IChannelIdentity channelR, channelG, channelB;

                if (!circuits.MoveNext())
                {
                    break;
                }
                channelR = circuits.Current;

                if (!circuits.MoveNext())
                {
                    break;
                }
                channelG = circuits.Current;

                if (!circuits.MoveNext())
                {
                    break;
                }
                channelB = circuits.Current;

                var pixel = lorImport.MapDevice(
                    channelR,
                    channelG,
                    channelB,
                    name => new SinglePixel(name, allPixels, pixelPosition));

                log.Debug("Mapping channel R[{0}]/G[{1}]/B[{2}] to pixel {3} [{4}]",
                          channelR,
                          channelG,
                          channelB,
                          pixelPosition,
                          pixel.Name);

                pixelPosition++;
            }

            lorTimeline = lorImport.CreateTimeline(null);
        }
Exemplo n.º 4
0
        public Nutcracker1Scene(IEnumerable<string> args)
        {
            testButton = new DigitalInput("Test");

            allPixels = new VirtualPixel1D(60);
            allPixels.SetAll(Color.White, 0);

            var lorImport = new Import.LorImport(@"..\..\..\Test Files\HAUK~HALLOWEEN1.lms");

            int pixelPosition = 0;

            var circuits = lorImport.GetChannels.GetEnumerator();

            while (true)
            {
                Controller.IChannelIdentity channelR, channelG, channelB;

                if (!circuits.MoveNext())
                    break;
                channelR = circuits.Current;

                if (!circuits.MoveNext())
                    break;
                channelG = circuits.Current;

                if (!circuits.MoveNext())
                    break;
                channelB = circuits.Current;

                var pixel = lorImport.MapDevice(
                    channelR,
                    channelG,
                    channelB,
                    name => new SinglePixel(name, allPixels, pixelPosition));

                log.Debug("Mapping channel R[{0}]/G[{1}]/B[{2}] to pixel {3} [{4}]",
                    channelR,
                    channelG,
                    channelB,
                    pixelPosition,
                    pixel.Name);

                pixelPosition++;
            }

            lorTimeline = lorImport.CreateTimeline(null);
        }