Exemple #1
0
        private async void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dataGrid.SelectedItems.Count != 1 || uiService == null)
            {
                return;
            }


            var handle = uiService.StartIndicateLongOperation("Loading output for the benchmark...");

            try
            {
                ShowOutput w = new ShowOutput();
                w.Owner = this;
                w.Show();

                CompareBenchmarksViewModel elem = (CompareBenchmarksViewModel)dataGrid.SelectedItem;
                int inx = dataGrid.CurrentCell.Column.DisplayIndex;
                BenchmarkResultViewModel result = (inx == 1 || inx == 3 || inx == 5 || inx >= 8 && inx <= 10 || inx == 14) ? elem.Results1 : elem.Results2;

                string stdout = await result.GetStdOutAsync(true);

                string stderr = await result.GetStdErrAsync(true);

                ShowOutputViewModel vm = new ShowOutputViewModel(result.ID, elem.Filename, stdout, stderr);
                w.DataContext = vm;
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }
Exemple #2
0
        private static CompareBenchmarksViewModel[] InnerJoinOrderedResults(BenchmarkResult[] r1, BenchmarkResult[] r2, CheckboxParameters param, IUIService uiService)
        {
            int n1   = r1.Length;
            int n2   = r2.Length;
            var join = new CompareBenchmarksViewModel[Math.Min(n1, n2)];

            if (!param.IsCategoryChecked && param.Category1 != param.Category2)
            {
                return(new CompareBenchmarksViewModel[0]);
            }
            if (!param.IsPrefixChecked && param.Dir1 != param.Dir2)
            {
                return(new CompareBenchmarksViewModel[0]);
            }
            int i = 0;

            for (int i1 = 0, i2 = 0; i1 < n1 && i2 < n2;)
            {
                string filename1 = r1[i1].BenchmarkFileName;
                string filename2 = r2[i2].BenchmarkFileName;
                if (!param.IsCategoryChecked)
                {
                    filename1 = param.Category1 + "/" + filename1;
                    filename2 = param.Category2 + "/" + filename2;
                }
                if (param.IsPostfixChecked)
                {
                    filename1 = filename1.Substring(0, filename1.Length - param.Ext1.Length);
                    filename2 = filename2.Substring(0, filename2.Length - param.Ext2.Length);
                }
                int cmp = string.Compare(filename1, filename2);
                if (cmp == 0)
                {
                    join[i++] = new CompareBenchmarksViewModel(filename1,
                                                               new BenchmarkResultViewModel(r1[i1], uiService),
                                                               new BenchmarkResultViewModel(r2[i2], uiService),
                                                               uiService);
                    i1++; i2++;
                }
                else if (cmp < 0) // ~ r1 < r2
                {
                    i1++;
                }
                else // ~ r1 > r2
                {
                    i2++;
                }
            }
            var join2 = new CompareBenchmarksViewModel[i];

            for (; --i >= 0;)
            {
                join2[i] = join[i];
            }
            return(join2);
        }
Exemple #3
0
        private static CompareBenchmarksViewModel[] InnerJoinOrderedResults(BenchmarkResult[] r1, BenchmarkResult[] r2, CheckboxParameters param, IUIService uiService)
        {
            int n1   = r1.Length;
            int n2   = r2.Length;
            var join = new CompareBenchmarksViewModel[Math.Min(n1, n2)];
            int i    = 0;

            for (int i1 = 0, i2 = 0; i1 < n1 && i2 < n2;)
            {
                string filename1 = MakeDatapointName(
                    param.IsPrefixChecked, param.IsCategoryChecked, param.IsPostfixChecked,
                    param.Container1, param.Category1, r1[i1].BenchmarkFileName);
                string filename2 = MakeDatapointName(
                    param.IsPrefixChecked, param.IsCategoryChecked, param.IsPostfixChecked,
                    param.Container2, param.Category2, r2[i2].BenchmarkFileName);

                int cmp = string.Compare(filename1, filename2);
                if (cmp == 0)
                {
                    join[i++] = new CompareBenchmarksViewModel(filename1,
                                                               new BenchmarkResultViewModel(r1[i1], uiService),
                                                               new BenchmarkResultViewModel(r2[i2], uiService),
                                                               uiService);
                    i1++; i2++;
                }
                else if (cmp < 0) // ~ r1 < r2
                {
                    i1++;
                }
                else // ~ r1 > r2
                {
                    i2++;
                }
            }
            var join2 = new CompareBenchmarksViewModel[i];

            for (; --i >= 0;)
            {
                join2[i] = join[i];
            }
            return(join2);
        }
Exemple #4
0
        private void CopyFilename(object target, ExecutedRoutedEventArgs e)
        {
            CompareBenchmarksViewModel elem = (CompareBenchmarksViewModel)dataGrid.SelectedItem;

            Clipboard.SetText(elem.Filename);
        }