Ejemplo n.º 1
0
        private void btnGateRemainingAreaCheck_Click(object sender, EventArgs e)
        {
            CogRectangle _InspRegion = new CogRectangle();

            _InspRegion.SetCenterWidthHeight(GateRemainingArea.CenterX, GateRemainingArea.CenterY, GateRemainingArea.Width, GateRemainingArea.Height);

            CogLeadTrimResult _CogLeadTrimResult = new CogLeadTrimResult();
            CogLeadTrimAlgo   _LeadGateAlgoDest  = new CogLeadTrimAlgo(ResolutionX, ResolutionY);

            _LeadGateAlgoDest.GateRemainingThreshold  = Convert.ToInt32(gradientLabelGateRemainingThresholdValue.Text);
            _LeadGateAlgoDest.GateRemainingSpec       = Convert.ToDouble(numUpDownGateRemainingSpec.Value);
            _LeadGateAlgoDest.GateRemainingForeground = CogLeadTrimAlgoRcp.GateRemainingForeground;

            var _ApplyLeadTrimValueEvent = ApplyLeadTrimValueEvent;

            _ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.GATE_REMAIN, _InspRegion, _LeadGateAlgoDest, ref _CogLeadTrimResult);
        }
Ejemplo n.º 2
0
        private void btnLeadTipAreaCheck_Click(object sender, EventArgs e)
        {
            CogRectangle _InspRegion = new CogRectangle();

            _InspRegion.SetCenterWidthHeight(LeadTipInspArea.CenterX, LeadTipInspArea.CenterY, LeadTipInspArea.Width, LeadTipInspArea.Height);

            CogLeadTrimResult _CogLeadTrimResult = new CogLeadTrimResult();
            CogLeadTrimAlgo   _LeadTipAlgoDest   = new CogLeadTrimAlgo(ResolutionX, ResolutionY);

            _LeadTipAlgoDest.LeadCount         = CogLeadTrimAlgoRcp.LeadCount;
            _LeadTipAlgoDest.LeadTipEdgeWidth  = Convert.ToInt32(numUpDownLeadTipEdgeWidth.Text);
            _LeadTipAlgoDest.LeadTipForeground = CogLeadTrimAlgoRcp.LeadTipForeground;
            //_LeadTipAlgoDest.LeadTipThreshold = CogLeadTrimAlgoRcp.LeadTipThreshold;
            _LeadTipAlgoDest.LeadTipThreshold     = Convert.ToInt32(graLabelLeadTipBurrThresholdValue.Text);
            _LeadTipAlgoDest.LeadTipBurrThreshold = Convert.ToInt32(graLabelLeadTipBurrThresholdValue.Text);
            _LeadTipAlgoDest.LeadTipBurrSpec      = Convert.ToDouble(numUpDownLeadTipBurrSpec.Value);

            var _ApplyLeadTrimValueEvent = ApplyLeadTrimValueEvent;

            _ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.LEADTIP_CHECK, _InspRegion, _LeadTipAlgoDest, ref _CogLeadTrimResult);
        }
