Changeset 17380
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
r17378 r17380 38 38 } 39 39 40 protected override void SetEnabledStateOfControls() { 41 base.SetEnabledStateOfControls(); 42 43 var tree = Content?.Model?.SymbolicExpressionTree; 44 btnOptimizeConstants.Enabled = tree != null && SymbolicRegressionConstantOptimizationEvaluator.CanOptimizeConstants(tree); 45 } 46 40 47 protected override void UpdateModel(ISymbolicExpressionTree tree) { 41 48 var model = new SymbolicRegressionModel(Content.ProblemData.TargetVariable, tree, Content.Model.Interpreter, Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit); 42 49 model.Scale(Content.ProblemData); 43 50 Content.Model = model; 44 }45 46 protected override void UpdateView() {47 base.UpdateView();48 var tree = Content?.Model?.SymbolicExpressionTree;49 btnOptimizeConstants.Enabled = tree != null && SymbolicRegressionConstantOptimizationEvaluator.CanOptimizeConstants(tree);50 51 } 51 52 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r17378 r17380 168 168 private void Content_Changed(object sender, EventArgs e) { 169 169 UpdateView(); 170 SetEnabledStateOfControls(); 170 171 } 171 172 … … 186 187 } 187 188 188 pr otected virtualasync void UpdateView() {189 private async void UpdateView() { 189 190 if (Content == null || Content.Model == null || Content.ProblemData == null) return; 190 191 var tree = Content.Model.SymbolicExpressionTree; … … 317 318 var newTree = await Task.Run(() => OptimizeConstants(tree, progress)); 318 319 await Task.Delay(500); // wait for progressbar to finish animation 319 UpdateModel(newTree); // UpdateModel calls Progress.Finish (via Content_Changed)320 } catch (Exception){320 UpdateModel(newTree); 321 } finally { 321 322 progress.Finish(); 322 throw;323 323 } 324 324 }
Note: See TracChangeset
for help on using the changeset viewer.