Ejemplo n.º 1
0
        /// <summary>
        /// 主程式段 InspectResultClass.SetResultByPriority
        /// </summary>
        /// <param name="panel"></param>
        /// <returns></returns>
        private List <Box> FailList(InspectedPanel panel)
        {
            IniFile ini            = new IniFile();
            bool    bWarningAsFail = false;

            Boolean.TryParse(ini.Read("Setting", "WarningAsFail"), out bWarningAsFail);
            List <Box> failList = new List <Box>();

            foreach (var board in panel.Panel.Boards)
            {
                foreach (var component in board.Components)
                {
                    foreach (var box in component.Boxes)
                    {
                        switch (box.Status)
                        {
                        case eOverallStatus.SOL_BRIDGE:
                        case eOverallStatus.SOL_HEIGHTOVER:
                        case eOverallStatus.SOL_HEIGHTUNDER:
                        case eOverallStatus.SOL_VOLUMEOVER:
                        case eOverallStatus.SOL_VOLUMEUNDER:
                        case eOverallStatus.SOL_AREAOVER:
                        case eOverallStatus.SOL_AREAUNDER:
                        case eOverallStatus.SOL_OFFSETX:
                        case eOverallStatus.SOL_OFFSETY:

                        case eOverallStatus.SOL_WIDTHOVER:
                        case eOverallStatus.SOL_WIDTHUNDER:
                        case eOverallStatus.SOL_LENGTHOVER:
                        case eOverallStatus.SOL_LENGTHUNDER:
                        case eOverallStatus.SOL_MINHEIGHT:
                        case eOverallStatus.SOL_MAXHEIGHT:
                        case eOverallStatus.SOL_MINAREA:
                        case eOverallStatus.SOL_MAXAREA:
                        case eOverallStatus.SOL_MINVOLUME:
                        case eOverallStatus.SOL_MAXVOLUME:
                        case eOverallStatus.SOL_GAP:
                        case eOverallStatus.SOL_THICKNESSOVER:
                        case eOverallStatus.SOL_THICKNESSUNDER:
                        case eOverallStatus.SOL_PADSHIFT:
                            failList.Add(box);
                            break;

                        case eOverallStatus.SOL_AREAWARNING:
                        case eOverallStatus.SOL_HEIGHTWARNING:
                        case eOverallStatus.SOL_VOLUMEWARNING:
                            if (bWarningAsFail)
                            {
                                failList.Add(box);
                            }
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            return(failList);
        }
Ejemplo n.º 2
0
        public override object Calculate(List <Box> CandidateBoxes, InspectedPanel panel, object para)
        {
            PadHAVAvgResult result = new PadHAVAvgResult();

            foreach (Box box in CandidateBoxes)
            {
                if (box.Status != eOverallStatus.SOL_PASS ||
                    box.Status != eOverallStatus.SOL_BY_RPASS ||
                    box.Status != eOverallStatus.SOL_NOT_TEST)
                {
                    result.totalNGPads++;
                }


                //[Rex]
                result.avgArea_pct   += box.Area_p;
                result.avgHeight_pct += box.Height_p;
                result.avgVolume_pct += box.Volume_p;
                result.avgArea_val   += box.Area_v;
                result.avgHeight_val += box.Height_v;
                result.avgVolume_val += box.Volume_v;
            }
            //[Rex]求出值整版 H.A.V 平均 both % and value
            result.avgArea_pct   /= CandidateBoxes.Count;
            result.avgHeight_pct /= CandidateBoxes.Count;
            result.avgVolume_pct /= CandidateBoxes.Count;
            result.avgArea_val   /= CandidateBoxes.Count;
            result.avgHeight_val /= CandidateBoxes.Count;
            result.avgVolume_val /= CandidateBoxes.Count;


            return(result);
        }
Ejemplo n.º 3
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                _CenterOffsetResult    = null;
                _RotationResult        = null;
                _StretchResult         = null;
                _DefectStatisticResult = null;

                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
                StretchAlgorithm sAlgo  = new StretchAlgorithm();
                DefectStatistic  dsAlgo = new DefectStatistic();


                _CenterOffsetResult    = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult        = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
                _StretchResult         = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
                _DefectStatisticResult = (DefectStatisticResult)dsAlgo.Calculate(Boxes, currentPanel, null);//=>從failbox來
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }
Ejemplo n.º 4
0
        public override object Calculate(List <Box> CandidateBoxes, InspectedPanel panel, object para)
        {
            HanwhaResult result = new HanwhaResult();

            foreach (Box box in CandidateBoxes)
            {
                //[Rex]
                result.avgArea_pct   += box.Area_p;
                result.avgHeight_pct += box.Height_p;
                result.avgVolume_pct += box.Volume_p;
                result.avgArea_val   += box.Area_v;
                result.avgHeight_val += box.Height_v;
                result.avgVolume_val += box.Volume_v;
            }
            //[Rex]求出值整版 H.A.V 平均 both % and value
            result.avgArea_pct   /= CandidateBoxes.Count;
            result.avgHeight_pct /= CandidateBoxes.Count;
            result.avgVolume_pct /= CandidateBoxes.Count;
            result.avgArea_val   /= CandidateBoxes.Count;
            result.avgHeight_val /= CandidateBoxes.Count;
            result.avgVolume_val /= CandidateBoxes.Count;


            return(result);
        }
Ejemplo n.º 5
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                _CenterOffsetResult    = null;
                _RotationResult        = null;
                _StretchResult         = null;
                _DefectStatisticResult = null;

                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
                StretchAlgorithm sAlgo  = new StretchAlgorithm();
                DefectStatistic  dsAlgo = new DefectStatistic();
                //Yamaha該方法和Ese要計算 each box的HAV percentage 平均功能一致,故重用
                PadHAVAvg padAvgAlgo = new PadHAVAvg();

                _CenterOffsetResult    = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult        = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
                _StretchResult         = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
                _DefectStatisticResult = (DefectStatisticResult)dsAlgo.Calculate(Boxes, currentPanel, null); //=>從failbox來
                _PadHAVAvgResult       = (PadHAVAvgResult)padAvgAlgo.Calculate(Boxes, null, null);           //YAMAHA需要額外的avg統計
                _WipeReason            = JudgeWipeHelper.JudgeWipeByPriorityStrategy(currentPanel, Boxes);
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }
Ejemplo n.º 6
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                _CenterOffsetResult = null;
                _RotationResult     = null;
                _StretchResult      = null;
                _HanwhaResult       = null;
                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
                StretchAlgorithm sAlgo     = new StretchAlgorithm();
                HanwhaHAVAvg     hanwhaAvg = new HanwhaHAVAvg();

                _CenterOffsetResult = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult     = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
                _StretchResult      = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
                _HanwhaResult       = (HanwhaResult)hanwhaAvg.Calculate(Boxes, null, null);
                _WipeReason         = JudgeWipeHelper.JudgeWipeByPriorityStrategy(currentPanel, Boxes);
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }
Ejemplo n.º 7
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                _CenterOffsetResult    = null;
                _RotationResult        = null;
                _StretchResult         = null;
                _DefectStatisticResult = null;

                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
                StretchAlgorithm   sAlgo      = new StretchAlgorithm();
                DefectStatistic    dsAlgo     = new DefectStatistic();
                EkraFiducailOffset ekraFMAlgo = new EkraFiducailOffset();

                _CenterOffsetResult    = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult        = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
                _StretchResult         = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
                _DefectStatisticResult = (DefectStatisticResult)dsAlgo.Calculate(Boxes, currentPanel, null);

                //Wipe
                _WipeReason = JudgeWipeHelper.JudgeWipeByPriorityStrategy(currentPanel, Boxes);
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }
Ejemplo n.º 8
0
        public override object Calculate(List <Box> CandidateBoxes, InspectedPanel panel, object para)
        {
            StretchResult       result   = new StretchResult();
            List <FiducialMark> markList = panel.Panel.FiducialMarks;

            result.Stretch = 0;
            if (markList.Count >= 2)
            {
                System.Windows.Rect r;

                r = markList[0].IdealRect;
                double originX1 = r.X + r.Width * 0.5;
                double originY1 = r.Y + r.Height * 0.5;
                r = markList[1].IdealRect;
                double originX2 = r.X + r.Width * 0.5;
                double originY2 = r.Y + r.Height * 0.5;

                r = markList[0].ResultRect;
                double realX1 = r.X + r.Width * 0.5;
                double realY1 = r.Y + r.Height * 0.5;
                r = markList[1].ResultRect;
                double realX2 = r.X + r.Width * 0.5;
                double realY2 = r.Y + r.Height * 0.5;

                double distOrigin = Math.Sqrt((originX2 - originX1) * (originX2 - originX1) + (originY2 - originY1) * (originY2 - originY1));
                double distReal   = Math.Sqrt((realX2 - realX1) * (realX2 - realX1) + (realY2 - realY1) * (realY2 - realY1));

                result.Stretch = (distReal - distOrigin) / distOrigin;
                return(result);
            }
            else
            {
                return(result);//return null會造成後續寫檔錯誤
            }
        }
