Ejemplo n.º 1
0
        private void PowerOff()
        {
            var pixels = new List <Pixel>();

            //Create a new layout to get empty pixels
            pixels.AddRange(_layoutBuilder.CreateAmbilight().GetChangedPixels());
            pixels.AddRange(_layoutBuilder.CreateLayout().GetChangedPixels());

            InternalRender(pixels);
        }
Ejemplo n.º 2
0
        private void DrawInitialScreen()
        {
            AmbilightLayout ambilight = _layoutBuilder.CreateAmbilight();
            PluginLayout    layout    = _layoutBuilder.CreateLayout();

            Console.WriteLine();

            int originalTop = Console.CursorTop;

            for (int i = 0; i <= ambilight.LeftAmbilight.Strip.Count - 1; i++)
            {
                _consolePixels.Add(new ConsolePixel {
                    PixelID = ambilight.LeftAmbilight.Strip[i].PixelID, ConsoleLeft = Console.CursorLeft, ConsoleTop = Console.CursorTop, Character = "O"
                });
                Console.WriteLine("O\t\t");
            }

            Console.SetCursorPosition(3, originalTop);
            for (int i = 0; i <= layout.Matrix.Height - 1; i++)
            {
                for (int k = 0; k <= layout.Matrix.Width - 1; k++)
                {
                    _consolePixels.Add(new ConsolePixel {
                        PixelID = layout.Matrix.GetPixel(k, i).PixelID, ConsoleLeft = Console.CursorLeft, ConsoleTop = Console.CursorTop, Character = _matrixCover[i, k]
                    });
                    Console.Write(_matrixCover[i, k] + " ");
                }
                Console.WriteLine();
                Console.SetCursorPosition(3, i + 1 + originalTop);
            }

            Console.SetCursorPosition(3 + layout.Matrix.Width * 2, originalTop);
            for (int i = 0; i <= ambilight.RightAmbilight.Strip.Count - 1; i++)
            {
                _consolePixels.Add(new ConsolePixel {
                    PixelID = ambilight.RightAmbilight.Strip[i].PixelID, ConsoleLeft = Console.CursorLeft, ConsoleTop = Console.CursorTop, Character = "  O"
                });
                Console.Write("  O");
                Console.CursorTop  += 1;
                Console.CursorLeft -= 3;
            }
            Console.WriteLine();

            Console.Write("\t");
            //for(int i=0; i<= layout.Minutes.GetStrip().Count -1; i++)
            for (int i = layout.Minutes.Strip.Count - 1; i >= 0; i--)
            {
                _consolePixels.Add(new ConsolePixel {
                    PixelID = layout.Minutes.Strip[i].PixelID, ConsoleLeft = Console.CursorLeft, ConsoleTop = Console.CursorTop, Character = "X"
                });
                Console.Write("X ");
            }
        }