Ejemplo n.º 3
0
        private void btnBodyAreaCheck_Click(object sender, EventArgs e)
        {
            CogRectangle _InspRegion = new CogRectangle();

            _InspRegion.SetCenterWidthHeight(BodyArea.CenterX, BodyArea.CenterY, BodyArea.Width, BodyArea.Height);

            CogLeadTrimResult _CogLeadTrimResult = new CogLeadTrimResult();
            CogLeadTrimAlgo   _LeadTrimAlgoDest  = new CogLeadTrimAlgo(ResolutionX, ResolutionY);

            _LeadTrimAlgoDest.BodyCenterOrigin.X = CogLeadTrimAlgoRcp.BodyCenterOrigin.X;
            _LeadTrimAlgoDest.BodyCenterOrigin.Y = CogLeadTrimAlgoRcp.BodyCenterOrigin.Y;

            _LeadTrimAlgoDest.BodyMaskingAreaList = new List <RectangleD>();
            //for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.BodyMaskingAreaList.Count; ++iLoopCount)
            //{
            //    RectangleD _Area = new RectangleD();
            //    _Area.SetCenterWidthHeight(CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterX, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterY, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Width, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Height);
            //    _LeadTrimAlgoDest.BodyMaskingAreaList.Add(_Area);
            //}
            for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.BodyMaskingAreaList.Count; ++iLoopCount)
            {
                RectangleD _Area = new RectangleD();
                _Area.SetCenterWidthHeight(BodyMaskingAreaList[iLoopCount].CenterX, BodyMaskingAreaList[iLoopCount].CenterY, BodyMaskingAreaList[iLoopCount].Width, BodyMaskingAreaList[iLoopCount].Height);
                _LeadTrimAlgoDest.BodyMaskingAreaList.Add(_Area);
            }

            var _ApplyLeadTrimValueEvent = ApplyLeadTrimValueEvent;

            _ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.BODY_CHECK, _InspRegion, _LeadTrimAlgoDest, ref _CogLeadTrimResult);
            //_ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.BODY_CHECK, _InspRegion, CogLeadTrimAlgoRcp, ref _CogLeadTrimResult);

            BodyCenterOriginX = _CogLeadTrimResult.LeadBodyOriginX;
            BodyCenterOriginY = _CogLeadTrimResult.LeadBodyOriginY;
            BodyCenterOffsetX = _CogLeadTrimResult.LeadBodyOffsetX;
            BodyCenterOffsetY = _CogLeadTrimResult.LeadBodyOffsetY;

            IsLeadBodyCheck = true;
        }
Ejemplo n.º 4
0
        private void btnShoulderAreaCheck_Click(object sender, EventArgs e)
        {
            CogRectangle _InspRegion = new CogRectangle();

            _InspRegion.SetCenterWidthHeight(ShoulderInspArea.CenterX, ShoulderInspArea.CenterY, ShoulderInspArea.Width, ShoulderInspArea.Height);

            CogLeadTrimResult _CogLeadTrimResult = new CogLeadTrimResult();
            CogLeadTrimAlgo   _ShoulderAlgoDest  = new CogLeadTrimAlgo(ResolutionX, ResolutionY);

            _ShoulderAlgoDest.LeadCount          = CogLeadTrimAlgoRcp.LeadCount;
            _ShoulderAlgoDest.ShoulderForeground = CogLeadTrimAlgoRcp.ShoulderForeground;
            //_ShoulderAlgoDest.ShoulderThreshold = CogLeadTrimAlgoRcp.ShoulderThreshold;
            _ShoulderAlgoDest.ShoulderThreshold     = Convert.ToInt32(graLabelBurrThresholdValue.Text);
            _ShoulderAlgoDest.LeadEdgeWidth         = Convert.ToInt32(numUpDownShoulderEdgeWidth.Value);
            _ShoulderAlgoDest.ShoulderBurrThreshold = Convert.ToInt32(graLabelBurrThresholdValue.Text);
            _ShoulderAlgoDest.ShoulderNickThreshold = Convert.ToInt32(graLabelNickThresholdValue.Text);
            _ShoulderAlgoDest.ShoulderBurrSpec      = Convert.ToDouble(numUpDownShoulderBurrSpec.Value);
            _ShoulderAlgoDest.ShoulderNickSpec      = Convert.ToDouble(numUpDownShoulderNickSpec.Value);

            var _ApplyLeadTrimValueEvent = ApplyLeadTrimValueEvent;

            _ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.SHOULDER_CHECK, _InspRegion, _ShoulderAlgoDest, ref _CogLeadTrimResult);
        }
