private void ReferParamSetWin_Load(object sender, EventArgs e) { //記錄当前人员进入Node参数设置界面的操作 PersonOperation curpersonoper = new PersonOperation(frm.CurPerson.ID, OperType.EnterReferParam); CommonCollection.personOpers.Add(curpersonoper); string strrefermsg = ""; string strid = mrefer.ID[0].ToString("X2") + mrefer.ID[1].ToString("X2"); string strname = CommonBoxOperation.GetRouterName(strid); rstlb.Visible = false; if (null == strname || "".Equals(strname)) { strrefermsg = strid; } else { strrefermsg = strname + "(" + strid + ")"; } refermsgtxt.Text = strrefermsg; eqpttypetxt.Text = ConstInfor.GetDevType(NodeType.ReferNode, mrefer.type); vertxt.Text = ((byte)(mrefer.Version >> 24)).ToString("D2") + ((byte)(mrefer.Version >> 16)).ToString("D2") + ((byte)(mrefer.Version >> 8)).ToString("D2") + ((byte)(mrefer.Version)).ToString("X2"); /*读取参数信息 */ //读取信号阀值 referparam mrfpm = null; mrfpm = ReadReferParam(mrefer, frm.MyUdpClient, referparm.Sgthreshold); if (null == mrfpm) { sthdlb.Text = "read error"; } else { sthdlb.Text = "read ok"; sthdtxt.Text = mrfpm.Sgthreshold + ""; } //读取信号强度系数 mrfpm = ReadReferParam(mrefer, frm.MyUdpClient, referparm.Sgstrengthfac); if (null == mrfpm) { ssfaclb.Text = "read error"; } else { ssfaclb.Text = "read ok"; ssfactxt.Text = string.Format("{0:F2}", (double)mrfpm.Sgstrengthfac / 100); } }
//复位 private void resetbtn_Click(object sender, EventArgs e) { this.Invoke(new Action(() => { rstlb.Text = ""; })); //复位 referparam mrfpm = null; mrfpm = ReadReferParam(mrefer, frm.MyUdpClient, referparm.Reset); if (null == mrfpm) { this.Invoke(new Action(() => { rstlb.Text = "read error"; })); } else { this.Invoke(new Action(() => { rstlb.Text = "read ok"; })); } rstlb.Visible = true; }
//读取信号系数 private void readssfacbtn_Click(object sender, EventArgs e) { this.Invoke(new Action(() => { ssfaclb.Text = ""; })); //设置信号强度系数 referparam mrfpm = null; mrfpm = ReadReferParam(mrefer, frm.MyUdpClient, referparm.Sgstrengthfac); if (null == mrfpm) { this.Invoke(new Action(() => { ssfaclb.Text = "read error"; })); } else { this.Invoke(new Action(() => { ssfaclb.Text = "read ok"; ssfactxt.Text = string.Format("{0:F2}", (double)mrfpm.Sgstrengthfac / 100); })); } }
//读取信号阀值 private void readsthdbtn_Click(object sender, EventArgs e) { this.Invoke(new Action(() => { sthdlb.Text = ""; })); //设置信号阀值 referparam mrfpm = null; mrfpm = ReadReferParam(mrefer, frm.MyUdpClient, referparm.Sgthreshold); if (null == mrfpm) { this.Invoke(new Action(() => { sthdlb.Text = "read error"; })); } else { this.Invoke(new Action(() => { sthdlb.Text = "read ok"; sthdtxt.Text = mrfpm.Sgthreshold + ""; })); } }