Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/23/13 10:33:11 (11 years ago)
Author:
ascheibe
Message:

#2031 updated chart analysis view to work with new progress handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/ChartAnalysisView.cs

    r9749 r9904  
    4848
    4949    private List<IRun> runs;
    50     private Progress progress;
    51     private ProgressView progressView;
     50    private IProgress progress;
    5251    private bool valuesAdded = false;
    5352
    5453    public ChartAnalysisView() {
    5554      InitializeComponent();
    56       progress = new Progress() {
    57         CanBeCanceled = false,
    58         ProgressState = ProgressState.Finished
    59       };
    60       progressView = new ProgressView(this, progress);
    6155
    6256      stringConvertibleMatrixView.DataGridView.RowHeaderMouseDoubleClick += new DataGridViewCellMouseEventHandler(DataGridView_RowHeaderMouseDoubleClick);
     
    7872        components.Dispose();
    7973      }
    80       if (disposing)
    81         progressView.Dispose();
     74
    8275      base.Dispose(disposing);
    8376    }
     
    153146
    154147    private void addLineToChart_Click(object sender, EventArgs e) {
    155       progress.Status = "Adding fitted lines to charts...";
    156       progress.ProgressState = ProgressState.Started;
    157       progress.ProgressValue = 0.0;
     148      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Adding fitted lines to charts...");
    158149
    159150      var task = System.Threading.Tasks.Task.Factory.StartNew(AddLineToChart);
    160151
    161152      task.ContinueWith((t) => {
    162         progress.Finish();
     153        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    163154        ErrorHandling.ShowErrorDialog("An error occured while adding lines to charts. ", t.Exception);
    164155      }, TaskContinuationOptions.OnlyOnFaulted);
    165156
    166157      task.ContinueWith((t) => {
    167         progress.Finish();
     158        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    168159      }, TaskContinuationOptions.OnlyOnRanToCompletion);
    169160    }
     
    235226
    236227    private void RebuildDataTableAsync() {
    237       progress.Status = "Calculating values...";
    238       progress.ProgressState = ProgressState.Started;
    239       progress.ProgressValue = 0.0;
    240 
    241       var task = System.Threading.Tasks.Task.Factory.StartNew(RebuildDataTable);
     228      progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating values...");
     229
     230      var task = Task.Factory.StartNew(RebuildDataTable);
    242231
    243232      task.ContinueWith((t) => {
    244         progress.Finish();
     233        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    245234        ErrorHandling.ShowErrorDialog("An error occured while calculating values. ", t.Exception);
    246235      }, TaskContinuationOptions.OnlyOnFaulted);
    247236
    248237      task.ContinueWith((t) => {
    249         progress.Finish();
     238        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    250239      }, TaskContinuationOptions.OnlyOnRanToCompletion);
    251240    }
     
    307296
    308297        i++;
     298        progress.ProgressValue = runs.Count / i;
    309299      }
    310300      stringConvertibleMatrixView.Content = dt;
Note: See TracChangeset for help on using the changeset viewer.