Beispiel #1
0
 public FixParColor(Dictionary <short, Color> mapping, FixPar.ValueType type = FixPar.ValueType.ABS,
                    Enums.FixParDst reg = Enums.FixParDst.Current)
 {
     infos = mapping.SelectMany(x => new SkInfo[]
     {
         new SkInfo
         {
             SkNum = x.Key,
             Par   = FixParMap.Active.Red,
             Val   = x.Value.R
         },
         new SkInfo
         {
             SkNum = x.Key,
             Par   = FixParMap.Active.Green,
             Val   = x.Value.G
         },
         new SkInfo
         {
             SkNum = x.Key,
             Par   = FixParMap.Active.Blue,
             Val   = x.Value.B
         }
     });
     count     = mapping.Count * 3;
     valueType = type;
     dstReg    = reg;
 }
Beispiel #2
0
        public DmxData(List <byte[]> data, Enums.FixParDst dst = Enums.FixParDst.Current)
        {
            Dst = dst;
            if (data.Count == 0)
            {
                return;
            }
            if (data.Count > 8)
            {
                throw new NotSupportedException("Cannot send more than 8 arrays at once");
            }

            for (int i = 0; i < data.Count; i++)
            {
                if (data[i] == null)
                {
                    data.Remove(data[i]);
                    continue;
                }

                if (data[i].Length == 512)
                {
                    continue;
                }

                byte[] holder = new byte[512];
                Array.Copy(data[i], holder, Math.Min(data[i].Length, 512));
            }

            this.data = data;
        }
Beispiel #3
0
 public CustomFixPar(Dictionary <int, Dictionary <short, byte> > mapping, FixPar.ValueType type = FixPar.ValueType.ABS, Enums.FixParDst reg = Enums.FixParDst.Current)
 {
     infos = new List <SkInfo>(mapping.Count);
     foreach ((int key, Dictionary <short, byte> value) in mapping)
     {
         infos.Add(new SkInfo
         {
             Num        = key,
             Parameters = value
         });
     }
     valueType = type;
     dstReg    = reg;
 }
Beispiel #4
0
        public FixPar(ValueType type = ValueType.ABS, Enums.FixParDst reg = Enums.FixParDst.Current, params SK[] sks)
        {
            int estSize = sks.Sum(s => s.Parameters.Count);

            parameters = new MlParameter[estSize];
            for (int i = 0, pointer = 0; i < sks.Length; i++)
            {
                foreach (MlParameter parameter in sks[i].Parameters)
                {
                    parameters[i] = parameter;

                    pointer++;
                }
            }
            valueType = type;
            dstReg    = reg;
        }
Beispiel #5
0
 public FixParDimmer(Enums.FixParDst reg = Enums.FixParDst.Current, params SK[] sks)
 {
     this.sks = sks;
     subCmd   = 0; //ABS
     dstReg   = reg;
 }
Beispiel #6
0
 public FixParRaw(Enums.FixParDst reg = Enums.FixParDst.Current, params FixParEntry[] entries)
 {
     this.entries = entries;
     subCmd       = 0; //ABS
     dstReg       = reg;
 }
Beispiel #7
0
 public FixPar(ValueType type = ValueType.ABS, Enums.FixParDst reg = Enums.FixParDst.Current, params MlParameter[] parameters)
 {
     this.parameters = parameters;
     valueType       = type;
     dstReg          = reg;
 }
Beispiel #8
0
 public DmxData(List <SK> sks = null, Enums.FixParDst dst = Enums.FixParDst.Current)
 {
     this.sks = sks;
     Dst      = dst;
     //throw new NotImplementedException("sknum != dmxout");
 }