コード例 #1
0
        private void RunWorkflowButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (StaticTasksObservableCollection.Count == 0)
                {
                    MessageBox.Show("You must add a workflow before a run.", "Run Workflows", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
                else if (RnaSeqFastqCollection.Any() && GetPathToFastqs().CompareTo(OutputFolderTextBox.Text) != 0) // to be edited
                {
                    MessageBox.Show("FASTQ files do not exist in the user-defined analysis directory.", "Run Workflows", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }

                DynamicTasksObservableCollection = new ObservableCollection <InRunTask>();
                for (int i = 0; i < StaticTasksObservableCollection.Count; i++)
                {
                    DynamicTasksObservableCollection.Add(new InRunTask("Workflow" + (i + 1), StaticTasksObservableCollection[i].options));
                }
                workflowTreeView.DataContext = DynamicTasksObservableCollection;
                Everything = new EverythingRunnerEngine(DynamicTasksObservableCollection.Select(b => new Tuple <string, Options>(b.DisplayName, b.options)).ToList(), OutputFolderTextBox.Text);
                //WarningsTextBox.AppendText(string.Join("\n", Everything.GenerateCommandsDry().Select(x => $"Command executing: CMD.exe {x}"))); // keep for debugging
                WarningsTextBox.AppendText(string.Join("\n", Everything.GenerateCommandsDry().Select(x => $"Command executing: Powershell.exe {x}"))); // keep for debugging
                var t = new Task(Everything.Run);
                t.Start();
                t.ContinueWith(DisplayAnyErrors);
                RunWorkflowButton.IsEnabled = false;
            }
            catch (TaskCanceledException)
            {
                // Ignore error
            }
        }
コード例 #2
0
        private void RunWorkflowButton_Click(object sender, RoutedEventArgs e)
        {
            if (StaticTasksObservableCollection.Count == 0)
            {
                MessageBox.Show("You must add a workflow before a run.", "Run Workflows", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            DynamicTasksObservableCollection = new ObservableCollection <InRunTask>();
            for (int i = 0; i < StaticTasksObservableCollection.Count; i++)
            {
                DynamicTasksObservableCollection.Add(new InRunTask("Workflow" + (i + 1) + "-" + StaticTasksObservableCollection[i].options.Command.ToString(), StaticTasksObservableCollection[i].options));
            }
            workflowTreeView.DataContext = DynamicTasksObservableCollection;
            Everything = new EverythingRunnerEngine(DynamicTasksObservableCollection.Select(b => new Tuple <string, Options>(b.DisplayName, b.options)).ToList(), OutputFolderTextBox.Text);
            WarningsTextBox.AppendText(string.Join("\n", Everything.GenerateCommandsDry().Select(x => $"Command executing: CMD.exe {x}"))); // keep for debugging
            var t = new Task(Everything.Run);

            t.Start();
            t.ContinueWith(DisplayAnyErrors);
            RunWorkflowButton.IsEnabled = false;
        }