Ejemplo n.º 9
0
        public override bool Output(InspectedPanel currentPanel, object file)
        {
            var    _Minami_PrinterData = (Minami_PrinterData)file;
            string netDrive;

            if (!PrinterSFSetting.IsOutEnable)
            {
                return(false);
            }
            else
            {
                netDrive = WmiDiskHelper.ExtractDiskID(PrinterSFSetting.OutDriveInfo) + @"\";//Disk mapping;
            }
            string path = netDrive + String.Format("{0:yyyyMMddHHmmss}.xml", currentPanel.InspectStartTime);

            try
            {
                DateTime t       = currentPanel.InspectStartTime;
                string   strTime = string.Format("{0:0000}-{1:00}-{2:00}T{3:00}:{4:00}:{5:00}.{6:00}",
                                                 t.Year, t.Month, t.Day, t.Hour, t.Minute, t.Second, t.Millisecond);

                XElement root = new XElement("SpiData"
                                             , new XElement("ModelName", _Minami_PrinterData.ModelName)
                                             , new XElement("InspectTime", strTime)
                                             , new XElement("SN", _Minami_PrinterData.SN)
                                             , new XElement("Barcode", _Minami_PrinterData.Barcode)
                                             , new XElement("Direction", _Minami_PrinterData.PrintDirection)
                                             , new XElement("Board", new XAttribute("ID", "1")
                                                            , new XElement("FidMarkList", CreateFidElements(currentPanel)
                                                                           , new XElement("Correction"
                                                                                          , new XAttribute("RotCx", Math.Round((_RotationResult.Center.X * 0.001), 6).ToString())
                                                                                          , new XAttribute("RotCy", Math.Round((_RotationResult.Center.Y * 0.001), 6).ToString())
                                                                                          , new XElement("X", Math.Round((_CenterOffsetResult.Dx * 0.001), 6).ToString())
                                                                                          , new XElement("Y", Math.Round((_CenterOffsetResult.Dy * 0.001), 6).ToString())
                                                                                          , new XElement("Theta", Math.Round(_RotationResult.Theta, 6).ToString())
                                                                                          , new XElement("Stretch", Math.Round(_StretchResult.Stretch, 6).ToString())
                                                                                          )
                                                                           )
                                                            )
                                             );

                root.Save(path);
                Log4.PrinterLogger.InfoFormat("Save @ {0} [Minami]", path);
            }
            catch (Exception e)
            {
                Log4.PrinterLogger.InfoFormat("Save @ {0} Exception [Minami]", path);
                Log4.PrinterLogger.InfoFormat("{0}", e.Message);
                throw new OutputException(e.Message);
                //return false;
            }
            return(true);
        }
