Example #1
0
 /// <summary>
 /// Default constructor. Creates a blank pattern
 /// </summary>
 public X0xPattern()
 {
     // initialise all steps to EOP.
     for (int i = 0; i < StepsPerPattern; ++i)
     {
         Steps[i] = new X0xStep();
     }
 }
Example #2
0
        public X0xPattern(K0ntr0lDataSet.PatternRow pattern) : this()
        {
            var stepIndex = 0;

            foreach (var step in pattern.GetStepRows())
            {
                Steps[stepIndex++] = new X0xStep(step);
            }
        }
Example #3
0
        /// <summary>
        /// Constructs a pattern from a byte array.
        /// </summary>
        /// <param name="bytes">An array of bytes. Length MUST be the same as STEPS_PER_PATTERN.</param>
        public X0xPattern(byte[] bytes)
        {
            if (bytes == null)
            {
                throw new ArgumentNullException(nameof(bytes));
            }

            if (bytes.Length != StepsPerPattern)
            {
                throw new ArgumentException(nameof(bytes) + " is incorrect length");
            }

            for (int i = 0; i < StepsPerPattern; ++i)
            {
                Steps[i] = new X0xStep(bytes[i]);
            }
        }