Halcon计算出来的结果hv_dis,在MFC编辑框控件中显示出来。
新建一个编辑框IDC_EDIT_distance
double dis = hv_dis.D();
CString str_dis;
str_dis.Format("%.5f",dis);
SetDlgItemText(IDC_EDIT_distance, str_dis + "mm");
在编辑框中输入一个数字和结果hv_dis作对比,并显示OK or NG在编辑框中。
新建一个编辑框IDC_EDIT_result,IDC_EDIT_judge
CString str_lineCode;
GetDlgItem(IDC_EDIT_judge)->GetWindowText(str_lineCode);
double d_judge;
d_judge = atof(str_lineCode);
*******
if(dis>d_judge)
{
SetDlgItemText(IDC_EDIT_result, "NG")
}
else
{
SetDlgItemText(IDC_EDIT_result, "OK")
}