Changeset 17928 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
- Timestamp:
- 04/06/21 13:13:32 (3 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
r17180 r17928 25 25 using System.Threading; 26 26 using System.Threading.Tasks; 27 using System.Windows.Forms; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Data; … … 86 87 } 87 88 } 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); 89 99 cancellationToken.Cancel(); 90 100 } … … 135 145 .ToList(); 136 146 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)); 140 148 141 149 rawVariableImpacts.AddRange(impacts); 142 150 UpdateOrdering(); 143 } 144 finally {151 } catch (OperationCanceledException) { 152 } finally { 145 153 Progress.Hide(this); 146 154 } … … 168 176 169 177 foreach (var variableName in originalVariableOrdering) { 170 if (cancellationToken.Token.IsCancellationRequested) { return null; }178 token.ThrowIfCancellationRequested(); 171 179 progress.ProgressValue = (double)++i / count; 172 180 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.