예제 #1
0
 private void ReceiveInfo_NewMessage(object sender, string e)
 {
     WriteEvent(e);
     if (ReceiveInfo.Finished() & !ListenOnly)
     {
         // send reply
         PGN25020 Reply = new PGN25020(this);
         Reply.ControlBoxNumber = ReceiveInfo.ControlBoxNumber();
         clsControlBox Box = new clsControlBox(this);
         Box.Load(0, Reply.ControlBoxNumber);
         Reply.UseSleep        = Box.UseSleep;
         Reply.SleepInterval   = SleepInterval;
         Reply.ControlBoxCount = Dbase.ControlBoxCount();
         Reply.Send();
     }
 }
예제 #2
0
 private void btWrite_Click(object sender, EventArgs e)
 {
     try
     {
         PGN25020 UpdateBox = new PGN25020(mf);
         UpdateBox.ControlBoxNumber = Convert.ToByte(tbNumber.Text);
         UpdateBox.UseSleep         = ckSleep.Checked;
         UpdateBox.SleepInterval    = mf.SleepInterval;
         UpdateBox.ControlBoxCount  = mf.Dbase.ControlBoxCount();
         UpdateBox.SendDiagnostics  = ckDiagnostics.Checked;
         UpdateBox.Send();
         mf.Tls.TimedMessageBox("Writing data to controlbox.");
     }
     catch (Exception ex)
     {
         mf.Tls.WriteErrorLog("frmControlBoxes:btWrite_Click: " + ex.Message);
     }
 }