private void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; _timeColor = lblTime.ForeColor; lblTime.ForeColor = Color.Red; _stopwatch = new Stopwatch(); _stopwatch.Start(); _timer = new Timer { Interval = 500 }; _timer.Tick += (s, e1) => lblTime.Text = _stopwatch.Elapsed.ToString(@"mm\:ss"); // Not L10N _timer.Start(); if (File.Exists(SkydFile)) { File.Delete(SkydFile); } _log = Log.Replace("#", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")); _dataDir = Path.Combine(RootDir, comboModel.Text); _uiIndex = comboUI.SelectedIndex; _queue = new QueueWorker <string>(Run) { CompleteAction = RunFinished }; _queue.RunAsync((int)numericMaxProcesses.Value, "Start Skyline"); _queue.Add(Directory.EnumerateFiles(_dataDir, comboModel.Text == "wiff" ? "*.wiff" : "*.mz5")); }
private void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; _timeColor = lblTime.ForeColor; lblTime.ForeColor = Color.Red; DeleteFiles(RootDir, "*.skyd"); DeleteFiles(RootDir, "*.tmp"); _log = Log.Replace("#", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")); _stopwatch = new Stopwatch(); _stopwatch.Start(); _timer = new Timer { Interval = 500 }; _timer.Tick += (s, e1) => lblTime.Text = _stopwatch.Elapsed.ToString(@"mm\:ss"); // Not L10N _timer.Start(); _dataDir = Path.Combine(RootDir, comboModel.Text); var extension = comboModel.Text.StartsWith("mz5") ? ".mz5" : comboModel.Text.StartsWith("mzml") ? ".mzML" : ".wiff"; var dataFiles = Directory.EnumerateFiles(_dataDir).Where(s => Path.GetExtension(s) == extension).ToList(); _uiIndex = comboUI.SelectedIndex; if (_uiIndex == 4) { var args = string.Format( @"--timestamp --dir=""{0}"" --in=""{1}"" --import-no-join --importthreads={2}", RootDir, SkylineFile, (int)numericMaxProcesses.Value); args = dataFiles.Aggregate(args, (current, dataFile) => current + string.Format(@" --import-file=""{0}""", dataFile)); //args += string.Format(@" --import-file=""{0}""", dataFiles[0]); _queue = new QueueWorker <string>(RunCommandLine) { CompleteAction = RunFinished }; _queue.RunAsync(1, "Run command line"); _queue.Add(args); _queue.DoneAdding(); } else { _queue = new QueueWorker <string>(Run) { CompleteAction = RunFinished }; _queue.RunAsync((int)numericMaxProcesses.Value, "Start Skyline"); _queue.Add(dataFiles); } }