Exemple #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            HImage img = new HImage(@"D:\12.bmp");

            hWndCrtl.AddIconicVar(img);
            hWndCrtl.AddText("测试", 20, 20);
            hWndCrtl.Repaint();
        }
        public override void ShowResult(HWndCtrl viewCtrl)
        {
            if (!bFindShapeMode)
            {
                return;
            }
            if (MFindShapeMode.row == null || MFindShapeMode.row.Length < 1)
            {
                return;
            }
            if (RuningFinish == false)
            {
                return;
            }
            MFindShapeMode.ShowResult(viewCtrl);
            if (bGrabPointSetting)
            {
                MGrabPointSetting.ShowGrabPoint(viewCtrl);
            }

            if (bFangDai_Enable && bFangDai_Result)
            {
                MFangDai.Show(viewCtrl);
            }

            if (NotifyExcInfo != null)
            {
                string temp = GetSendResult();
                NotifyExcInfo("发送结果:" + temp);
            }

            if (row_Send != null && row_Send.Length > 0)
            {
                for (int i = 0; i < row_Send.Length; i++)
                {
                    if (id_Send[i].I == 1)
                    {
                        viewCtrl.AddText("OK", (int)(row_Send[i].D), (int)(col_Send[i].D), 80, "green");
                    }
                    else
                    {
                        viewCtrl.AddText("NG", (int)(row_Send[i].D), (int)(col_Send[i].D), 80, "green");
                    }
                }
            }
        }
Exemple #3
0
        private void DisplayCalib(HImage image)
        {
            if (ho_Caltab == null)
            {
                ho_Caltab = new HObject();
                ho_Caltab.GenEmptyObj();
            }
            ho_Caltab.Dispose();
            HOperatorSet.GetCalibDataObservContours(out ho_Caltab, CalibDataID, "caltab", 0, 0, index);
            HTuple hv_Row, hv_Column, hv_Index, hv_Pose;

            HOperatorSet.GetCalibDataObservPoints(CalibDataID, 0, 0, index, out hv_Row, out hv_Column, out hv_Index, out hv_Pose);
            if (ho_Cross == null)
            {
                ho_Cross = new HObject();
                ho_Cross.GenEmptyObj();
            }
            ho_Cross.Dispose();
            HOperatorSet.GenCrossContourXld(out ho_Cross, hv_Row, hv_Column, 30, 0.785398);

            mView.ClearList();
            if (image != null && image.IsInitialized())
            {
                mView.AddIconicVar(image);
            }
            if (ho_Caltab != null && ho_Caltab.IsInitialized())
            {
                mView.ChangeGraphicSettings(Mode.COLOR, "green");
                mView.ChangeGraphicSettings(Mode.LINEWIDTH, 3);
                mView.AddIconicVar(ho_Caltab);
            }
            if (ho_Cross != null && ho_Cross.IsInitialized())
            {
                mView.ChangeGraphicSettings(Mode.COLOR, "blue");
                mView.ChangeGraphicSettings(Mode.LINEWIDTH, 2);
                mView.AddIconicVar(ho_Cross);
            }
            mView.AddText(index.ToString(), 100, 100, 80, "green");
            mView.Repaint();
        }
        public override void ShowResult(HWndCtrl viewCtrl)
        {
            if (!bFindShapeMode)
            {
                return;
            }
            if (MFindShapeMode.row == null || MFindShapeMode.row.Length < 1)
            {
                return;
            }
            if (RuningFinish == false)
            {
                return;
            }
            MFindShapeMode.ShowResult(viewCtrl);
            if (bGrabPointSetting)
            {
                MGrabPointSetting.ShowGrabPoint(viewCtrl);
            }
            if (bPZT_Detection_Result && bPZT_Detection_Enble)
            {
                MPZT_Detection.Show(viewCtrl);
            }

            if (bLM_DP_Enble && bLM_DP_Result)
            {
                MLM_DP.Show(viewCtrl);
            }

            if (bGrab_Intervene_Result && bGrab_Intervene_Enble)
            {
                MGrab_Intervene.Show(viewCtrl);
            }
            if (bFangDai_Enable && bFangDai_Result)
            {
                MFangDai.Show(viewCtrl);
            }
            if (bLanQuan_Enable && bLanQuan_Result)
            {
                MLanQuan.Show(viewCtrl);
            }

            string temp = GetSendResult();

            if (NotifyExcInfo != null)
            {
                NotifyExcInfo("发送结果:" + temp);
            }

            if (row_Send != null && row_Send.Length > 0)
            {
                for (int i = 0; i < row_Send.Length; i++)
                {
                    if (id_Send[i].I == 1)
                    {
                        viewCtrl.AddText("OK", (int)(row_Send[i].D), (int)(col_Send[i].D), 80, "green");
                    }
                }
            }

            if (row_NG == null || row_NG.Length < 1)
            {
                return;
            }
            for (int i = 0; i < row_NG.Length; i++)
            {
                viewCtrl.AddText("NG:" + NG_Reason[i].S, (int)(row_NG[i].D), (int)(col_NG[i].D), 40, "red");
            }
        }