private SendResultParameter GetSurfaceInspectionResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_MULTI_PATTERN == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogMultiPatternResult; SendSurfaceResult _SendResult = new SendSurfaceResult(); _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResult.TwoPointAngle = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.TwoPointAngle : 0.0; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.M_REF; } _SendResParam.SendResult = _SendResult; } } return(_SendResParam); }
public override bool SendResultData(SendResultParameter _ResultParam) { bool _Result = true; bool _ResultFlag = _ResultParam.IsGood; int SendResultBit = 0; if (!_ResultFlag) { switch (_ResultParam.NgType) { case eNgType.REF_NG: SendResultBit = (short)DIOWnd.DioBaseCmd.OutputBitIndexCheck(DIO_DEF.OUT_RESULT_1); break; case eNgType.ID: SendResultBit = (short)DIOWnd.DioBaseCmd.OutputBitIndexCheck(DIO_DEF.OUT_RESULT_1); break; case eNgType.DEFECT: SendResultBit = (short)DIOWnd.DioBaseCmd.OutputBitIndexCheck(DIO_DEF.OUT_RESULT_1); break; //case eNgType.DUMMY: SendResultBit = (short)DIOWnd.DioBaseCmd.OutputBitIndexCheck(DIO_DEF.OUT_RESULT_3); break; } DIOWnd.SetOutputSignal((short)SendResultBit, true); } InspectionComplete(0, true); //AckStructs[_ResultParam.ID].Initialize(); return(_Result); }
public void SetResultData(SendResultParameter _ResultParam) { //if (_ResultParam.ProjectItem == eProjectItem.NEEDLE_ALIGN) SetNeedleAlignResultData(_ResultParam); //else if (_ResultParam.ProjectItem == eProjectItem.LEAD_INSP) SetLeadInspectionResultData(_ResultParam); //else if (_ResultParam.ProjectItem == eProjectItem.ID_INSP) SetIDInspectionResultData(_ResultParam); //if (ProjectType == eProjectType.BLOWER) MainResultIDWnd.SetResultData(_ResultParam); //else if (ProjectType == eProjectType.DISPENSER) MainResultLeadWnd.SetResultData(_ResultParam); if (_ResultParam.ProjectItem == eProjectItem.NONE) { MainResultNoneWnd.SetNoneResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.ID_INSP) { MainResultIDWnd.SetResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.NEEDLE_ALIGN) { MainResultLeadWnd.SetNeedleResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.LEAD_INSP) { MainResultLeadWnd.SetLeadResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.SURFACE) { MainResultSorterWnd.SetSurfaceResultData(_ResultParam); } }
public void SetResultData(SendResultParameter _ResultParam) { if (_ResultParam.ProjectItem == eProjectItem.NONE) { MainResultNoneWnd.SetNoneResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.ID_INSP) { MainResultIDWnd.SetResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.NEEDLE_ALIGN) { MainResultLeadWnd.SetNeedleResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.LEAD_INSP) { MainResultLeadWnd.SetLeadResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.SURFACE) { MainResultSorterWnd.SetSurfaceResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.LEAD_TRIM_INSP) { MainResultTrimFormWnd.SetTrimResultData(_ResultParam); } else if (_ResultParam.ProjectItem == eProjectItem.LEAD_FORM_ALIGN) { MainResultTrimFormWnd.SetFormResultData(_ResultParam); } }
private void SetResultData(object _Result) { SendResultParameter _SendResParam = _Result as SendResultParameter; ResultBaseWnd.SetResultData(_SendResParam); CLogManager.AddSystemLog(CLogManager.LOG_TYPE.INFO, String.Format("Main : SetResultData")); }
private SendResultParameter GetLeadFormAlignResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; SendLeadFormResult _SendResult = new SendLeadFormResult(); for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_LINE_FIND == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult; //_SendResult.BodyReferenceX = (_AlgoResultParam.StartX + _AlgoResultParam.EndX) / 2; //_SendResult.BodyReferenceY = (_AlgoResultParam.StartY + _AlgoResultParam.EndY) / 2; } else if (eAlgoType.C_LEAD_FORM == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlignResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLeadFormResult; _SendResult.LeadCount = _AlignResultParam.LeadCount; _SendResult.LeadOffset = new PointD[_SendResult.LeadCount]; _SendResult.IsLeadOffsetGood = new bool[_SendResult.LeadCount]; if (_AlignResultParam.NgType != eNgType.LEAD_CNT) { for (int jLoopCount = 0; jLoopCount < _AlignResultParam.LeadCount; ++jLoopCount) { _SendResult.LeadOffset[jLoopCount] = new PointD(); _SendResult.LeadOffset[jLoopCount].X = _AlignResultParam.AlignOffsetDataList[jLoopCount].X; _SendResult.LeadOffset[jLoopCount].Y = _AlignResultParam.AlignOffsetDataList[jLoopCount].Y; _SendResult.IsLeadOffsetGood[jLoopCount] = _AlignResultParam.AlignResultDataList[jLoopCount].IsGood; } } //결과 분석 _SendResult.EachLeadStatusArray = _AlignResultParam.EachLeadStatusArray; _SendResult.LeadCountStatus = _AlignResultParam.LeadCountStatus; _SendResult.LeadBodyStatus = _AlignResultParam.LeadBodyStatus; _SendResParam.SendResult = _SendResult; _SendResParam.NgType = _AlignResultParam.NgType; _SendResParam.IsGood = _AlignResultParam.IsGood; _SendResParam.SearchArea = _AlignResultParam.SearchArea; } } _SendResult.SaveImage = OriginConstImage; _SendResult.ImageAutoSave = ImageAutoSaveMode; return(_SendResParam); }
private SendResultParameter GetLeadTrimInspectionResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; SendLeadTrimResult _SendResult = new SendLeadTrimResult(); for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_LINE_FIND == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult; _SendResParam.IsGood = _AlgoResultParam.IsGood; //_SendResult.BodyReferenceX = (_AlgoResultParam.StartX + _AlgoResultParam.EndX) / 2; //_SendResult.BodyReferenceY = (_AlgoResultParam.StartY + _AlgoResultParam.EndY) / 2; } else if (eAlgoType.C_LEAD_TRIM == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLeadTrimResult; _SendResult.LeadCount = _AlgoResultParam.LeadCount; _SendResult.LeadLengthReal = _AlgoResultParam.LeadLength; _SendResult.IsLeadLengthGood = _AlgoResultParam.IsLeadLengthGood; _SendResult.LeadPitchReal = _AlgoResultParam.LeadPitchLength; _SendResult.IsLeadPitchGood = _AlgoResultParam.IsLeadBentGood; //결과 분석 _SendResult.EachLeadStatusArray = _AlgoResultParam.EachLeadStatusArray; _SendResult.ChipOutStatus = _AlgoResultParam.ChipOutStatus; _SendResult.LeadBodyStatus = _AlgoResultParam.LeadBodyStatus; _SendResult.LeadCountStatus = _AlgoResultParam.LeadCountStatus; _SendResult.GateRemainingStatus = _AlgoResultParam.GateRemainingStatus; _SendResParam.SendResult = _SendResult; _SendResParam.NgType = _AlgoResultParam.NgType; _SendResParam.IsGood = _AlgoResultParam.IsGood; _SendResParam.SearchArea = _AlgoResultParam.SearchArea; } } _SendResult.SaveImage = OriginConstImage; _SendResult.ImageAutoSave = ImageAutoSaveMode; return(_SendResParam); }
private SendResultParameter GetNeedleFindResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_NEEDLE_FIND == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogNeedleFindResult; SendNeedleAlignResult _SendResult = new SendNeedleAlignResult(); _SendResult.AlignX = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.CenterXReal : 0; _SendResult.AlignY = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.CenterYReal : 0; _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResParam.SendResult = _SendResult; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.NDL_CENTER; } } else if (eAlgoType.C_BLOB_REFER == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBlobReferenceResult; SendIDResult _SendResult = new SendIDResult(); _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.BlobCount > 0) ? eNgType.GOOD : eNgType.NDL_FIND; } } else if (eAlgoType.C_PATTERN == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogPatternResult; SendNeedleAlignResult _SendResult = new SendNeedleAlignResult(); _SendResParam.IsGood = _AlgoResultParam.IsGood; _SendResult.AlignX = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.OriginPointX[0] : 0; _SendResult.AlignY = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.OriginPointY[0] : 0; } } return(_SendResParam); }
public void SetNoneResultData(SendResultParameter _ResultParam) { var _Result = _ResultParam.SendResult as SendNoneResult; if (_Result != null) { if (_ResultParam.IsGood) { if (CParameterManager.SystemMode == eSysMode.AUTO_MODE) { TotalCount++; GoodCount++; Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegGood, GoodCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } LastResult = "GOOD"; ControlInvoke.GradientLabelText(gradientLabelResult, "GOOD", Color.Lime); } else { if (CParameterManager.SystemMode == eSysMode.AUTO_MODE) { TotalCount++; NgCount++; Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegNg, NgCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } if (eNgType.NONE == _ResultParam.NgType) { LastResult = "NG"; ControlInvoke.GradientLabelText(gradientLabelResult, "NG", Color.Red); } else { LastResult = "NG"; ControlInvoke.GradientLabelText(gradientLabelResult, "NG", Color.Red); } } } SaveResultCount(); InspectionHistory(_ResultParam.ID, LastResult); }
private SendResultParameter GetCardImageSaveResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; SendCardImageSaveResult _SendResult = new SendCardImageSaveResult(); _SendResult.SaveImage = OriginImage; _SendResParam.SendResult = _SendResult; return(_SendResParam); }
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); }
private SendResultParameter GetDefaultInspectionResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_ID == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBarCodeIDResult; SendNoneResult _SendResult = new SendNoneResult(); for (int jLoopCount = 0; jLoopCount < _AlgoResultParam.IDResult.Length; ++jLoopCount) { _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResult.ReadCode = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.IDResult[jLoopCount] : ""; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.ID; } } _SendResParam.SendResult = _SendResult; } else if (eAlgoType.C_PATTERN == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogPatternResult; SendNoneResult _SendResult = new SendNoneResult(); _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.REF_NG; } _SendResult.MatchingScore = _AlgoResultParam.Score[0]; _SendResParam.SendResult = _SendResult; } } return(_SendResParam); }
private SendResultParameter GetCardIDResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_ID == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBarCodeIDResult; SendCardIDResult _SendResult = new SendCardIDResult(); for (int jLoopCount = 0; jLoopCount < _AlgoResultParam.IDResult.Length; jLoopCount++) { _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResult.ReadCode = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.IDResult[jLoopCount] : ""; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.ID; } } _SendResParam.SendResult = _SendResult; } else if (eAlgoType.C_LINE_FIND == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult; _SendResParam.IsGood = _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.EMPTY; } } } return(_SendResParam); }
private SendResultParameter GetCardExistResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = false; _SendResParam.ProjectItem = ProjectItem; SendCardExistResult _SendResult = new SendCardExistResult(); _SendResult.IsGoods = new bool[2]; _SendResult.IsGoods[0] = true; _SendResult.IsGoods[1] = true; _SendResult.SaveImage = OriginImage; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult; if (iLoopCount < 1) { _SendResult.IsGoods[0] &= _AlgoResultParam.IsGood; } else { _SendResult.IsGoods[1] &= _AlgoResultParam.IsGood; } } //LDH, 2019.03.21, 카드가 1개도 없으면 NG 처리 for (int jLoopCount = 0; jLoopCount < 2; jLoopCount++) { _SendResParam.IsGood |= _SendResult.IsGoods[0]; } _SendResParam.SendResult = _SendResult; return(_SendResParam); }
private SendResultParameter GetResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; //ProjectItem Measure를 사용할경우 결과값 전달용 _SendResParam.SendResultList = new object[AlgoResultParamList.Count]; _SendResParam.AlgoTypeList = new eAlgoType[AlgoResultParamList.Count]; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_ELLIPSE == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogEllipseResult; SendMeasureResult _SendResult = new SendMeasureResult(); _SendResult.CaliperPointX = new double[_AlgoResultParam.PointFoundCount]; _SendResult.CaliperPointY = new double[_AlgoResultParam.PointFoundCount]; for (int jLoopCount = 0; jLoopCount < _AlgoResultParam.PointFoundCount; jLoopCount++) { _SendResult.CaliperPointX[jLoopCount] = _AlgoResultParam.PointPosXInfo[jLoopCount]; _SendResult.CaliperPointY[jLoopCount] = _AlgoResultParam.PointPosYInfo[jLoopCount]; } _SendResParam.AlgoTypeList[iLoopCount] = eAlgoType.C_ELLIPSE; _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.MEASURE; } _SendResult.NGAreaNum = AlgoResultParamList[iLoopCount].NgAreaNumber; _SendResult.IsGoodAlgo = _AlgoResultParam.IsGood; _SendResult.RadiusX = _AlgoResultParam.RadiusX * ResolutionX; _SendResult.RadiusY = _AlgoResultParam.RadiusY * ResolutionY; _SendResult.DiameterMinAlgo = _AlgoResultParam.DiameterMinAlgo; _SendResult.DiameterMaxAlgo = _AlgoResultParam.DiameterMaxAlgo; _SendResParam.SendResultList[iLoopCount] = _SendResult; } else if (eAlgoType.C_BLOB_REFER == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBlobReferenceResult; SendMeasureResult _SendResult = new SendMeasureResult(); _SendResParam.AlgoTypeList[iLoopCount] = eAlgoType.C_BLOB_REFER; _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.MEASURE; } _SendResult.NGAreaNum = AlgoResultParamList[iLoopCount].NgAreaNumber; _SendResult.IsGoodAlgo = _AlgoResultParam.IsGood; if (_AlgoResultParam.BlobMaxX != null) { _SendResult.MeasureData = (_AlgoResultParam.BlobMaxX[0] - _AlgoResultParam.BlobMinX[0]) * ResolutionX; } else { _SendResult.MeasureData = 0; } _SendResParam.SendResultList[iLoopCount] = _SendResult; } else if (eAlgoType.C_ID == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBarCodeIDResult; SendCardIDResult _SendResult = new SendCardIDResult(); _SendResParam.AlgoTypeList[iLoopCount] = eAlgoType.C_ID; for (int jLoopCount = 0; jLoopCount < _AlgoResultParam.IDResult.Length; jLoopCount++) { _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResult.ReadCode = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.IDResult[jLoopCount] : ""; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.ID; } } _SendResParam.SendResultList[iLoopCount] = _SendResult; } else if (eAlgoType.C_LINE_FIND == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogLineFindResult; _SendResParam.AlgoTypeList[iLoopCount] = eAlgoType.C_LINE_FIND; _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.EMPTY; } } else if (eAlgoType.C_PATTERN == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogPatternResult; SendNoneResult _SendResult = new SendNoneResult(); _SendResParam.AlgoTypeList[iLoopCount] = eAlgoType.C_PATTERN; _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.REF_NG; } _SendResult.MatchingScore = _AlgoResultParam.Score[0]; _SendResParam.SendResultList[iLoopCount] = _SendResult; } } return(_SendResParam); }
public void SetLeadResultData(SendResultParameter _ResultParam) { var _Result = _ResultParam.SendResult as SendLeadResult; if (_Result != null) { for (int iLoopCount = 0; iLoopCount < _Result.LeadCount; ++iLoopCount) { double _Angle = _Result.LeadAngle[iLoopCount] * 180 / Math.PI; if (_Angle > 0) { _Angle = 90 - (_Result.LeadAngle[iLoopCount] * 180 / Math.PI); } else { _Angle = -(90 + (_Result.LeadAngle[iLoopCount] * 180 / Math.PI)); } QuickGridViewLeadResult[1, iLoopCount].Value = _Angle.ToString("F3"); QuickGridViewLeadResult[2, iLoopCount].Value = _Result.LeadWidthReal[iLoopCount].ToString("F3"); QuickGridViewLeadResult[3, iLoopCount].Value = _Result.LeadLengthReal[iLoopCount].ToString("F3"); if (_Result.IsLeadBendGood[iLoopCount] && iLoopCount % 2 == 0) { QuickGridViewLeadResult[1, iLoopCount].Style.BackColor = Color.PowderBlue; } else if (_Result.IsLeadBendGood[iLoopCount] && iLoopCount % 2 == 1) { QuickGridViewLeadResult[1, iLoopCount].Style.BackColor = Color.White; } else { QuickGridViewLeadResult[1, iLoopCount].Style.BackColor = Color.Red; } } if (_ResultParam.IsGood) { if (CParameterManager.SystemMode == eSysMode.AUTO_MODE) { TotalCount++; GoodCount++; Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegGood, GoodCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } LastResult = "GOOD"; ControlInvoke.GradientLabelText(gradientLabelResult, "GOOD", Color.Lime); } else { if (CParameterManager.SystemMode == eSysMode.AUTO_MODE) { TotalCount++; NgCount++; Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegNg, NgCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } if (eNgType.LEAD_BENT == _ResultParam.NgType) { LastResult = "LEAD BENT"; ControlInvoke.GradientLabelText(gradientLabelResult, "LEAD BENT", Color.Red); } else if (eNgType.LEAD_CNT == _ResultParam.NgType) { LastResult = "LEAD COUNT"; ControlInvoke.GradientLabelText(gradientLabelResult, "LEAD COUNT", Color.Red); } } } SaveResultCount(); InspectionHistory(_ResultParam.ID, LastResult); QuickGridViewLeadResult.ClearSelection(); }
public void SetNeedleResultData(SendResultParameter _ResultParam) { if (_ResultParam.ID == 0) //Needle Align Vision1 { var _Result = _ResultParam.SendResult as SendNeedleAlignResult; if (_Result != null) { ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX1, _Result.AlignX.ToString("F3")); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY1, _Result.AlignY.ToString("F3")); } else { ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX1, "-"); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY1, "-"); } if (_ResultParam.IsGood) { LastResult = "GOOD"; ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX1, Color.Black, Color.White); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY1, Color.Black, Color.White); ControlInvoke.GradientLabelText(gradientLabelResult, "GOOD", Color.Lime); } else { if (eNgType.NDL_FIND == _ResultParam.NgType) { LastResult = "Not Found"; } else if (eNgType.NDL_CENTER == _ResultParam.NgType) { LastResult = "Not Found"; } ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX1, Color.White, Color.Red); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY1, Color.White, Color.Red); ControlInvoke.GradientLabelText(gradientLabelResult, "Not Found", Color.Red); } } else if (_ResultParam.ID == 1) //Needle Align Vision2 { var _Result = _ResultParam.SendResult as SendNeedleAlignResult; if (_Result != null) { ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX2, _Result.AlignX.ToString("F3")); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY2, _Result.AlignY.ToString("F3")); } else { ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX2, "-"); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY2, "-"); } if (_ResultParam.IsGood) { LastResult = "GOOD"; ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX2, Color.Black, Color.White); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY2, Color.Black, Color.White); ControlInvoke.GradientLabelText(gradientLabelResult, "GOOD", Color.Lime); } else { if (eNgType.NDL_FIND == _ResultParam.NgType) { LastResult = "Not Found"; } else if (eNgType.NDL_CENTER == _ResultParam.NgType) { LastResult = "Not Found"; } ControlInvoke.GradientLabelText(gradientLabelNeedleAlignX2, Color.White, Color.Red); ControlInvoke.GradientLabelText(gradientLabelNeedleAlignY2, Color.White, Color.Red); ControlInvoke.GradientLabelText(gradientLabelResult, "Not Found", Color.Red); } } else { //LOG CLogManager.AddInspectionLog(CLogManager.LOG_TYPE.INFO, "ucMainResultLead - SetNeedleData ID Match Error", CLogManager.LOG_LEVEL.LOW); } InspectionHistory(_ResultParam.ID, LastResult); }
private SendResultParameter GetIDReadResultAnalysis() { SendResultParameter _SendResParam = new SendResultParameter(); _SendResParam.ID = ID; _SendResParam.NgType = eNgType.GOOD; _SendResParam.IsGood = true; _SendResParam.ProjectItem = ProjectItem; IsDummyData = false; for (int iLoopCount = 0; iLoopCount < AlgoResultParamList.Count; ++iLoopCount) { if (eAlgoType.C_ID == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBarCodeIDResult; SendIDResult _SendResult = new SendIDResult(); for (int jLoopCount = 0; jLoopCount < _AlgoResultParam.IDResult.Length; ++jLoopCount) { _SendResParam.IsGood &= _AlgoResultParam.IsGood; _SendResult.ReadCode = (_AlgoResultParam.IsGood == true) ? _AlgoResultParam.IDResult[jLoopCount] : ""; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.ID; } } _SendResParam.SendResult = _SendResult; } else if (eAlgoType.C_BLOB_REFER == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogBlobReferenceResult; SendIDResult _SendResult = new SendIDResult(); _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.BlobCount > 0) ? eNgType.GOOD : eNgType.EMPTY; } if (true == _AlgoResultParam.DummyStatus) { IsDummyData = true; } //if (_AlgoResultParam.HistogramAvg > 68) IsDummyData = true; } else if (eAlgoType.C_PATTERN == AlgoResultParamList[iLoopCount].ResultAlgoType) { var _AlgoResultParam = AlgoResultParamList[iLoopCount].ResultParam as CogPatternResult; SendIDResult _SendResult = new SendIDResult(); _SendResParam.IsGood &= _AlgoResultParam.IsGood; if (_SendResParam.NgType == eNgType.GOOD) { _SendResParam.NgType = (_AlgoResultParam.IsGood == true) ? eNgType.GOOD : eNgType.REF_NG; } } } //Mergy Result if (true == IsDummyData && false == _SendResParam.IsGood) { _SendResParam.IsGood = true; _SendResParam.NgType = eNgType.DUMMY; } return(_SendResParam); }
public void SetResultData(SendResultParameter _ResultParam) { string _DataMatrixString = "-"; var _Result = _ResultParam.SendResult as SendIDResult; if (_Result != null) { _DataMatrixString = (_ResultParam.IsGood == true) ? _Result.ReadCode : "-----"; } else { _DataMatrixString = "-"; } ControlInvoke.GradientLabelText(gradientLabelDataMatrix, _DataMatrixString); DateTime dateTime = DateTime.Now; InspectionTime = String.Format("{0:D2}{1:D2}{2:D2}{3:D3}", dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Millisecond); if (_ResultParam.IsGood) { LastResult = "GOOD"; if (eNgType.DUMMY == _ResultParam.NgType) { LastResult = "DUMMY"; } else if (_Result == null) { if (NowLotSeparateNum != "NO") { LastResult = "CODE NG"; } } else { if (NowLotSeparateNum != "NO") { NowInspectionID = _DataMatrixString; LastResult = SetOutData(); } } if (LastResult == "OK") { ControlInvoke.GradientLabelText(gradientLabelResult, LastResult, Color.Lime); } else if (LastResult == "DUMMY") { ControlInvoke.GradientLabelText(gradientLabelResult, LastResult, Color.Lime); } else if (LastResult == "GOOD") { ControlInvoke.GradientLabelText(gradientLabelResult, LastResult, Color.Lime); } else { ControlInvoke.GradientLabelText(gradientLabelResult, LastResult, Color.Red); } if (LastResult != "GOOD" && LastResult != "OK" && LastResult != "DUMMY") { _ResultParam.IsGood = false; _ResultParam.NgType = eNgType.ID; } if (AutoModeFlag) { if (LastResult == "DUMMY") { InputDummyCount++; SegmentValueInvoke(SevenSegInputDummy, InputDummyCount.ToString()); } else { TotalCount++; if (_ResultParam.IsGood) { GoodCount++; } else { NgCount++; } Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegGood, GoodCount.ToString()); SegmentValueInvoke(SevenSegNg, NgCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } } } else { if (AutoModeFlag) { TotalCount++; NgCount++; Yield = (double)GoodCount / (double)TotalCount * 100; SegmentValueInvoke(SevenSegTotal, TotalCount.ToString()); SegmentValueInvoke(SevenSegNg, NgCount.ToString()); SegmentValueInvoke(SevenSegYield, Yield.ToString("F2")); } //gradientLabelDataMatrix if (eNgType.ID == _ResultParam.NgType) { if (AutoModeFlag) { CodeErrCount++; SegmentValueInvoke(SevenSegCodeErr, CodeErrCount.ToString()); } LastResult = "CODE NG"; } else if (eNgType.EMPTY == _ResultParam.NgType) { if (AutoModeFlag) { BlankErrCount++; SegmentValueInvoke(SevenSegBlankErr, BlankErrCount.ToString()); } LastResult = "EMPTY"; } else if (eNgType.REF_NG == _ResultParam.NgType) { if (AutoModeFlag) { MixErrCount++; SegmentValueInvoke(SevenSegMixErr, MixErrCount.ToString()); } LastResult = "MIX NG"; } else { LastResult = "CODE NG"; } ControlInvoke.GradientLabelText(gradientLabelResult, LastResult, Color.Red); } this.Refresh(); SaveResultCount(); InspectionHistory(_DataMatrixString); }
public void SetFormResultData(SendResultParameter _ResultParam) { }
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); }
public void SetSurfaceResultData(SendResultParameter _ResultParam) { }
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); }
public virtual bool SendResultData(SendResultParameter _ResultParam) { return(true); }