private SendResultParameter GetLeadFormAlignResultAnalysis()
        {
            SendResultParameter _SendResParam = new SendResultParameter();

            _SendResParam.ID          = ID;
            _SendResParam.NgType      = eNgType.GOOD;
            _SendResParam.IsGood      = true;
            _SendResParam.ProjectItem = ProjectItem;

            SendLeadResult _SendResult = new SendLeadResult();

            for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount)
            {
            }

            return(_SendResParam);
        }
Esempio n. 2
0
        public override bool SendResultData(SendResultParameter _ResultParam)
        {
            bool _Result = true;

            if (_ResultParam.ProjectItem == eProjectItem.NEEDLE_ALIGN)
            {
                string _VisionString, _ResultString;
                _VisionString = String.Format("V{0}", _ResultParam.ID + 1);

                if (_ResultParam.IsGood)
                {
                    _ResultString = "OK";
                }
                else
                {
                    _ResultString = "NG";
                }

                var _SendResult = _ResultParam.SendResult as SendNeedleAlignResult;

                if (_SendResult == null)
                {
                    _SendResult        = new SendNeedleAlignResult();
                    _SendResult.AlignX = 0;
                    _SendResult.AlignY = 0;
                    _ResultString      = "NG";
                }

                //LDH, 2018.09.04, TILab 프로토콜 생성
                string[] _DataStringAlign  = ChangeResult(_SendResult.AlignX, _SendResult.AlignY);
                string   _ResultDataString = string.Format("{0},{1},{2},{3}", _VisionString, _ResultString, _DataStringAlign[0], _DataStringAlign[1]);
                EthernetServWnd.SendResultData(_ResultDataString);
                AckStructs[_ResultParam.ID].Initialize();
            }

            else if (_ResultParam.ProjectItem == eProjectItem.LEAD_INSP)
            {
                string _VisionString, _ResultString;
                _VisionString = String.Format("V{0}", _ResultParam.ID + 1);

                if (_ResultParam.IsGood)
                {
                    _ResultString = "OK";
                }
                else
                {
                    _ResultString = "NG";
                }

                var _SendResult = _ResultParam.SendResult as SendLeadResult;

                if (_SendResult == null)
                {
                    _SendResult   = new SendLeadResult();
                    _ResultString = "NG";
                }

                string _ResultDataString = string.Format("{0},{1},00000,00000", _VisionString, _ResultString);
                EthernetServWnd.SendResultData(_ResultDataString);
                AckStructs[_ResultParam.ID].Initialize();
            }

            return(_Result);
        }
Esempio n. 3
0
        private SendResultParameter GetLeadInspectionResultAnalysis()
        {
            SendResultParameter _SendResParam = new SendResultParameter();

            _SendResParam.ID          = ID;
            _SendResParam.NgType      = eNgType.GOOD;
            _SendResParam.IsGood      = true;
            _SendResParam.ProjectItem = ProjectItem;

            SendLeadResult _SendResult = new SendLeadResult();

            for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount)
            {
                if (eAlgoType.C_LEAD == AlgoResultParamList[iLoopCount].ResultAlgoType)
                {
                    var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLeadResult;

                    _SendResult.LeadCount      = _AlgoResultParam.LeadCount;
                    _SendResult.LeadAngle      = _AlgoResultParam.Angle;
                    _SendResult.LeadWidth      = _AlgoResultParam.Width;
                    _SendResult.LeadLength     = _AlgoResultParam.LeadLength;
                    _SendResult.LeadPitchTopX  = _AlgoResultParam.LeadPitchTopX;
                    _SendResult.LeadPitchTopY  = _AlgoResultParam.LeadPitchTopY;
                    _SendResult.IsLeadBendGood = _AlgoResultParam.IsLeadBentGood;

                    _SendResParam.IsGood    &= _AlgoResultParam.IsGood;
                    _SendResParam.SendResult = _SendResult;
                    if (_SendResParam.NgType == eNgType.GOOD)
                    {
                        _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.LEAD_BENT;
                    }

                    _SendResParam.IsGood &= _AlgoResultParam.IsLeadCountGood;
                    if (false == _AlgoResultParam.IsLeadCountGood)
                    {
                        _SendResParam.NgType = eNgType.LEAD_CNT;
                    }
                }

                else if (AlgoResultParamList[iLoopCount].ResultAlgoType == eAlgoType.C_LINE_FIND)
                {
                    var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult;

                    _SendResult.BodyReferenceX = (_AlgoResultParam.StartX + _AlgoResultParam.EndX) / 2;
                    _SendResult.BodyReferenceY = (_AlgoResultParam.StartY + _AlgoResultParam.EndY) / 2;
                }

                else if (AlgoResultParamList[iLoopCount].ResultAlgoType == eAlgoType.C_BLOB_REFER)
                {
                }

                else if (AlgoResultParamList[iLoopCount].ResultAlgoType == eAlgoType.C_PATTERN)
                {
                }
            }

            //Mergy Result
            if (_SendResult.LeadPitchTopX != null && _SendResult.LeadPitchTopY != null && _SendResult.LeadLength != null)
            {
                _SendResult.LeadWidthReal  = new double[_SendResult.LeadPitchTopX.Length];
                _SendResult.LeadLengthReal = new double[_SendResult.LeadPitchTopX.Length];

                for (int iLoopCount = 0; iLoopCount < _SendResult.LeadPitchTopX.Length; ++iLoopCount)
                {
                    _SendResult.LeadLength[iLoopCount]     = Math.Abs(_SendResult.BodyReferenceY - _SendResult.LeadPitchTopY[iLoopCount]);
                    _SendResult.LeadLengthReal[iLoopCount] = _SendResult.LeadLength[iLoopCount] * ResolutionY;
                    _SendResult.LeadWidthReal[iLoopCount]  = _SendResult.LeadWidth[iLoopCount] * ResolutionY;

                    CogLineSegment _LengthLine = new CogLineSegment();
                    _LengthLine.SetStartEnd(_SendResult.LeadPitchTopX[iLoopCount], _SendResult.LeadPitchTopY[iLoopCount],
                                            _SendResult.LeadPitchTopX[iLoopCount], _SendResult.BodyReferenceY);
                    ResultDisplay(_LengthLine, "LengthLine" + (iLoopCount + 1), CogColorConstants.Green);
                }
            }

            return(_SendResParam);
        }