Example #1
0
        private void SetYLValue(int ValueParam)
        {
            string YLText = "";

            if (ProDefine.GetBit(ValueParam, 0))
            {
                YLText += "温度+";
            }
            if (ProDefine.GetBit(ValueParam, 1))
            {
                YLText += "湿度+";
            }
            if (ProDefine.GetBit(ValueParam, 2))
            {
                YLText += "震动+";
            }
            if (ProDefine.GetBit(ValueParam, 2))
            {
                YLText += "电应力+";
            }
            if (YLText != "")
            {
                YLText = YLText.Substring(0, YLText.Length - 1);
            }

            this.cmbYLType.Text = YLText;
        }
Example #2
0
        private void InitUI()
        {
            this.lbYLType.Text      = "\uf1cd 应力类型选择";
            this.lbYLType.Font      = new Font("FontAwesome", 12);
            this.lbYLType.ForeColor = Color.LightCyan;

            this.lbOK.Text      = "\uf00c 确定";
            this.lbOK.Font      = new Font("FontAwesome", 12);
            this.lbOK.ForeColor = Color.LightCyan;

            this.ckWD.Checked  = ProDefine.GetBit(returnValue, 0);
            this.ckSD.Checked  = ProDefine.GetBit(returnValue, 1);
            this.ckZD.Checked  = ProDefine.GetBit(returnValue, 2);
            this.ckDYL.Checked = ProDefine.GetBit(returnValue, 3);
        }
Example #3
0
        private int GetYLValue(string YLText)
        {
            int returnValue = 0;

            if (YLText.Contains("温度"))
            {
                returnValue = ProDefine.SetBit(returnValue, 0);
            }
            if (YLText.Contains("湿度"))
            {
                returnValue = ProDefine.SetBit(returnValue, 1);
            }

            if (YLText.Contains("震动"))
            {
                returnValue = ProDefine.SetBit(returnValue, 2);
            }
            if (YLText.Contains("电应力"))
            {
                returnValue = ProDefine.SetBit(returnValue, 3);
            }
            return(returnValue);
        }
Example #4
0
 private void lbOK_Click(object sender, EventArgs e)
 {
     if (ckWD.Checked)
     {
         returnValue = ProDefine.SetBit(returnValue, 0);
     }
     else
     {
         returnValue = ProDefine.ClearBit(returnValue, 0);
     }
     if (ckSD.Checked)
     {
         returnValue = ProDefine.SetBit(returnValue, 1);
     }
     else
     {
         returnValue = ProDefine.ClearBit(returnValue, 1);
     }
     if (ckZD.Checked)
     {
         returnValue = ProDefine.SetBit(returnValue, 2);
     }
     else
     {
         returnValue = ProDefine.ClearBit(returnValue, 2);
     }
     if (ckDYL.Checked)
     {
         returnValue = ProDefine.SetBit(returnValue, 3);
     }
     else
     {
         returnValue = ProDefine.ClearBit(returnValue, 3);
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Example #5
0
        private void SetYLValue(int ValueParam)
        {
            string YLText = "";

            if (ProDefine.GetBit(ValueParam, 0))
            {
                YLText += "温度+";
            }
            if (ProDefine.GetBit(ValueParam, 1))
            {
                YLText += "湿度+";
            }
            if (ProDefine.GetBit(ValueParam, 2))
            {
                YLText += "震动+";
            }
            if (ProDefine.GetBit(ValueParam, 3))
            {
                YLText += "电应力+";
            }
            if (YLText != "")
            {
                YLText = YLText.Substring(0, YLText.Length - 1);
            }
            this.cmbYLType.Text = YLText;

            bool ISZD  = false;
            bool ISDYL = false;

            string[] YLType = YLText.Split('+');
            foreach (var info in YLType)
            {
                if (info == "震动")
                {
                    ISZD = true;
                }
                if (info == "电应力")
                {
                    ISDYL = true;
                }
            }

            if (ISZD)
            {
                this.cmbZD.Visible   = true;
                this.txtZD.Visible   = true;
                this.cmbJZZD.Visible = true;
                this.txtJXZD.Visible = true;
            }
            else
            {
                this.cmbZD.Visible   = false;
                this.txtZD.Visible   = false;
                this.cmbJZZD.Visible = false;
                this.txtJXZD.Visible = false;
            }

            if (ISDYL)
            {
                this.cmbDYL.Visible   = true;
                this.txtDYL.Visible   = true;
                this.cmbJXDYL.Visible = true;
                this.txtJXDYL.Visible = true;
            }
            else
            {
                this.cmbDYL.Visible   = false;
                this.txtDYL.Visible   = false;
                this.cmbJXDYL.Visible = false;
                this.txtJXDYL.Visible = false;
            }
        }