Ejemplo n.º 10
0
        private int GetTotalBoxCount(InspectedPanel panel)
        {
            int count = 0;

            foreach (var b in panel.Panel.Boards)
            {
                foreach (var c in b.Components)
                {
                    count += c.Boxes.Count();
                }
            }
            return(count);
        }
Ejemplo n.º 11
0
        private XElement PROCESS_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            DateTime now = DateTime.Now;
            XElement ret = new XElement(
                "PROCESS",
                new XElement("ProductName", currentPanel.Panel.ModelName),//目前用檢測的資料為主,SPEC沒有註明
                new XElement("Date", now.ToString("yyyy_MM_dd")),
                new XElement("Time", now.ToString("HH_mm_ss")),
                //new XElement("PanelState", PanelStatus == eClosedLoopSPIStatus.NonInspected ? "NOT_INSPECTED" : "INSPECTED")//有INSPECTED / NOT_INSPECTED
                new XElement("PanelState", "INSPECTED") //有INSPECTED / NOT_INSPECTED
                );

            return(ret);
        }
Ejemplo n.º 12
0
        public eWipeStencilReason Judge(InspectedPanel panel, List <Box> Candidates)
        {
            eWipeStencilReason ret = eWipeStencilReason.NoNeedToWipe;

            foreach (var box in Candidates)
            {
                if (box.Bridge_Status != eIndividualStatus.SOL_OK)
                {
                    ret = eWipeStencilReason.PrintingResultsAreTooBad;
                    break;
                }
            }

            return(ret);
        }
