Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/06/20 17:55:24 (4 years ago)
Author:
mkommend
Message:

#2973: Merged r17276, r17426, r17430, r17488 into stable.

Location:
stable
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.Designer.cs

    r17181 r17500  
    192192      this.Name = "RegressionSolutionVariableImpactsView";
    193193      this.Size = new System.Drawing.Size(712, 365);
    194       this.VisibleChanged += new System.EventHandler(this.RegressionSolutionVariableImpactsView_VisibleChanged);
    195194      this.ResumeLayout(false);
    196195      this.PerformLayout();
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs

    r17181 r17500  
    2525using System.Threading;
    2626using System.Threading.Tasks;
     27using System.Windows.Forms;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Data;
     
    8687      }
    8788    }
    88     private void RegressionSolutionVariableImpactsView_VisibleChanged(object sender, EventArgs e) {
     89
     90    protected override void OnVisibleChanged(EventArgs e) {
     91      base.OnVisibleChanged(e);
     92      if (!this.Visible) {
     93        cancellationToken.Cancel();
     94      }
     95    }
     96
     97    protected override void OnClosed(FormClosedEventArgs e) {
     98      base.OnClosed(e);
    8999      cancellationToken.Cancel();
    90100    }
     
    135145          .ToList();
    136146
    137         List<Tuple<string, double>> impacts = null;
    138         await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); });
    139         if (impacts == null) { return; }
     147        var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress));
    140148
    141149        rawVariableImpacts.AddRange(impacts);
    142150        UpdateOrdering();
    143       }
    144       finally {
     151      } catch (OperationCanceledException) {
     152      } finally {
    145153        Progress.Hide(this);
    146154      }
     
    168176
    169177      foreach (var variableName in originalVariableOrdering) {
    170         if (cancellationToken.Token.IsCancellationRequested) { return null; }
     178        token.ThrowIfCancellationRequested();
    171179        progress.ProgressValue = (double)++i / count;
    172180        progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
Note: See TracChangeset for help on using the changeset viewer.