コード例 #1
0
        public static async Task <bool> TryReclassifyResults(BenchmarkResultViewModel[] resultsToUpdate, ResultStatus newStatus, TimeSpan benchmarkTimeout, ExperimentResults results)
        {
            if (results == null)
            {
                throw new ArgumentNullException(nameof(results));
            }
            if (resultsToUpdate == null)
            {
                throw new ArgumentNullException(nameof(resultsToUpdate));
            }
            if (resultsToUpdate.Length == 0)
            {
                return(true);
            }

            var changes = await results.TryUpdateStatus(resultsToUpdate.Select(r => r.result), newStatus);

            if (changes != null) // ok
            {
                foreach (var c in changes)
                {
                    BenchmarkResultViewModel vm = resultsToUpdate.First(r => r.result == c.Key);
                    // replace and notify about new status
                    vm.UpdateResult(c.Value);
                }
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public async void ReclassifyResults(BenchmarkResultViewModel[] old_Results, ResultStatus rc)
        {
            var handle = uiService.StartIndicateLongOperation("Updating results status...");

            try
            {
                bool success = await BenchmarkResultViewModel.TryReclassifyResults(old_Results, rc, benchmarkTimeout, experimentResults);

                if (success)
                {
                    uiService.ShowInfo("Results have been reclassified.");
                }
                else
                {
                    uiService.ShowWarning("Results of the experiment have been modified since they were downloaded. Reopen the table and try again.", "Failed to reclassify");
                }
            }
            catch (Exception ex)
            {
                uiService.ShowError(ex, "Error when reclassifying");
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
0
ファイル: ShowResults.xaml.cs プロジェクト: dvoits/z3test
        private void CopyFilename(object target, ExecutedRoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            BenchmarkResultViewModel elem = (BenchmarkResultViewModel)dataGrid.SelectedItem;

            Clipboard.SetText(elem.Filename);
            Mouse.OverrideCursor = null;
        }
コード例 #5
0
 public CompareBenchmarksViewModel(string filename, BenchmarkResultViewModel res1, BenchmarkResultViewModel res2, IUIService message)
 {
     if (res1 == null || res2 == null)
     {
         throw new ArgumentNullException("results");
     }
     if (message == null)
     {
         throw new ArgumentNullException("message");
     }
     this.result1  = res1;
     this.result2  = res2;
     this.filename = filename;
     this.message  = message;
 }
コード例 #6
0
ファイル: ShowResults.xaml.cs プロジェクト: dvoits/z3test
        private async void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dataGrid.SelectedItems.Count != 1)
            {
                return;
            }

            try
            {
                BenchmarkResultViewModel vm = (BenchmarkResultViewModel)dataGrid.SelectedItem;
                ShowOutput w = new ShowOutput();
                w.Owner = this;
                w.Show();

                w.DataContext = await vm.GetOutputViewModel();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Failed to load output");
            }
        }
コード例 #7
0
 public void Pick(BenchmarkResultViewModel takeThis)
 {
     pick = duplicates[Array.IndexOf <BenchmarkResultViewModel>(duplicatesVm, takeThis)];
 }