Example #1
0
        public IStrip CreateStrip(StripConfig sc)
        {
            IStrip s;

            switch (sc.type)
            {
            case StripType.RGB:
            {
                s = new RGBStrip(sc.name, IPAddress.Parse(sc.address), sc.ledCount);
            }
            break;

            case StripType.RGBW:
            {
                s = new RGBWStrip(sc.name, IPAddress.Parse(sc.address), sc.ledCount);
            }
            break;

            case StripType.RGBW2D:
            {
                s = new RGBWStrip2D(sc.name, IPAddress.Parse(sc.address), sc.width, sc.height, sc.mirroredX);
            }
            break;

            default:
            {
                throw new ArgumentOutOfRangeException("Unsupported strip type");
            }
            }
            s.Name = sc.name;
            return(s);
        }
Example #2
0
        public RGBWStrip2D(string name, IPAddress address, int width, int height, bool mirroredX = false)
        {
            this._strip = new RGBWStrip(name, address, width * height);

            this.width     = width;
            this.height    = height;
            this.mirroredX = mirroredX;
        }