Ejemplo n.º 5
0
        private void btnChipOutAreaCheck_Click(object sender, EventArgs e)
        {
            CogRectangle _InspRegion = new CogRectangle();

            _InspRegion.SetCenterWidthHeight(ChipOutArea.CenterX, ChipOutArea.CenterY, ChipOutArea.Width, ChipOutArea.Height);

            CogLeadTrimResult _CogLeadTrimResult = new CogLeadTrimResult();
            CogLeadTrimAlgo   _LeadTrimAlgoDest  = new CogLeadTrimAlgo(ResolutionX, ResolutionY);

            _LeadTrimAlgoDest.ChipOutThreshold   = Convert.ToInt32(graLabelChipOutThresholdValue.Text);
            _LeadTrimAlgoDest.ChipOutBlobAreaMin = Convert.ToDouble(textBoxChipOutBlobAreaMin.Text);
            _LeadTrimAlgoDest.ChipOutBlobAreaMax = Convert.ToDouble(textBoxChipOutBlobAreaMax.Text);
            _LeadTrimAlgoDest.ChipOutWidthMin    = Convert.ToDouble(textBoxChipOutWidthSizeMin.Text);
            _LeadTrimAlgoDest.ChipOutWidthMax    = Convert.ToDouble(textBoxChipOutWidthSizeMax.Text);
            _LeadTrimAlgoDest.ChipOutHeightMin   = Convert.ToDouble(textBoxChipOutHeightSizeMin.Text);
            _LeadTrimAlgoDest.ChipOutHeightMax   = Convert.ToDouble(textBoxChipOutHeightSizeMax.Text);
            _LeadTrimAlgoDest.ChipOutSpec        = Convert.ToDouble(numUpDownChipOutSpec.Value);

            var _ApplyLeadTrimValueEvent = ApplyLeadTrimValueEvent;

            _ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.CHIPOUT_CHECK, _InspRegion, _LeadTrimAlgoDest, ref _CogLeadTrimResult);
            //_ApplyLeadTrimValueEvent?.Invoke(CogLeadTrimAlgo.eAlgoMode.CHIPOUT_CHECK, _InspRegion, CogLeadTrimAlgoRcp, ref _CogLeadTrimResult);
        }
