Animatroller.Framework.Expander.OpcClient.Connect C# (CSharp) Method

Connect() public method

public Connect ( LogicalDevice device, LogicalDevice pixelMapper, int opcChannel ) : void
device LogicalDevice
pixelMapper LogicalDevice
opcChannel int
return void
        public void Connect(LogicalDevice.IPixel2D device, LogicalDevice.PixelMapper2D pixelMapper, int opcChannel)
        {
            device.Output.Subscribe(x =>
                {
                    Send((byte)opcChannel, 0, pixelMapper.GetByteArray(x));
                });
        }

Same methods

OpcClient::Connect ( PhysicalDevice device, int opcChannel ) : void

Usage Example

コード例 #1
0
ファイル: TpmTest.cs プロジェクト: jasongaylord/animatroller
        public TpmTest(IEnumerable <string> args)
        {
            tpmSink.DataReceived.Subscribe(x =>
            {
                switch (x.PacketNumber)
                {
                case 1:
                    tpmPixelMapper.FromRGBByteArray(x.Data, 0, allPixels.SetPixel);
                    break;

                case 2:
                    tpmPixelMapper.FromRGBByteArray(x.Data, 160, allPixels.SetPixel);
                    break;
                }

                if (x.PacketNumber == x.TotalPackets)
                {
                    allPixels.ShowBuffer();
                }
            });

            opcOutput.Connect(allPixels, opcPixelMapper, 1);


            // WS2811
            //            acnOutput.Connect(new Physical.PixelRope(allPixels, 0, 200), 1, 1);

            buttonTest.Output.Subscribe(x =>
            {
                if (x)
                {
                    Exec.MasterEffect.Fade(allPixels.GlobalBrightnessControl, 1, 0, 2000);
                }
                else
                {
                    Exec.MasterEffect.Fade(allPixels.GlobalBrightnessControl, 0, 1, 2000);
                }
            });
        }