コード例 #1
0
        /// <summary>
        /// 设置信息
        /// </summary>
        /// <param name="model"></param>
        public void SetMessage(ParaModel model)
        {
            RangeValueInput_NDD input = null;
            RangeValue          value = null;

            S_RotateSpeed_TB.Text = model.S_RotateSpeed.ToString();

            if (model.S_InjectionTime > 0)
            {
                //模拟点击,选取了喷油次数规则
                ARuleContainer_MouseLeftButtonUp(Add_S_InjectionTime_Button, null);
                ((TextBox)S_InjectionTimeContainer.Children[2]).Text = model.S_InjectionTime.ToString();
            }

            if (model.R_InjectionQuantity != null)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_InjectionQuantity_Button, null);


                input = ((RangeValueInput_NDD)R_InjectionQuantityContainer.Children[2]);
                value = model.R_InjectionQuantity;

                //设置参数
                if (value.IsInfinity())
                {
                    input.SetRangeValue_Infinity(value.GetMin().ToString());
                }
                else
                {
                    input.SetRangeValue(value.GetMax().ToString(), value.GetMin().ToString());
                }
            }

            if (model.R_RackTravel != null)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_RackTravel_Button, null);

                input = ((RangeValueInput_NDD)R_RackTravelContainer.Children[2]);
                value = model.R_RackTravel;

                //设置参数
                if (value.IsInfinity())
                {
                    input.SetRangeValue_Infinity(value.GetMin().ToString());
                }
                else
                {
                    input.SetRangeValue(value.GetMax().ToString(), value.GetMin().ToString());
                }
            }

            if (model.R_Asymmetry > 0)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_Asymmetry_Button, null);
                ((TextBox)R_AsymmetryContainer.Children[2]).Text = model.R_Asymmetry.ToString();
            }
        }
        /// <summary>
        /// 设置输入的信息
        /// </summary>
        /// <param name="euqCode"></param>
        /// <param name="equType"></param>
        /// <param name="tem"></param>
        /// <param name="isModify">是否是修改模式,如果是,则器件编号和型号不能改变</param>
        public void SetMessage(String euqCode, String equType, RangeValue tem, bool isModify = false)
        {
            EquCode_TB.Text = euqCode;
            EquType_TB.Text = equType;

            if (tem.IsInfinity())
            {
                Tem_RV.SetRangeValue_Infinity(tem.GetMin().ToString());
            }
            else
            {
                Tem_RV.SetRangeValue(tem.GetMax().ToString(), tem.GetMin().ToString());
            }

            if (isModify)
            {
                EquCode_TB.IsEnabled = false;
                EquType_TB.IsEnabled = false;
            }
        }