Ejemplo n.º 13
0
        public static eWipeStencilReason JudgeWipeByPriorityStrategy(InspectedPanel currentPanel, List <Box> boxes)
        {
            eWipeStencilReason ret = eWipeStencilReason.NoNeedToWipe;
            var wipeRoutines       = PrinterManager.getInstance().JudgeWipeRoutines;

            foreach (var wipe in wipeRoutines)
            {
                ret = wipe.Judge(currentPanel, boxes);
                if (ret != eWipeStencilReason.NoNeedToWipe)
                {
                    break;
                }
            }
            return(ret);
        }
Ejemplo n.º 14
0
        private List <Box> GetBoxList(InspectedPanel panel)
        {
            List <Box> retLst = new List <Box>();

            foreach (var board in panel.Panel.Boards)
            {
                foreach (var component in board.Components)
                {
                    foreach (var box in component.Boxes)
                    {
                        retLst.Add(box);
                    }
                }
            }
            return(retLst);
        }
Ejemplo n.º 15
0
        public eWipeStencilReason Judge(InspectedPanel panel, List <Box> Candidates)
        {
            eWipeStencilReason ret = eWipeStencilReason.NoNeedToWipe;

            foreach (var box in Candidates)
            {
                var value = box.Volume_p; //原: box.inspectResult.volume.dPercent;
                //Maximum/Minimum peak of single pad volume: 正常為55%~140% , 若超出異常)
                if (value < PeakOfSinglePadUnderLimit || value > PeakOfSinglePadOverLimit)
                {
                    ret = eWipeStencilReason.PrintingResultsAreTooBad;
                    break;
                }
            }
            return(ret);
        }
