Example #1
0
 /// <summary>
 /// Конструктор с полученным параметром начального выбора
 /// </summary>
 /// <param name="PacComponets"></param>
 public MainForm(OutFirstForm PacComponets, Present.ConsoleDebugging ConsoleDebugging)
 {
     this.DoubleBuffered = true;
     InitializeComponent();
     MainBloc          = new WebCenter(PacComponets.FileNameBrain, PacComponets.NumberBotInt, PacComponets.DinamicChoiseBool, PacComponets.LearningFactor);
     DinamicChoiseBool = PacComponets.DinamicChoiseBool;
     FirstBmp          = new Bitmap(Field_One.Width, Field_One.Height);
     SecondBmp         = new Bitmap(Field_Two.Width, Field_Two.Height);
     TherdBmp          = new Bitmap(Field_Therd.Width, Field_Therd.Height);
     LineOne           = Graphics.FromImage(FirstBmp);
     LineTwo           = Graphics.FromImage(SecondBmp);
     LinesTherd        = Graphics.FromImage(TherdBmp);
     BluePen           = new Pen(Color.Blue);
     NetLinesBig();
     NetLinesSmallTwo();
     NetLinesSmallThred();
     GreenBrush = Brushes.Green;
     OldLace    = Brushes.OldLace;
     DrawFieldOne();
     CountFor.Text = "100";
     CountFor.Refresh();
     CountIter.ReadOnly         = true;
     SimplisticStyle            = false;
     HelpMessage.Visible        = false;
     StatistChoiseBool          = false;
     ConsoleBox.CheckedChanged += ConsoleBox_AppearanceChanged;
     Debugging = ConsoleDebugging;
 }
Example #2
0
 /// <summary>
 /// Нажатие на старт
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Startbutton_Click_1(object sender, EventArgs e)
 {
     try {
         if (DinamicChoiseBool)
         {
             MainBloc.MAIN_FIELD.DinamicFieldTemp();
             MainBloc.MAIN_FIELD.DinamicOrganic();
         }
         int Limit = 500;
         if (SimplisticStyle == true)
         {
             Limit = 130000;
         }
         if ((int.Parse(CountFor.Text.ToString()) < 1 || int.Parse(CountFor.Text.ToString()) > Limit))
         {
             MessageBox.Show("Счетчик должен быть в пределах [0," + Limit.ToString() + "]", "Ошибка");
             CountFor.Text = "100";
             CountFor.Refresh();
             return;
         }
         int Count = int.Parse(CountFor.Text.ToString());
         ProgressBar.Maximum = Count;
         ProgressBar.Value   = 0;
         for (; 0 < Count; Count--)
         {
             work();
             ProgressBar.Value++;
         }
         Startbutton.Text = "Продолжить";
     }
     catch (Exception error) {
         MessageBox.Show(error.Message, "Ошибка");
         return;
     }
 }