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; }
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); }
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; } }