예제 #1
0
 /// <summary>
 /// Figure out 'KEY_PATCH_TYPE' parmeter
 /// Expected syntax is [patch type name] VALUE_SPILTTER [columns] PARAM_SPILTTER [rows]
 /// </summary>
 public static IPixelPatch getPixelPatch(string param)
 {
     string[] args = param.Split(VALUE_SPLITTER);
     int[]    dim  = args[1].Split(PARAM_SPLITTER).Select(x => int.Parse(x)).ToArray();
     return(RectaglePixelPatch.InstantiatePixelPatchByName(
                args[0], // name
                dim[0],  //columns
                dim[1],  //rows
                0,
                Const.PIXEL_LENGTH
                ));
 }
예제 #2
0
        private static IPixelPatch getPatchType(FixtureTemplate fixTemplate)
        {
            var pp = RectaglePixelPatch.InstantiatePixelPatchByName(
                fixTemplate.PixelPatch.Name,
                fixTemplate.PixelPatch.Columns,
                fixTemplate.PixelPatch.Rows,
                0,
                fixTemplate.PixelPatch.PixelLength
                );

            if (pp == null)
            {
                throw new KeyNotFoundException(
                          "Fixture Factory failed to load a Pixel patch with name '" +
                          fixTemplate.PixelPatch.Name + "'");
            }
            return(pp);
        }