public void WriteRcb(RcbActivateParams rpar, bool reRead) { iecs.Send(rpar.getWriteArray(), rpar.self.CommAddress, ActionRequested.Write); if (reRead) { delayTimer = new System.Threading.Timer(obj => { ReadData(rpar.self); }, null, 1000, System.Threading.Timeout.Infinite); } }
public RcbActivateDialog(RcbActivateParams rcbpar) { RCBpar = rcbpar; InitializeComponent(); labelReportName.Text = RCBpar.self.IecAddress; labelReportType.Text = RCBpar.self.isBuffered ? "Buffered" : "Unbuffered"; if (RCBpar.self.RptID_present) { textBoxRptID.Text = RCBpar.self.RptID; checkBoxRptID_send.Checked = RCBpar.sendRptID; if (!checkBoxRptID_send.Checked) { textBoxRptID.Enabled = false; } } else { textBoxRptID.Enabled = false; checkBoxRptID_send.Enabled = false; } if (RCBpar.self.DatSet_present) { try { string myld = RCBpar.self.Parent.Name; NodeBase[] nba = RCBpar.self.GetIecs().DataModel.lists.FindChildNode(myld).GetChildNodes(); foreach (NodeBase nb in nba) { comboBoxDatSet.Items.Add(nb.IecAddress); } comboBoxDatSet.SelectedItem = RCBpar.self.DatSet; } catch { } checkBoxDatSet_send.Checked = RCBpar.sendDatSet; if (!checkBoxDatSet_send.Checked) { comboBoxDatSet.Enabled = false; } } else { comboBoxDatSet.Enabled = false; checkBoxDatSet_send.Enabled = false; } if (RCBpar.self.OptFlds_present) { checkBoxOptFlds_SeqNum.Checked = (RCBpar.self.OptFlds & ReportOptions.SEQ_NUM) > 0; checkBoxOptFlds_TimeStamp.Checked = (RCBpar.self.OptFlds & ReportOptions.TIME_STAMP) > 0; checkBoxOptFlds_ReasonForInclusion.Checked = (RCBpar.self.OptFlds & ReportOptions.REASON_FOR_INCLUSION) > 0; checkBoxOptFlds_DataSet.Checked = (RCBpar.self.OptFlds & ReportOptions.DATA_SET) > 0; checkBoxOptFlds_DataReference.Checked = (RCBpar.self.OptFlds & ReportOptions.DATA_REFERENCE) > 0; checkBoxOptFlds_BufferOverflow.Checked = (RCBpar.self.OptFlds & ReportOptions.BUFFER_OVERFLOW) > 0; checkBoxOptFlds_EntryID.Checked = (RCBpar.self.OptFlds & ReportOptions.ENTRY_ID) > 0; checkBoxOptFlds_ConfRev.Checked = (RCBpar.self.OptFlds & ReportOptions.CONF_REV) > 0; checkBoxOptFlds_send.Checked = RCBpar.sendOptFlds; if (!checkBoxOptFlds_send.Checked) { enableOptFlds(false); } } else { enableOptFlds(false); checkBoxOptFlds_send.Enabled = false; } if (RCBpar.self.BufTm_present) { textBoxBufTm.Text = RCBpar.self.BufTm.ToString(); checkBoxBufTm_send.Checked = RCBpar.sendBufTm; if (!checkBoxBufTm_send.Checked) { textBoxBufTm.Enabled = false; } } else { textBoxBufTm.Enabled = false; checkBoxBufTm_send.Enabled = false; } if (RCBpar.self.TrgOps_present) { checkBoxTrgOps_DataChange.Checked = (RCBpar.self.TrgOps & TriggerOptions.DATA_CHANGED) > 0; checkBoxTrgOps_QualityChange.Checked = (RCBpar.self.TrgOps & TriggerOptions.QUALITY_CHANGED) > 0; checkBoxTrgOps_DataUpdate.Checked = (RCBpar.self.TrgOps & TriggerOptions.DATA_UPDATE) > 0; checkBoxTrgOps_Integrity.Checked = (RCBpar.self.TrgOps & TriggerOptions.INTEGRITY) > 0; checkBoxTrgOps_GI.Checked = (RCBpar.self.TrgOps & TriggerOptions.GI) > 0; checkBoxTrgOps_send.Checked = RCBpar.sendTrgOps; if (!checkBoxTrgOps_send.Checked) { enableTrgOps(false); } } else { enableTrgOps(false); checkBoxTrgOps_send.Enabled = false; } if (RCBpar.self.IntgPd_present) { textBoxIntgPd.Text = RCBpar.self.IntgPd.ToString(); checkBoxIntgPd_send.Checked = RCBpar.sendIntgPd; if (!checkBoxIntgPd_send.Checked) { textBoxIntgPd.Enabled = false; } } else { textBoxIntgPd.Enabled = false; checkBoxIntgPd_send.Enabled = false; } if (RCBpar.self.RptEna_present) { checkBoxRptEna.Checked = RCBpar.self.RptEna; checkBoxRptEna_send.Checked = RCBpar.sendRptEna; if (!checkBoxRptEna_send.Checked) { checkBoxRptEna.Enabled = false; } } else { checkBoxRptEna.Enabled = false; checkBoxRptEna_send.Enabled = false; } if (RCBpar.self.GI_present) { checkBoxGI.Checked = RCBpar.self.GI; checkBoxGI_send.Checked = RCBpar.sendGI; if (!checkBoxGI_send.Checked) { checkBoxGI.Enabled = false; } } else { checkBoxGI.Enabled = false; checkBoxGI_send.Enabled = false; } if (RCBpar.self.Resv_present) { checkBoxResv.Checked = RCBpar.self.Resv; checkBoxResv_send.Checked = RCBpar.sendResv; if (!checkBoxResv_send.Checked) { checkBoxResv.Enabled = false; } } else { checkBoxResv.Enabled = false; checkBoxResv_send.Enabled = false; } if (RCBpar.self.PurgeBuf_present) { checkBoxPurgeBuf.Checked = RCBpar.self.PurgeBuf; checkBoxPurgeBuf_send.Checked = RCBpar.sendPurgeBuf; if (!checkBoxPurgeBuf_send.Checked) { checkBoxPurgeBuf.Enabled = false; } } else { checkBoxPurgeBuf.Enabled = false; checkBoxPurgeBuf_send.Enabled = false; } if (RCBpar.self.EntryID_present) { textBoxEntryID.Text = RCBpar.self.EntryID; checkBoxEntryID_send.Checked = RCBpar.sendEntryID; if (!checkBoxEntryID_send.Checked) { textBoxEntryID.Enabled = false; } } else { textBoxEntryID.Enabled = false; checkBoxEntryID_send.Enabled = false; } if (RCBpar.self.ResvTms_present) { textBoxResvTms.Text = RCBpar.self.ResvTms.ToString(); checkBoxResvTms_send.Checked = RCBpar.sendResvTms; if (!checkBoxResvTms_send.Checked) { textBoxResvTms.Enabled = false; } } else { textBoxResvTms.Enabled = false; checkBoxResvTms_send.Enabled = false; } }