Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/16 12:28:09 (9 years ago)
Author:
pfleck
Message:

#2597:

  • Reverted UpdateAutomatically property.
  • Made UpdateChart method async to avoid blocking the GUI thread.
  • Changed Content type of RegressionSolutionGradientView to IRegressionSolution.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs

    r13836 r13837  
    3232namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    3333  [View("Gradient View")]
    34   [Content(typeof(IConfidenceBoundRegressionSolution))]
     34  [Content(typeof(IRegressionSolution))]
    3535  public partial class RegressionSolutionGradientView : DataAnalysisSolutionEvaluationView {
    3636    private const int DrawingSteps = 1000;
     
    4444    }
    4545
    46     public new IConfidenceBoundRegressionSolution Content {
    47       get { return (IConfidenceBoundRegressionSolution)base.Content; }
     46    public new IRegressionSolution Content {
     47      get { return (IRegressionSolution)base.Content; }
    4848      set { base.Content = value; }
    4949    }
     
    5555      trackbars = new ObservableList<DensityTrackbar>();
    5656      trackbars.ItemsAdded += (sender, args) => {
    57         ForEach(args.Items.Select(i => i.Value), RegisterEvents);
     57        args.Items.Select(i => i.Value).ForEach(RegisterEvents);
    5858      };
    5959      trackbars.ItemsRemoved += (sender, args) => {
    60         ForEach(args.Items.Select(i => i.Value), DeregisterEvents);
     60        args.Items.Select(i => i.Value).ForEach(DeregisterEvents);
    6161      };
    6262      trackbars.CollectionReset += (sender, args) => {
    63         ForEach(args.OldItems.Select(i => i.Value), DeregisterEvents);
    64         ForEach(args.Items.Select(i => i.Value), RegisterEvents);
     63        args.OldItems.Select(i => i.Value).ForEach(DeregisterEvents);
     64        args.Items.Select(i => i.Value).ForEach(RegisterEvents);
    6565      };
    6666
     
    8787      sharedFixedVariables = new ModifiableDataset(variableNames, newTrackbars.Select(tb => new List<double>(1) { (double)tb.Value }));
    8888      gradientChart.Configure(new[] { Content }, sharedFixedVariables, variableNames.First(), DrawingSteps);
    89       gradientChart.UpdateChart();
     89      gradientChart.UpdateChartAsync();
    9090
    9191      // Add to table and observable lists     
     
    149149    }
    150150
    151     private void trackbar_ValueChanged(object sender, EventArgs e) {
     151    private async void trackbar_ValueChanged(object sender, EventArgs e) {
    152152      var trackBar = sender as DensityTrackbar;
    153153      if (trackBar == null) return;
    154154      sharedFixedVariables.SetVariableValue((double)trackBar.Value, variableNames[trackbars.IndexOf(trackBar)], 0);
    155       gradientChart.UpdateChart();
     155      await gradientChart.UpdateChartAsync();
    156156    }
    157157
     
    183183    #endregion
    184184
    185     public static void ForEach<T>(IEnumerable<T> source, Action<T> action) {
     185
     186  }
     187
     188  internal static class Extensions {
     189    public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) {
    186190      foreach (T item in source)
    187191        action(item);
Note: See TracChangeset for help on using the changeset viewer.