Ejemplo n.º 16
0
        private XElement DEFECT_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            //var tree = new TreeAccess(Panel);
            //int PanelIndex = ProjectManager.getInstance().GetCurrentCarrier().GetPanelIndex(Panel);

            var      _boxList  = GetBoxList(currentPanel);
            var      _failList = FailList(currentPanel);
            XElement ret       = new XElement(
                "DEFECT",
                new XElement("TotalCount", _boxList.Count),
                new XElement("DefectCount",
                             new XAttribute("count", _failList.Count),
                             new XElement("Height",
                                          new XAttribute("high", GetCount(_boxList, eOverallStatus.SOL_HEIGHTOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_HEIGHTUNDER))
                                          ),
                             new XElement("Volume",
                                          new XAttribute("heigh", GetCount(_boxList, eOverallStatus.SOL_VOLUMEOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_VOLUMEUNDER))
                                          ),
                             new XElement("Area",
                                          new XAttribute("heigh", GetCount(_boxList, eOverallStatus.SOL_AREAOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_AREAUNDER))
                                          ),
                             new XElement("Bridge",
                                          new XAttribute("count", GetCount(_boxList, eOverallStatus.SOL_BRIDGE))
                                          )


                             ),
                //new XElement("WarningCount",
                //                            new XAttribute("count", InspectResultClass.getInstance().WarningCnt[PanelIndex])
                //                            //new XElement("Height", InspectResultClass.getInstance().Fail[PanelIndex].)
                //                            )
                new XElement("DefectPosition", from box in _boxList
                             let id                                                                                                                                                                                                                                      = box.FullName
                                                                                               let posx                                                                                                                                                                  = box.CadCenter.X * 0.001 //Pad Position
                                                                                                                                                        let posy                                                                                                         = box.CadCenter.Y * 0.001
                                                                                                                                                                                                      let sizex                                                          = box.CadRect.Width * 0.001
                                                                                                                                                                                                                                         let sizey                       = box.CadRect.Height * 0.001
                                                                                                                                                                                                                                                                let code = ToHanwhaPadType(box.Status)
                                                                                                                                                                                                                                                                           select new XElement("Pad", new XAttribute("id", id), new XAttribute("posx", posx), new XAttribute("posy", posy), new XAttribute("sizex", sizex), new XAttribute("sizey", sizey), new XAttribute("code", code))
                             )
                );

            return(ret);
        }
Ejemplo n.º 17
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            _CenterOffsetResult = null;
            _RotationResult     = null;
            _StretchResult      = null;

            var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

            //Calculate
            CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
            RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
            StretchAlgorithm sAlgo = new StretchAlgorithm();

            _CenterOffsetResult = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
            _RotationResult     = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
            _StretchResult      = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
            _WipeReason         = JudgeWipeHelper.JudgeWipeByPriorityStrategy(currentPanel, Boxes);
        }
Ejemplo n.º 18
0
        public override bool Output(InspectedPanel currentPanel, object file)
        {
            string netDrive;

            if (!PrinterSFSetting.IsOutEnable)
            {
                return(false);
            }
            else
            {
                netDrive = WmiDiskHelper.ExtractDiskID(PrinterSFSetting.OutDriveInfo) + @"\";//Disk mapping;
            }
            string             path = netDrive + String.Format("{0:yyyyMMddHHmmss}.xml", currentPanel.InspectStartTime);
            INOTIS_PrinterData _INOTIS_PrinterData = file as INOTIS_PrinterData;

            try
            {
                XElement root = new XElement("Data",
                                             new XElement(
                                                 "Process",
                                                 new XElement("Direction", _INOTIS_PrinterData.sPrint_Direction),
                                                 new XElement("Offset_Correction",
                                                              new XElement("X", Math.Round((_CenterOffsetResult.Dx * 0.001), 6)),
                                                              new XElement("Y", Math.Round((_CenterOffsetResult.Dy * 0.001), 6)),
                                                              new XElement("Theta", new XAttribute("CoR_X", Math.Round((_RotationResult.Center.X * 0.001), 6)),
                                                                           new XAttribute("CoR_Y", Math.Round((_RotationResult.Center.Y * 0.001), 6)),
                                                                           Math.Round(_RotationResult.Theta, 6)),
                                                              new XElement("Stretch", Math.Round(_StretchResult.Stretch, 6))
                                                              ) //Offset_Correction
                                                 )              //Process
                                             );
                root.Save(path);
                Log4.PrinterLogger.InfoFormat("Save @ {0} [INOTIS]", path);
            }
            catch (Exception e)
            {
                Log4.PrinterLogger.InfoFormat("Save @ {0} Exception [INOTIS]", path);
                Log4.PrinterLogger.InfoFormat("{0}", e.Message);
                throw new OutputException(e.Message);
                //return false;
            }

            return(true);
        }
