Exemplo n.º 1
0
 private void ButtonCalculate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         TextBoxOutPut.Clear();
         Result = "";
         I      = 0;
         var pi1    = double.Parse(Pi1TextBox.Text, CultureInfo.InvariantCulture);
         var pi2    = double.Parse(Pi2TextBox.Text, CultureInfo.InvariantCulture);
         var system = new QueuingSystemClass
         {
             Pi1 = pi1,
             Pi2 = pi2
         };
         Task.Run(() =>
         {
             for (var i = 0; i < BambardCount; i++)
             {
                 lock (this)
                 {
                     Result = Result + system.ProcessTick();
                     I      = i;
                 }
                 timer.Start();
             }
             system.CalcStats(out var A, out var P, out var L, BambardCount);
             Dispatcher.Invoke(() =>
             {
                 LabelAbsoluteProbability.Content     = A.ToString(CultureInfo.InvariantCulture);
                 LabelProbabilityOfRegectiong.Content = P.ToString(CultureInfo.InvariantCulture);
                 LabelQueryLength.Content             = L.ToString(CultureInfo.InvariantCulture);
             });
         });
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
Exemplo n.º 2
0
 private void UpdateTextBox(int i, string rez)
 {
     TextBoxOutPut.AppendText(rez);
     OperationProgressBar.Value = i;
 }