Esempio n. 1
0
        private static Packet DemoAnimation()
        {
            var text = new TextFile('A') {
                new TextFileLine("<speed 5 /><picture 1/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 2/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 3/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 4/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 5/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 6/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 6/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 5/> <picture 3/> <picture 1/> <picture 2/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 4/> <picture 2/> <picture 1/> <picture 3/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 3/> <picture 1/> <picture 2/> <picture 4/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 2/> <picture 1/> <picture 3/> <picture 5/>", DisplayMode.Hold),
                new TextFileLine("<speed 5 /><picture 1/> <picture 2/> <picture 4/> <picture 6/>", DisplayMode.Hold),
            };

            var pic1 = new PictureFile('1', "kirby/frame1.png", ColorFormat.Monochrome);
            var pic2 = new PictureFile('2', "kirby/frame2.png", ColorFormat.Monochrome);
            var pic3 = new PictureFile('3', "kirby/frame3.png", ColorFormat.Monochrome);
            var pic4 = new PictureFile('4', "kirby/frame4.png", ColorFormat.Monochrome);
            var pic5 = new PictureFile('5', "kirby/frame5.png", ColorFormat.Monochrome);
            var pic6 = new PictureFile('6', "kirby/frame6.png", ColorFormat.Monochrome);

            var packet = new Packet();
            packet.SetMemory(new FileTable {
                text,
                pic1, pic2, pic3, pic4, pic5, pic6
            });
            packet.Add(new WriteTextCommand(text));
            packet.Add(new WritePictureCommand(pic1));
            packet.Add(new WritePictureCommand(pic2));
            packet.Add(new WritePictureCommand(pic3));
            packet.Add(new WritePictureCommand(pic4));
            packet.Add(new WritePictureCommand(pic5));
            packet.Add(new WritePictureCommand(pic6));

            return packet;
        }
Esempio n. 2
0
        private static Packet BlackfinDemo()
        {
            var files = new List<TextFile> {
                new TextFile('A') {
                    {"<speed 5/>IF YOU WANT YOUR STAPLER BRING <speed 1/>ONE. MILLION. DOLLARS.<speed 5/> TO THE TORCH AT MIDNIGHT", DisplayMode.Rotate},
                },
                new TextFile('B') {
                    SpecialGraphic.DontDrinkAndDrive
                },
                new TextFile('E') {
                    {"THE WEATHER IS WARM WITH A CHANCE OF RAIN..."},
                },
                new TextFile('C') {
                    {"WELCOME TO BLACKFIN<line/>NOW 100% MORE", DisplayMode.Scroll},
                    {"<wide>XTREME</wide>", SpecialMode.Sparkle}
                },
                new TextFile('D') {"<speed 1/><time/>"}
            };

            var packet = new Packet();
            packet.SetMemory(files);
            packet.WriteText(files);
            return packet;
        }
Esempio n. 3
0
        private static Packet DemoWriteTextCommands()
        {
            var packet = new Packet();

            var files = new List<TextFile> {
                DemoDisplayModes(),
                DemoSpecialModes(),
                DemoFormatting()
            };
            files.AddRange(DemoGraphics());

            packet.SetMemory(files);
            packet.WriteText(files);

            return packet;
        }
Esempio n. 4
0
        private static void DemoStrings(IConnection conn)
        {
            var packet = new Packet();

            var text = new TextFile('A') {
                {"<string C/>", DisplayMode.Scroll}
            };

            packet.SetMemory(new FileTable {
                {'C', new StringFileInfo(10)},
                text
            });

            packet.Add(new WriteTextCommand(text));
            conn.Send(packet);

            for(int i = 0; i < 60; i++)
            {
                packet = new Packet();
                packet.Add(new WriteStringCommand(new StringFile('C', i.ToString("000"))));
                conn.Send(packet);
                Thread.Sleep(1000);
            }
        }
Esempio n. 5
0
        private static Packet DemoPicture()
        {
            var uri = new Uri("blackfin.png", UriKind.Relative);
            var image = new BitmapImage(uri);

            var text = new TextFile('A') {{"<picture B/>", DisplayMode.Rotate}};
            var pic = new PictureFile('B', image, ColorFormat.Monochrome);

            var files = new FileTable {
                text, pic,
            };

            var packet = new Packet();
            packet.SetMemory(files);
            packet.Add(new WriteTextCommand(text));
            packet.Add(new WritePictureCommand(pic));
            return packet;
        }