Ejemplo n.º 19
0
        private XElement HEADER_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            XElement ret = new XElement(
                "HEADER",
                new XElement("MachineName", "SPI"),              //SPI fixed
                new XElement("Reference", "BOTTOM_LEFT"),        //應依照象限,固定,所以請設定象限1  [Has Comfirmed]
                new XElement("Units",
                             new XElement("Distance", "mm"),     //固定 [Has Comfirmed]
                             new XElement("Angle", "degree"),    //固定 [Has Comfirmed]
                             new XElement("Time", "seconds"),    //固定 [Has Comfirmed]
                             new XElement("Ratio", "percentage") //固定 [Has Comfirmed]
                             ),

                new XElement("DefineDirection", data.Header.DefineDirection)//不確定是否要按照得來的資訊 // Use as DEFINE_VERTICAL固定 [Has Comfirmed]

                );

            return(ret);
        }
Ejemplo n.º 20
0
        private XElement PANEL_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            List <FiducialMark> fidList = currentPanel.Panel.FiducialMarks;
            XElement            ret     = new XElement(
                "PANEL",
                new XElement("PanelId", "0"),//Panel ID 取流水碼
                new XElement("BarcodeId", currentPanel.Panel.PanelBarcode),

                new XElement("Stencil", new XAttribute("thickness", "0.100")),
                new XElement("PanelSize", new XAttribute("width", currentPanel.Panel.FullCadRect.Width * 0.001), new XAttribute("height", currentPanel.Panel.FullCadRect.Height * 0.001)), //單位mm [has confirmed] SPI是um
                new XElement("Fiducials",
                             from fid in fidList
                             select new XElement("Fiducial", new XAttribute("id", fidList.IndexOf(fid)),
                                                 new XAttribute("pos_x", fid.CadRect.Location.X * 0.001),                       //單位mm [has confirmed] SPI是um
                                                 new XAttribute("pos_y", fid.CadRect.Location.Y * 0.001))                       //單位mm [has confirmed] SPI是um
                             )
                );

            return(ret);
        }
        public eWipeStencilReason Judge(InspectedPanel panel, List <Box> Candidates)
        {
            eWipeStencilReason ret = eWipeStencilReason.NoNeedToWipe;


            foreach (var box in panel.FailList())
            {
                if (box.Status == eOverallStatus.SOL_BY_RPASS)
                {
                    continue;
                }

                if (box.ContinueFailCnt >= CntFailTimes)
                {
                    ret = eWipeStencilReason.PrintingResultsAreTooBad;
                    break;
                }
            }
            return(ret);
        }
Ejemplo n.º 22
0
        //spec規定的Board就是Panel
        private List <XElement> CreateFidElements(InspectedPanel currentPanel)
        {
            List <XElement> elFidList = new List <XElement>();

            int count = 1;

            foreach (var fm in currentPanel.Panel.FiducialMarks)
            {
                var elFM = new XElement("FidMark"
                                        , new XAttribute("Name", "MARK" + count.ToString())
                                        , new XAttribute("X", fm.CadCenter.X)
                                        , new XAttribute("Y", fm.CadCenter.Y)
                                        );
                elFidList.Add(elFM);
                count++;
            }


            return(elFidList);
        }
