コード例 #1
0
 private void tsmi_Done_Click(object sender, EventArgs e)
 {
     hWindow_Final1.ContextMenuStrip = null;                          //禁用右键菜单
     cmb_slg_SelectItem.Items.Clear();                                //清空cmbobox
     cmb_slg_SelectItem.Items.AddRange(getSetOfLines.GetLinesName()); //添加combobox项
     prepared = true;
     RunOnce();                                                       //运行测试
 }
コード例 #2
0
        private void Ufrm_LineList_Load(object sender, EventArgs e)
        {
            hWindow_Final1.HobjectToHimage(ho_Image);
            if (measureManager == null)
            {
                measureManager = form.measureManager;
            }

            #region 跟踪
            List <MeasuringUnit> translations = measureManager.ListAllTranslation();//所有平移跟踪

            verticalPositions   = new List <MeasuringUnit>();
            horizontalPositions = new List <MeasuringUnit>();
            for (int i = translations.Count - 1; i >= 0; i--)
            {
                if ((translations[i] as TranslationTracking).line.AxByC0.k == null)
                {
                    horizontalPositions.Add(translations[i]);
                    cmb_HorizontalTracking.Items.Add(translations[i].name);
                }

                else if ((translations[i] as TranslationTracking).line.AxByC0.k.D == 0) //?是水平线
                {
                    verticalPositions.Add(translations[i]);                             //添加垂直定位
                    cmb_VerticalTracking_L.Items.Add(translations[i].name);             //添加垂直跟踪
                }
            }
            #endregion

            if (EditMode)
            {
                getSetOfLines = data as GetSetOfLines;

                if (getSetOfLines.position_Horizontal != null)
                {
                    cmb_HorizontalTracking.SelectedItem = getSetOfLines.position_Horizontal.name;
                }

                if (getSetOfLines.position_Vertical_L != null)
                {
                    cmb_VerticalTracking_L.SelectedItem = getSetOfLines.position_Vertical_L.name;
                }

                //nud_MaxGray.Value = trb_MaxGray.Value = (getSetOfLines.LineList[0] as GetLineUseThreshold).parameter.hv_MaxGray;
                // nud_MinGray.Value = trb_MinGray.Value = (getSetOfLines.LineList[0] as GetLineUseThreshold).parameter.hv_MinGray;
                if (2 == (getSetOfLines.LineList[0] as GetLineUseThreshold).TPLR)
                {
                    rdo_DownEdge.Checked = true;
                }
                if (3 == (getSetOfLines.LineList[0] as GetLineUseThreshold).TPLR)
                {
                    rdo_LeftEdge.Checked = true;
                }
                if (4 == (getSetOfLines.LineList[0] as GetLineUseThreshold).TPLR)
                {
                    rdo_RightEdge.Checked = true;
                }
                if (5 == (getSetOfLines.LineList[0] as GetLineUseThreshold).TPLR)
                {
                    radioButton1.Checked = true;
                }
                cmb_slg_SelectItem.Items.AddRange(getSetOfLines.GetLinesName());//添加combobox项

                txt_Name.Text = getSetOfLines.name;
                //txt_Name.Enabled = false;//编辑模式下不能编辑名字
                prepared = true;
                RunOnce();
            }
            else
            {
                getSetOfLines = new GetSetOfLines();
                data          = getSetOfLines;
            }
        }