Beispiel #1
0
        public static ChipStatus Signal(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            var p = src.pixel;

            double ave = 0;
            double max = double.MinValue;
            double min = double.MaxValue;

            foreach (var i in p.pixel)
            {
                ave += i;
                if (max < i)
                {
                    max = i;
                }
                if (min > i)
                {
                    min = i;
                }
            }

            ave /= p.pixel.Length;


            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_Mono", ave.ToString());
            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_MonoMax", max.ToString());
            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_MonoMin", min.ToString());
            return(src);
        }
Beispiel #2
0
        //検査項目

        public static ChipStatus CheckFile(this ChipStatus src)
        {
            //var rsult = System.IO.File.Exists(src.FilePath);
            int fileCount = Directory.GetFiles(src.FilePath, "*.bin", SearchOption.AllDirectories).Length;

            src.Result.Add($"{nameof(CheckFile)}", fileCount.ToString());
            return(src);
        }
Beispiel #3
0
        public static ChipStatus Shading(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            return(src);
        }
Beispiel #4
0
        public static ChipStatus NonUniformity(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            return(src);
        }
Beispiel #5
0
        public static ChipStatus ClusterDefect(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            return(src);
        }
Beispiel #6
0
        public static ChipStatus Trim(this ChipStatus src, string map)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            var p = src.pixel;

            src.pixel = p.Trim(src.Map[map].Left, src.Map[map].Top, src.Map[map].Width, src.Map[map].Height); //破壊じゃない<-

            src.PixelStatus += $"_{map}";

            return(src);
        }
Beispiel #7
0
        public static ChipStatus Signal2(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            var p = src.pixel;

            double Gr    = 0;
            double R     = 0;
            double B     = 0;
            double Gb    = 0;
            int    count = 0;

            for (int y = 0; y < p.Height; y += 2)
            {
                for (int x = 0; x < p.Width; x += 2)
                {
                    Gr += p.pixel[count++];
                    R  += p.pixel[count++];
                }
                for (int x = 0; x < p.Width; x += 2)
                {
                    B  += p.pixel[count++];
                    Gb += p.pixel[count++];
                }
            }

            Gr /= p.pixel.Length / 4;
            R  /= p.pixel.Length / 4;
            B  /= p.pixel.Length / 4;
            Gb /= p.pixel.Length / 4;


            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_Gr", Gr.ToString());
            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_R", R.ToString());
            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_B", B.ToString());
            src.Result.Add(src.PixelStatus + "_" + nameof(Single) + "_Gb", Gb.ToString());
            return(src);
        }
Beispiel #8
0
        public static ChipStatus StaggerL(this ChipStatus src)
        {
            if (src.pixel == null)
            {
                return(src);
            }

            var p = src.pixel;

            for (int y = 1; y < p.Height; y += 2)
            {
                for (int x = 1; x < p.Width - 1; x++)
                {
                    p.pixel[x + y * p.Width] = p.pixel[x + y * p.Width + 1];
                }
            }

            src.PixelStatus += $"_StaggerL";
            src.pixel        = p;

            return(src);
        }
Beispiel #9
0
        public List <ChipStatus> CheckedChips(string path)
        {
            var result = new List <ChipStatus>();

            IEnumerable <string> dirs = System.IO.Directory.EnumerateDirectories(
                path,
                searchPattern,
                System.IO.SearchOption.AllDirectories);

            foreach (string dir in dirs)
            {
                var mc = System.Text.RegularExpressions.Regex.Matches(
                    dir,
                    Regex,
                    System.Text.RegularExpressions.RegexOptions.IgnoreCase);

                foreach (System.Text.RegularExpressions.Match m in mc)
                {
                    var buf = new ChipStatus()
                    {
                        LotNo    = m.Groups["lot"].Value,
                        WfNo     = m.Groups["wf"].Value,
                        ChipNo   = m.Groups["chip"].Value,
                        FilePath = dir,

                        //!!! 設定値の注入が必要
                        Condition = Condition,
                        Picture   = Picture,
                        Map       = Map
                    };
                    result.Add(buf);
                }
            }

            return(result);
        }
Beispiel #10
0
        //後処理

        public static ChipStatus Set(this ChipStatus src, string cond, string pic)
        {
            var path = $"{Path.Combine(src.FilePath, src.Condition[cond], src.Picture[pic])}";
            var name = $"{src.Condition[cond]}_{src.Picture[pic]}";

            if (!System.IO.File.Exists(path))
            {
                return(src);
            }
            if (src.PixelStatus == name)
            {
                return(src);
            }

            src.pixel = null;

            var dst = new Pixels.Pixel(src.Map["Full"].Width, src.Map["Full"].Height);

            dst.Read(path);

            src.pixel       = dst;
            src.PixelStatus = $"{src.Condition[cond]}_{src.Picture[pic]}";
            return(src);
        }