Ejemplo n.º 23
0
        private List <XElement> CreateFiducailElements(InspectedPanel panel)
        {
            List <XElement> ret   = new List <XElement>();
            int             count = 1;

            if (panel.Panel.FiducialMarks.Count >= 2)
            {
                foreach (var fm in panel.Panel.FiducialMarks)
                {
                    var elFM = new XElement("Fiducial"
                                            , new XAttribute("id", "PANELMARK" + (count + 1).ToString())
                                            , new XAttribute("pos_x", Math.Round(((fm.CadCenter.X - panel.Panel.FullCadRect.X) * 0.001), 6).ToString())
                                            , new XAttribute("pos_y", Math.Round(((fm.CadCenter.Y - panel.Panel.FullCadRect.Y) * 0.001), 6).ToString())
                                            );
                    count++;
                    ret.Add(elFM);
                }
            }

            return(ret);
        }
Ejemplo n.º 24
0
        public eWipeStencilReason Judge(InspectedPanel panel, List <Box> Candidates)
        {
            eWipeStencilReason ret           = eWipeStencilReason.NoNeedToWipe;
            double             avgVolPercent = 0;

            foreach (var box in Candidates)
            {
                avgVolPercent += box.Volume_p;//box.inspectResult.volume.dPercent;
            }

            avgVolPercent /= Candidates.Count();

            //Overall average volume: 正常為92%~105% , 若外擴+-5%, 所以預設87%~110%為異常)
            if (avgVolPercent < AvgVolUnderLimit || avgVolPercent > AvgVolOverLimit)
            {
                ret = eWipeStencilReason.PrintingResultsAreTooBad;
            }


            return(ret);
        }
Ejemplo n.º 25
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());

                PadHAVAvg yamahaAlgo = new PadHAVAvg();

                _CenterOffsetResult = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult     = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);

                _PadHAVAvgResult = (PadHAVAvgResult)yamahaAlgo.Calculate(Boxes, null, null);//YAMAHA需要額外的avg統計
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }
Ejemplo n.º 26
0
        public override bool Output(InspectedPanel currentPanel, object file)
        {
            var    _Hanwha_PrinterData = (Hanwha_PrinterData)file;
            string netDrive;

            if (!PrinterSFSetting.IsOutEnable)
            {
                return(false);
            }
            else
            {
                netDrive = WmiDiskHelper.ExtractDiskID(PrinterSFSetting.OutDriveInfo) + @"\";//Disk mapping;
            }
            string path = netDrive + String.Format("{0:yyyyMMddHHmmss}.xml", currentPanel.InspectStartTime);

            try
            {
                XElement root = new XElement(
                    "ResultInsp",
                    HEADER_SECTION(currentPanel, _Hanwha_PrinterData),
                    PROCESS_SECTION(currentPanel, _Hanwha_PrinterData),
                    PANEL_SECTION(currentPanel, _Hanwha_PrinterData),
                    MEASUREMENTS_SECTION(_Hanwha_PrinterData),
                    DEFECT_SECTION(currentPanel, _Hanwha_PrinterData),
                    OPTIONAL_SECTION()
                    );
                root.Save(path);
                Log4.PrinterLogger.InfoFormat("Save @ {0} [Hanwha]", path);
            }
            catch (Exception e)
            {
                Log4.PrinterLogger.InfoFormat("Save @ {0} Exception [Hanwha]", path);
                Log4.PrinterLogger.InfoFormat("{0}", e.Message);
                throw new OutputException(e.Message);
                //return false;
            }

            return(true);
        }
