예제 #1
0
        private void cmb_slg_SelectItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmb_slg_SelectItem.SelectedItem == null)
            {
                btn_slg_ReDrowROI.Enabled = false;

                return;
            }
            if (getCircleUseThreshold != null)
            {
                getRegionUseThreshold = getCircleUseThreshold.GetRegion(Convert.ToInt32(cmb_slg_SelectItem.SelectedItem.ToString()) - 1) as GetRegionUseThreshold;
            }
            trb_slg_MaxGray.Value     = getRegionUseThreshold.parameter.hv_MaxGray.I;
            trb_slg_MinGray.Value     = getRegionUseThreshold.parameter.hv_MinGray.I;
            nud_slg_MaxGray.Value     = getRegionUseThreshold.parameter.hv_MaxGray.I;
            nud_slg_MinGray.Value     = getRegionUseThreshold.parameter.hv_MinGray.I;
            btn_slg_ReDrowROI.Enabled = true;
        }
예제 #2
0
        private void UFrm_Exist_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)
            {
                //编辑模式
                getRegionUseThreshold = data as GetRegionUseThreshold;
                nud_MaxGray.Value     = trb_MaxGray.Value = getRegionUseThreshold.parameter.hv_MaxGray;
                nud_MinGray.Value     = trb_MinGray.Value = getRegionUseThreshold.parameter.hv_MinGray;
                rdo_Exist.Checked     = getRegionUseThreshold.Exist;
                rdo_ExistTwo.Checked  = !getRegionUseThreshold.Exist;
                nud_MaxValue.Value    = (decimal)getRegionUseThreshold.maxValue;
                nud_MinValue.Value    = (decimal)getRegionUseThreshold.minValue;


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

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


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