Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/21/10 18:19:39 (13 years ago)
Author:
mkommend
Message:

Improved performance of all RunCollectionViews (ticket #1284).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBoxPlotView.cs

    r4768 r4883  
    3939    private const string BoxPlotChartAreaName = "BoxPlotChartArea";
    4040
     41    private bool suppressUpdates = false;
    4142    private string xAxisValue;
    4243    private string yAxisValue;
     
    4647    public RunCollectionBoxPlotView() {
    4748      InitializeComponent();
    48       this.categoricalMapping = new Dictionary<int, Dictionary<object, double>>();
    49       this.seriesCache = new SortedDictionary<double, Series>();
    50       this.chart.ChartAreas[0].Visible = false;
    51       this.chart.Series.Clear();
    52       this.chart.ChartAreas.Add(BoxPlotChartAreaName);
    53       this.chart.CustomizeAllChartAreas();
     49      categoricalMapping = new Dictionary<int, Dictionary<object, double>>();
     50      seriesCache = new SortedDictionary<double, Series>();
     51      chart.ChartAreas[0].Visible = false;
     52      chart.Series.Clear();
     53      chart.ChartAreas.Add(BoxPlotChartAreaName);
     54      chart.CustomizeAllChartAreas();
    5455    }
    5556
     
    7071      Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    7172      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
     73      Content.UpdateOfRunsInProgress += new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);
    7274      RegisterRunEvents(Content);
    7375    }
     
    7981      Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    8082      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
     83      Content.UpdateOfRunsInProgress -= new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);
    8184      DeregisterRunEvents(Content);
    8285    }
     
    100103    private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
    101104      RegisterRunEvents(e.Items);
     105    }
     106    private void Content_UpdateOfRunsInProgress(object sender, EventArgs<bool> e) {
     107      if (InvokeRequired)
     108        Invoke(new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress), sender, e);
     109      else {
     110        suppressUpdates = e.Value;
     111        if (!suppressUpdates) UpdateDataPoints();
     112      }
    102113    }
    103114
     
    120131      if (InvokeRequired)
    121132        this.Invoke(new EventHandler(run_Changed), sender, e);
    122       else {
     133      else if (!suppressUpdates) {
    123134        IRun run = (IRun)sender;
    124135        UpdateDataPoints();
     
    326337    #region GUI events
    327338    private void UpdateNoRunsVisibleLabel() {
    328       if (this.chart.Series.Count > 0)
     339      if (this.chart.Series.Count > 0) {
    329340        noRunsLabel.Visible = false;
    330       else
     341        splitContainer.Panel2Collapsed = !showStatisticsCheckBox.Checked;
     342      } else {
    331343        noRunsLabel.Visible = true;
     344        splitContainer.Panel2Collapsed = true;
     345      }
    332346    }
    333347
Note: See TracChangeset for help on using the changeset viewer.