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