Пример #1
0
        private void Ufrm_Radius_Load(object sender, EventArgs e)
        {
            hWindow_Final1.HobjectToHimage(ho_Image);
            if (measureManager == null)
            {
                measureManager = form.measureManager;
            }

            circles        = new List <Circle>();
            measuringUnits = measureManager.ListAllCircle();
            foreach (var item in measuringUnits)
            {
                circles.Add(item as Circle);
                cmb_Circles.Items.Add(item.name);
            }
            if (EditMode)
            {
                //编辑模式

                nud_Spacing.Value = data.StringHeight;

                txt_Name.Text = data.name;
                // txt_Name.Enabled = false;//编辑模式下不能编辑名字
                calculate = data as BaseCal_Single;
                cmb_Circles.SelectedIndex = Func_System.GetIndex(measuringUnits, calculate.unit1);
                if (cmb_Circles.SelectedIndex == -1)
                {
                    calculate.unit1 = new Circle(0, 0, 1);
                }
                nud_MaxValue.Value  = (decimal)calculate.maxValue;
                nud_MinValue.Value  = (decimal)calculate.minValue;
                nud_k.Value         = (decimal)calculate.kCx.D;
                nud_RealValue.Value = (decimal)(calculate.hv_RealDistance != null ? calculate.hv_RealDistance.D : 0);
                prepared            = true;
                RunOnce();
            }
            else
            {
                calculate   = new CircleRadius(measureManager.k, new Circle(0, 0, 1));
                nud_k.Value = (decimal)measureManager.k;
                data        = calculate;
                prepared    = true;
            }
        }