Ejemplo n.º 1
0
 private void CycleBt_Click(object sender, EventArgs e)
 {
     if (CycleBt.Text.ToString().Equals("End"))
     {
         try
         {
             EnableBT(true);
             CycleStart.Abort();
         }
         catch (ThreadAbortException)
         {
             ShowInfo("中止测试!");
         }
         catch (Exception ex)
         {
             ShowInfo(ex.Message.ToString());
         }
         CycleBt.Text = "循环测试";
     }
     else
     {
         EnableBT(false);
         IsCycle       = true;
         CycleStart    = new Thread(new ThreadStart(CycleRun));
         Att1.Rate     = AttGap1.Text.ToString().TrimEnd("dB".ToCharArray());
         Att1.Gap      = TimeGap1.Text.ToString().TrimEnd("ms".ToCharArray());
         Att1.Port     = Port1.Text.ToString();
         Att1.Portrate = Rate1.Text.ToString();
         Att2.Rate     = AttGap2.Text.ToString().TrimEnd("dB".ToCharArray());
         Att2.Gap      = TimeGap2.Text.ToString().TrimEnd("ms".ToCharArray());
         Att2.Port     = Port2.Text.ToString();
         Att2.Portrate = Rate2.Text.ToString();
         //Att2.BT = ATT2BT;
         CycleStart.Start();
         CycleBt.Text = "End";
     }
 }
Ejemplo n.º 2
0
 // Notifiy subscribers that a new cycle has started
 protected virtual void OnCycleStart()
 {
     startCycleButton.interactable = false;
     CycleStart?.Invoke(this, EventArgs.Empty);
 }