Ejemplo n.º 27
0
        //Custom CSV
        public override bool CustomOutput(InspectedPanel currentPanel, object file)
        {
            bool isCustomEnable = false;

            using (IniFile ini = new IniFile())
                isCustomEnable = ini.IsSectionExist("Custom");

            if (isCustomEnable)//客製化enable
            {
                var customVM = ViewModelLocator.Atom.CustomVM;
                try
                {
                    OutputGKGCSV OutputCSV;
                    if (LaneID == eAssignedLane_Printer.Lane1 && customVM.bGKGCSVLane1)
                    {
                        OutputCSV = new OutputGKGCSV(customVM.GKGCSVLane1Path);
                        OutputCSV.Run(currentPanel);
                    }
                    else if (LaneID == eAssignedLane_Printer.Lane2 && customVM.bGKGCSVLane2)
                    {
                        OutputCSV = new OutputGKGCSV(customVM.GKGCSVLane2Path);
                        OutputCSV.Run(currentPanel);
                    }
                }
                catch (Exception e)
                {
                    Log4.PrinterLogger.InfoFormat("Save @ {0} Exception [GKG.CSV]");
                    throw new CustomOutputException(e.Message);
                }


                return(true);
            }
            else
            {
                return(false);//沒有客製化ini eanble
            }
        }
Ejemplo n.º 28
0
        private XElement CreateFiducalElement(InspectedPanel currentPanel)
        {
            int      count = 0;
            XElement ret   = new XElement("Fiducials", new XAttribute("Count", currentPanel.Panel.FiducialMarks.Count));

            foreach (var fm in currentPanel.Panel.FiducialMarks)
            {
                var elFM = new XElement("Fiducial"
                                        , new XAttribute("Name", "Fid " + count.ToString())
                                        , new XElement("X"
                                                       , new XAttribute("Origin", Math.Round(fm.CadCenter.X * 0.001, 3).ToString())
                                                       , Math.Round(fm.ResultRect.X * 0.001, 3).ToString()
                                                       )
                                        , new XElement("Y"
                                                       , new XAttribute("Origin", Math.Round(fm.CadCenter.Y * 0.001, 3).ToString())
                                                       , Math.Round(fm.ResultRect.Y * 0.001, 3).ToString()
                                                       )
                                        );
                ret.Add(elFM);
                count++;
            }
            return(ret);
        }
Ejemplo n.º 29
0
        private List <XElement> CreateFidMark(InspectedPanel currentPanel)
        {
            List <XElement> retFidMarks = new List <XElement>();
            int             index       = 1;

            if (currentPanel.Panel.FiducialMarks.Count >= 2)
            {
                foreach (var fm in currentPanel.Panel.FiducialMarks)
                {
                    var elFM = new XElement("FidMark"
                                            , new XAttribute("Name", "PANELMARK" + index.ToString())
                                            , new XAttribute("X", Math.Round(((fm.CadCenter.X - currentPanel.Panel.FullCadRect.X) * 0.001), 6).ToString())
                                            , new XAttribute("Y", Math.Round(((fm.CadCenter.Y - currentPanel.Panel.FullCadRect.Y) * 0.001), 6).ToString())
                                            );
                    retFidMarks.Add(elFM);
                }
            }
            else
            {
                return(null);
            }
            return(retFidMarks);
        }
Ejemplo n.º 30
0
        private XElement GreateFidMarkElement(InspectedPanel panel)
        {
            var fmlist   = panel.Panel.FiducialMarks;
            var eleStart = new XElement("FidMarkList");

            List <XElement> eleFM = new List <XElement>();

            for (int i = 0; i < fmlist.Count; i++)
            {
                eleFM.Add(new XElement("FidMark",
                                       new XAttribute("Name", "PANELMARK" + (i + 1).ToString()),
                                       new XAttribute("X", Math.Round(((fmlist[i].CadCenter.X - panel.Panel.FullCadRect.X) * 0.001), 6).ToString()),
                                       new XAttribute("Y", Math.Round(((fmlist[i].CadCenter.Y - panel.Panel.FullCadRect.Y) * 0.001), 6).ToString())
                                       ));
            }
            if (fmlist.Count != 0)
            {
                foreach (var ele in eleFM)
                {
                    eleStart.Add(ele);
                }
            }
            return(eleStart);
        }