Ejemplo n.º 6
0
        public void SetAlgoRecipe(Object _Algorithm, double _BenchMarkOffsetX, double _BenchMarkOffsetY, double _ResolutionX, double _ResolutionY)
        {
            if (null == _Algorithm)
            {
                return;
            }

            CogLeadTrimAlgoRcp = _Algorithm as CogLeadTrimAlgo;

            ResolutionX           = _ResolutionX;
            ResolutionY           = _ResolutionY;
            BenchMarkOffsetX      = _BenchMarkOffsetX;
            BenchMarkOffsetY      = _BenchMarkOffsetY;
            chUseLeadBody.Checked = CogLeadTrimAlgoRcp.IsUseLeadBody;

            //Lead Body Search Area Copy
            BodyArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.BodyArea.CenterX, CogLeadTrimAlgoRcp.BodyArea.CenterY, CogLeadTrimAlgoRcp.BodyArea.Width, CogLeadTrimAlgoRcp.BodyArea.Height);

            //Lead Body Masking Area Copy
            BodyMaskingAreaList.Clear();
            BodyMaskingAreaListBack.Clear();
            for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.BodyMaskingAreaList.Count; ++iLoopCount)
            {
                RectangleD _MaskingArea     = new RectangleD();
                RectangleD _MaskingAreaBack = new RectangleD();
                _MaskingArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterX, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterY,
                                                  CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Width, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Height);
                _MaskingAreaBack.SetCenterWidthHeight(CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterX, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].CenterY,
                                                      CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Width, CogLeadTrimAlgoRcp.BodyMaskingAreaList[iLoopCount].Height);
                BodyMaskingAreaList.Add(_MaskingArea);
                BodyMaskingAreaListBack.Add(_MaskingAreaBack);
            }


            //Chip Out Area Copy
            ChipOutArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.ChipOutArea.CenterX, CogLeadTrimAlgoRcp.ChipOutArea.CenterY, CogLeadTrimAlgoRcp.ChipOutArea.Width, CogLeadTrimAlgoRcp.ChipOutArea.Height);
            graLabelChipOutThresholdValue.Text = CogLeadTrimAlgoRcp.ChipOutThreshold.ToString();
            hScrollBarChipOutThreshold.Value   = CogLeadTrimAlgoRcp.ChipOutThreshold;
            numUpDownChipOutSpec.Value         = Convert.ToDecimal(CogLeadTrimAlgoRcp.ChipOutSpec);
            textBoxChipOutBlobAreaMin.Text     = CogLeadTrimAlgoRcp.ChipOutBlobAreaMin.ToString();
            textBoxChipOutBlobAreaMax.Text     = CogLeadTrimAlgoRcp.ChipOutBlobAreaMax.ToString();
            textBoxChipOutWidthSizeMin.Text    = CogLeadTrimAlgoRcp.ChipOutWidthMin.ToString();
            textBoxChipOutWidthSizeMax.Text    = CogLeadTrimAlgoRcp.ChipOutWidthMax.ToString();
            textBoxChipOutHeightSizeMin.Text   = CogLeadTrimAlgoRcp.ChipOutHeightMin.ToString();
            textBoxChipOutHeightSizeMax.Text   = CogLeadTrimAlgoRcp.ChipOutHeightMax.ToString();


            //Lead Length / Bent Area Copy
            LeadMeasureArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.LeadMeasurementArea.CenterX, CogLeadTrimAlgoRcp.LeadMeasurementArea.CenterY, CogLeadTrimAlgoRcp.LeadMeasurementArea.Width, CogLeadTrimAlgoRcp.LeadMeasurementArea.Height);
            numUpDownLeadCount.Value      = Convert.ToDecimal(CogLeadTrimAlgoRcp.LeadCount);
            numUpDownLeadLengthSpec.Value = Convert.ToDecimal(CogLeadTrimAlgoRcp.LeadLengthSpec);
            numUpDownLeadSkewSpec.Value   = Convert.ToDecimal(CogLeadTrimAlgoRcp.LeadSkewSpec);
            numUpDownLeadPitchSpec.Value  = Convert.ToDecimal(CogLeadTrimAlgoRcp.LeadPitchSpec);

            InitializeQuickGridView(CogLeadTrimAlgoRcp.LeadCount);
            for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.LeadLengthArray.Length; ++iLoopCount)
            {
                QuickGridViewLeadSetting[1, iLoopCount].Value = CogLeadTrimAlgoRcp.LeadLengthArray[iLoopCount].ToString("F4");
                //QuickGridViewLeadSetting[3, iLoopCount].Value = CogLeadTrimAlgoRcp.LeadWidthArray[iLoopCount].ToString("F4");
                if (iLoopCount > 0)
                {
                    QuickGridViewLeadSetting[2, iLoopCount - 1].Value = CogLeadTrimAlgoRcp.LeadPitchArray[iLoopCount - 1].ToString("F4");
                }

                if (iLoopCount % 2 == 0)
                {
                    QuickGridViewLeadSetting[1, iLoopCount].Style.BackColor = Color.DarkCyan;
                    QuickGridViewLeadSetting[2, iLoopCount].Style.BackColor = Color.DarkCyan;
                    //QuickGridViewLeadSetting[3, iLoopCount].Style.BackColor = Color.DarkCyan;
                }
                else
                {
                    QuickGridViewLeadSetting[1, iLoopCount].Style.BackColor = Color.CadetBlue;
                    QuickGridViewLeadSetting[2, iLoopCount].Style.BackColor = Color.CadetBlue;
                    //QuickGridViewLeadSetting[3, iLoopCount].Style.BackColor = Color.CadetBlue;
                }
            }

            LeadLengthArray    = new double[CogLeadTrimAlgoRcp.LeadLengthArray.Length];
            LeadLengthArrayNew = new double[CogLeadTrimAlgoRcp.LeadLengthArray.Length];
            for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.LeadLengthArray.Length; ++iLoopCount)
            {
                LeadLengthArray[iLoopCount] = CogLeadTrimAlgoRcp.LeadLengthArray[iLoopCount];
            }

            LeadPitchArray    = new double[CogLeadTrimAlgoRcp.LeadPitchArray.Length];
            LeadPitchArrayNew = new double[CogLeadTrimAlgoRcp.LeadPitchArray.Length];
            for (int iLoopCount = 0; iLoopCount < CogLeadTrimAlgoRcp.LeadPitchArray.Length; ++iLoopCount)
            {
                LeadPitchArray[iLoopCount] = CogLeadTrimAlgoRcp.LeadPitchArray[iLoopCount];
            }


            //Shoulder Burr / Nick Inspection
            ShoulderInspArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.ShoulderInspArea.CenterX, CogLeadTrimAlgoRcp.ShoulderInspArea.CenterY, CogLeadTrimAlgoRcp.ShoulderInspArea.Width, CogLeadTrimAlgoRcp.ShoulderInspArea.Height);
            graLabelBurrThresholdValue.Text    = CogLeadTrimAlgoRcp.ShoulderBurrThreshold.ToString();
            graLabelNickThresholdValue.Text    = CogLeadTrimAlgoRcp.ShoulderNickThreshold.ToString();
            hScrollShoulderBurrThreshold.Value = CogLeadTrimAlgoRcp.ShoulderBurrThreshold;
            hScrollShoulderNickThreshold.Value = CogLeadTrimAlgoRcp.ShoulderNickThreshold;
            numUpDownShoulderEdgeWidth.Value   = Convert.ToDecimal(CogLeadTrimAlgoRcp.LeadEdgeWidth);
            numUpDownShoulderBurrSpec.Value    = Convert.ToDecimal(CogLeadTrimAlgoRcp.ShoulderBurrSpec);
            numUpDownShoulderNickSpec.Value    = Convert.ToDecimal(CogLeadTrimAlgoRcp.ShoulderNickSpec);


            //Lead Tip Burr Inspection
            LeadTipInspArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.LeadTipInspArea.CenterX, CogLeadTrimAlgoRcp.LeadTipInspArea.CenterY, CogLeadTrimAlgoRcp.LeadTipInspArea.Width, CogLeadTrimAlgoRcp.LeadTipInspArea.Height);
            graLabelLeadTipBurrThresholdValue.Text = CogLeadTrimAlgoRcp.LeadTipBurrThreshold.ToString();
            hScrollLeadTipBurrThreshold.Value      = CogLeadTrimAlgoRcp.LeadTipBurrThreshold;
            numUpDownLeadTipEdgeWidth.Value        = Convert.ToInt32(CogLeadTrimAlgoRcp.LeadTipEdgeWidth);


            //Gate Remaining Inspection
            GateRemainingArea.SetCenterWidthHeight(CogLeadTrimAlgoRcp.GateRemainingArea.CenterX, CogLeadTrimAlgoRcp.GateRemainingArea.CenterY, CogLeadTrimAlgoRcp.GateRemainingArea.Width, CogLeadTrimAlgoRcp.GateRemainingArea.Height);
            gradientLabelGateRemainingThresholdValue.Text = CogLeadTrimAlgoRcp.GateRemainingThreshold.ToString();
            hScrollGateRemainingThreshold.Value           = CogLeadTrimAlgoRcp.GateRemainingThreshold;
            numUpDownGateRemainingSpec.Value = Convert.ToDecimal(CogLeadTrimAlgoRcp.GateRemainingSpec);

            IsLeadBodyCheck = false;
        }