Example #1
0
        public void ReadConfsInDir(String DirPath)
        {
            if (Directory.Exists(DirPath))
            {
                ConfigList.Rows.Clear();

                String   ConfigName = "";
                String[] files      = Directory.GetFiles(DirPath, "*.xml");

                for (int i = 0; i < files.Length; i++)
                {
                    ConfigList.Rows.Add();
                    ConfigName = new DirectoryInfo(files[i]).Name;
                    ConfigList.Rows[i].Cells[0].Value = ConfigName;
                    ConfigList.Rows[i].Cells[1].Value = files[i];
                    ConfigList.Rows[i].Cells[2].Value = 0;
                    ConfigList.Rows[i].Cells[3].Value = 0;
                }
                NMaxTextBox.Focus();
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Указанная директория не найдена.", "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
        private async void ComboFinRun(int k, List <string> ActiveConfs, List <string> TempComboXML)
        {
            SeriesNumber++;
            StopButton.Enabled = true;
            Stop = false;
            ProgressBarJour.Value = 0;
            String date = DateTime.Now.ToString("(HH-mm-ss)_dd.MM.yy");

            for (int i = 0; i < ComboSize; i++)
            {
                if (!Stop)
                {
                    if (i == ComboSize - 1)
                    {
                        ProgressBarJour.Value = 100;
                    }
                    else
                    {
                        ProgressBarJour.Value += 100 / ComboSize;
                    }

                    comboT = i + 1;
                    String ShortName = new DirectoryInfo(TempComboXML[i]).Name;
                    ProcessTextBox.Text = ShortName;

                    await TaskEx.Run(() => AWFunc(date, i, ActiveConfs, TempComboXML));

                    // AWFunc(i, ActiveConfs, TempComboXML);

                    if (File.Exists(TempComboXML[i]))
                    {
                        File.Delete(TempComboXML[i]);
                    }
                }
            }
            UpdateExpJournal();
            if (NMaxTextBox.Text != String.Empty && DeltaTextBox.Text != String.Empty)
            {
                addGraphic(date);
            }

            RunComboFin.Enabled          = true;
            TextMpiComm.Enabled          = true;
            ButtonChoseTargetXML.Enabled = true;
            ButtonChoseProgram.Enabled   = true;
            Run.Enabled                  = true;
            ButOpenConfList.Enabled      = true;
            ChoseDirConfBut.Enabled      = true;
            TextBoxChosenDirXML.Enabled  = true;
            TextBoxChosenProgram.Enabled = true;
            TextBoxChosenXML.Enabled     = true;
            metroButton2.Enabled         = true;
            metroButton1.Enabled         = true;
            ResultsButton.Enabled        = true;
            SearchButton2.Enabled        = true;
            NMaxTextBox.Clear();
            GridJournal.Focus();
            DeltaTextBox.Clear();

            Results.Clear();
            TempComboXML.Clear();
            ActiveConfs.Clear();
            MpiList.Clear();

            ComboSize  = 0;
            comboT     = 0;
            MpiCommand = "";
            TempXML    = "";
        }