Esempio n. 1
0
 public static Cls.Model_Set GetModelSet(string section)
 {
     if (!string.IsNullOrEmpty(section))
     {
         Cls.Model_Set ms = new Cls.Model_Set();
         //Cls.RWconfig.GetAppSettings("SP_Speed")
         ms.SpeedSP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "SP_Speed"));
         ms.SpeedBP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "BPSpeed"));       //Cls.RWconfig.GetAppSettings("BPSpeed")
         ms.BPValid          = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "BPValid"));      //Cls.RWconfig.GetAppSettings("BPValid")
         ms.SpeedCP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "CPSpeed"));       //Cls.RWconfig.GetAppSettings("CPSpeed")
         ms.CPValid          = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "CPValid"));      //Cls.RWconfig.GetAppSettings("CPValid")
         ms.SpeedDP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "DPSpeed"));       //Cls.RWconfig.GetAppSettings("DPSpeed")
         ms.DPValid          = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "DPValid"));      //Cls.RWconfig.GetAppSettings("DPValid")
         ms.SpeedFP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "FPSpeed"));       //Cls.RWconfig.GetAppSettings("FPSpeed")
         ms.FPValid          = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "FPValid"));      //Cls.RWconfig.GetAppSettings("FPValid")
         ms.SpeedFP2         = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "FP2Speed"));      //Cls.RWconfig.GetAppSettings("FP2Speed")
         ms.FP2Valid         = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "FP2Valid"));     //Cls.RWconfig.GetAppSettings("FP2Valid")
         ms.SpeedRP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "RPSpeed"));       //Cls.RWconfig.GetAppSettings("RPSpeed")
         ms.RPValid          = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "RPValid"));      //Cls.RWconfig.GetAppSettings("RPValid")
         ms.BPDirection      = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "BPDirection"));  //Cls.RWconfig.GetAppSettings("BPDirection")
         ms.CPDirection      = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "CPDirection"));  //Cls.RWconfig.GetAppSettings("CPDirection")
         ms.DPDirection      = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "DPDirection"));  //Cls.RWconfig.GetAppSettings("DPDirection")
         ms.FP2Direction     = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "FP2Direction")); //Cls.RWconfig.GetAppSettings("FP2Direction")
         ms.FPDirection      = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "FPDirection"));  //Cls.RWconfig.GetAppSettings("FPDirection")
         ms.RPDirection      = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "RPDirection"));  //Cls.RWconfig.GetAppSettings("RPDirection")
         ms.DehydrationValid = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "dehydrationValid"));
         ms.DehydrationSpeed = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "dehydrationSpeed"));
         //目标值及是否有效
         ms.TargetBP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetBP")); //Cls.RWconfig.GetAppSettings("TargetBP")Cls.RWconfig.GetAppSettings("PEFlushOut")
         ms.TargetFlushValue  = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "PEFlushOut")) + Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "PEFlushIn")) + 100;
         ms.TargetFP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetFP")); //Cls.RWconfig.GetAppSettings("TargetFP")
         ms.TargetDP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetDP")); //Cls.RWconfig.GetAppSettings("TargetDP")
         ms.TargetRP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetRP")); //Cls.RWconfig.GetAppSettings("TargetRP")
         ms.TargetSP          = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetSP")); //Cls.RWconfig.GetAppSettings("TargetSP")
         ms.TargetTemperature = Convert.ToSingle(Cls.utils.GetSectionKeyValue(section, "TargetT"));  //Cls.RWconfig.GetAppSettings("TargetT")
         //总计治疗时间以秒为单位Cls.RWconfig.GetAppSettings("TargetTimeH")Cls.RWconfig.GetAppSettings("TargetTimeMin")
         ms.TargetTime       = Convert.ToInt32(Cls.utils.GetSectionKeyValue(section, "TargetTimeH")) * 3600 + Convert.ToInt32(Cls.utils.GetSectionKeyValue(section, "TargetTimeMin")) * 60;
         ms.TargetValid_time = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "IsTargetTime")); //Cls.RWconfig.GetAppSettings("IsTargetTime")
         ms.TargetValid_BP   = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "IsTargetBP"));   //Cls.RWconfig.GetAppSettings("IsTargetBP")
         ms.TargetValid_FP   = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "IsTargetFP"));   //Cls.RWconfig.GetAppSettings("IsTargetFP")
         ms.TargetValid_RP   = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "IsTargetRP"));   //Cls.RWconfig.GetAppSettings("IsTargetRP")
         ms.TargetValid_SP   = Convert.ToBoolean(Cls.utils.GetSectionKeyValue(section, "IsTargetSP"));   //Cls.RWconfig.GetAppSettings("IsTargetSP")
         return(ms);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 读取目标值
        /// 如果目标值有效则显示,无效则隐藏
        /// </summary>
        public void ReadSet(Cls.Model_Set ms)
        {
            this.uc_SpeedSP._SpeedValue = ms.SpeedSP.ToString();
            //-----------------------FP------------------------
            if (_modelset.FPValid)
            {
                this.uc_SpeedFP._SpeedValue     = ms.SpeedFP.ToString("f1");
                this.lblTargetFP.Text           = ms.TargetFP.ToString();
                this.uc_SpeedFP._VisiblePicpump = true;
                this.lblTargetFP.Enabled        = true;
                this.lblTotalFP.Enabled         = true;
                if (_modelset.FPDirection)
                {
                    this.uc_SpeedFP._PicPump = global::ALS.Properties.Resources.fp_s;
                }
                else
                {
                    this.uc_SpeedFP._PicPump = global::ALS.Properties.Resources.fp_n;
                }
            }
            else
            {
                this.uc_SpeedFP._SpeedValue     = "0";
                this.uc_SpeedFP._VisiblePicpump = false;
                this.uc_SpeedFP.Enabled         = false;
                this.lblTargetFP.Enabled        = false;
                this.lblTotalFP.Enabled         = false;
            }
            //-----------------------DP------------------------
            if (_modelset.DPValid)
            {
                this.uc_SpeedDP._SpeedValue     = ms.SpeedDP.ToString("f1");
                this.lblTargetDP.Text           = ms.TargetDP.ToString();
                this.uc_SpeedDP._VisiblePicpump = true;
                this.lblTargetDP.Enabled        = true;
                this.lblTotalDP.Enabled         = true;
                if (_modelset.DPDirection)
                {
                    this.uc_SpeedDP._PicPump = global::ALS.Properties.Resources.dp_s;
                }
                else
                {
                    this.uc_SpeedDP._PicPump = global::ALS.Properties.Resources.dp_n;
                }
            }
            else
            {
                this.uc_SpeedDP._SpeedValue     = "0";
                this.uc_SpeedDP._VisiblePicpump = false;
                this.uc_SpeedDP.Enabled         = false;
                this.lblTargetDP.Enabled        = false;
                this.lblTotalDP.Enabled         = false;
            }

            //-----------------------RP------------------------
            if (_modelset.RPValid)
            {
                this.uc_SpeedRP._SpeedValue     = ms.SpeedRP.ToString("f1");
                this.lblTargetRP.Text           = ms.TargetRP.ToString("f1");
                this.uc_SpeedRP._VisiblePicpump = true;
                this.lblTargetRP.Enabled        = true;
                this.lblTotalRP.Enabled         = true;
                if (_modelset.RPDirection)
                {
                    this.uc_SpeedRP._PicPump = global::ALS.Properties.Resources.rp_s;
                }
                else
                {
                    this.uc_SpeedRP._PicPump = global::ALS.Properties.Resources.rp_n;
                }
            }
            else
            {
                this.uc_SpeedRP._SpeedValue     = "0";
                this.uc_SpeedRP._VisiblePicpump = false;
                this.uc_SpeedRP.Enabled         = false;
                this.lblTargetRP.Enabled        = false;
                this.lblTotalRP.Enabled         = false;
            }
            //-----------------------FP2------------------------
            if (_modelset.FP2Valid)
            {
                this.uc_SpeedFP2._SpeedValue     = ms.SpeedFP2.ToString("f1");
                this.uc_SpeedFP2._VisiblePicpump = true;
                if (_modelset.FP2Direction)
                {
                    this.uc_SpeedFP2._PicPump = global::ALS.Properties.Resources.fp2_s;
                }
                else
                {
                    this.uc_SpeedFP2._PicPump = global::ALS.Properties.Resources.fp2_n;
                }
            }
            else
            {
                this.uc_SpeedFP2._SpeedValue     = "0";
                this.uc_SpeedFP2._VisiblePicpump = false;
                this.uc_SpeedFP2.Enabled         = false;
            }
            //-----------------------CP------------------------
            if (_modelset.CPValid)
            {
                this.uc_SpeedCP._SpeedValue     = ms.SpeedCP.ToString("f1");
                this.uc_SpeedCP._VisiblePicpump = true;
                if (_modelset.CPDirection)
                {
                    this.uc_SpeedCP._PicPump = global::ALS.Properties.Resources.cp_s;
                }
                else
                {
                    this.uc_SpeedCP._PicPump = global::ALS.Properties.Resources.cp_n;
                }
            }
            else
            {
                this.uc_SpeedCP._SpeedValue     = "0";
                this.uc_SpeedCP._VisiblePicpump = false;
                this.uc_SpeedCP.Enabled         = false;
            }

            //-----------------------dehydration------------------------
            if (_modelset.DehydrationValid)
            {
                this.paldehydration.Enabled   = true;
                this.lblDehydrationSpeed.Text = ms.DehydrationSpeed.ToString();
            }
            else
            {
                this.paldehydration.Enabled   = false;
                this.lblDehydrationSpeed.Text = "0.0";
            }

            //this.lblHT.Text = ms.TargetTemperature.ToString();
            TimeSpan ts = new TimeSpan(0, 0, ms.TargetTime);

            this.lblTargetTime.Text = ts.Hours.ToString("00") + ":" + ts.Minutes.ToString("00") + ":" + ts.Seconds.ToString("00");
            this.lblTargetBP.Text   = ms.TargetBP.ToString();
            this.lblTargetSP.Text   = ms.TargetSP.ToString();
        }