public PixelPatchTemplate(IPixelPatch pp)
 {
     Name        = pp.Name;
     Columns     = pp.Columns;
     Rows        = pp.Rows;
     PixelLength = PixelLength;
 }
Exemple #2
0
        public static void ValidateModeValues(List <IMode> modes, IPixelPatch pp)
        {
            bool colsValid = true;
            bool rowsValid = true;

            foreach (var m in modes)
            {
                if (pp.Columns < m.Params[0])
                {
                    colsValid = false;
                }
                if (pp.Rows < m.Params[1])
                {
                    rowsValid = false;
                }
            }

            if (!colsValid && !rowsValid)
            {
                throw new ArgumentException("Row and column values not valid");
            }
            if (!colsValid)
            {
                throw new ArgumentException("Column values not valid");
            }
            if (!rowsValid)
            {
                throw new ArgumentException("Row values not valid");
            }
        }
Exemple #3
0
 /// <summary>
 /// Change internal pixel order.
 /// Will fail if fixture is pattched to output.
 /// </summary>
 /// <param name="patch"></param>
 /// <returns>Return true if patch was successful / false if not</returns>
 public bool TrySetPatch(IPixelPatch patch)
 {
     if (PatchedTo == Output.FIXTURE_UNPATCH)
     {
         this.pixelPatch = patch;
         SetMode(this.mode);
         return(true);
     }
     return(false);
 }
Exemple #4
0
        public Fixture(List <IMode> modes, IPixelPatch pixelPatch)
        {
            dmxUtils = new List <FixtureDmxUtil>();

            this.modes    = modes;
            Fields        = new List <Field>();
            portsRequired = new List <Port>();
            portsPending  = new List <PendingPort>();
            address       = new Address();
            AddDmxUtil(new DmxModeSwitcher(0)
            {
                Values = new int[] { 256 }
            });
            this.pixelPatch = pixelPatch;
            SetMode(modes[currentModeIndex]);
            updateHandlers = new List <IFixtureUpdateHandler>();
            ID             = idCounter++;
            Name           = "Fixture " + ID;
        }