Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/15 15:32:12 (9 years ago)
Author:
dglaser
Message:

#2388: Merged trunk into HiveStatistics branch

Location:
branches/HiveStatistics/sources
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/HLScript/HeuristicLab.Optimization.Viewsmergedeligible
      /stable/HeuristicLab.Optimization.Viewsmergedeligible
      /trunk/sources/HeuristicLab.Optimization.Viewsmergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.Optimization.Views10321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.Optimization.Views5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Optimization.Views6917-7005
      /branches/CloningRefactoring/HeuristicLab.Optimization.Views4656-4721
      /branches/CodeEditor/HeuristicLab.Optimization.Views11700-11806
      /branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Views5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Optimization.Views5815-6180
      /branches/DataAnalysis/HeuristicLab.Optimization.Views4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Optimization.Views10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization.Views5060
      /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Optimization.Views11570-12508
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Optimization.Views6123-9799
      /branches/LogResidualEvaluator/HeuristicLab.Optimization.Views10202-10483
      /branches/NET40/sources/HeuristicLab.Optimization.Views5138-5162
      /branches/NSGA-II Changes/HeuristicLab.Optimization.Views12033-12122
      /branches/ParallelEngine/HeuristicLab.Optimization.Views5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Optimization.Views6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Optimization.Views6828
      /branches/RuntimeOptimizer/HeuristicLab.Optimization.Views8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Views7787-8333
      /branches/SlaveShutdown/HeuristicLab.Optimization.Views8944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Optimization.Views10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Optimization.Views5370-5682
      /branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views9438-12626
      /branches/Trunk/HeuristicLab.Optimization.Views6829-6865
      /branches/UnloadJobs/HeuristicLab.Optimization.Views9168-9215
      /branches/VNS/HeuristicLab.Optimization.Views5594-5752
      /branches/histogram/HeuristicLab.Optimization.Views5959-6341
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r12102 r12689  
    281281      <DependentUpon>RunCollectionChartAggregationView.cs</DependentUpon>
    282282    </Compile>
     283    <Compile Include="TimeLimitRunView.cs">
     284      <SubType>UserControl</SubType>
     285    </Compile>
     286    <Compile Include="TimeLimitRunView.Designer.cs">
     287      <DependentUpon>TimeLimitRunView.cs</DependentUpon>
     288    </Compile>
    283289    <Compile Include="UserDefinedAlgorithmView.cs">
    284290      <SubType>UserControl</SubType>
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs

    r12012 r12689  
    2424using System.ComponentModel;
    2525using System.Linq;
    26 using System.Windows.Forms;
    2726using HeuristicLab.Analysis;
    2827using HeuristicLab.Collections;
     
    4140    }
    4241
    43     private int rowNumber = 0;
     42    private int rowNumber;
    4443    private bool suppressUpdates;
    4544    private readonly Dictionary<IRun, IEnumerable<DataRow>> runMapping;
     
    6059    protected override void RegisterContentEvents() {
    6160      base.RegisterContentEvents();
    62       Content.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
    63       Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    64       Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    65       Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
    66       Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged);
     61      Content.ItemsAdded += Content_ItemsAdded;
     62      Content.ItemsRemoved += Content_ItemsRemoved;
     63      Content.CollectionReset += Content_CollectionReset;
     64      Content.UpdateOfRunsInProgressChanged += Content_UpdateOfRunsInProgressChanged;
     65      Content.OptimizerNameChanged += Content_AlgorithmNameChanged;
    6766    }
    6867    protected override void DeregisterContentEvents() {
    69       Content.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
    70       Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    71       Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    72       Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
    73       Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
     68      Content.ItemsAdded -= Content_ItemsAdded;
     69      Content.ItemsRemoved -= Content_ItemsRemoved;
     70      Content.CollectionReset -= Content_CollectionReset;
     71      Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged;
     72      Content.OptimizerNameChanged -= Content_AlgorithmNameChanged;
    7473      base.DeregisterContentEvents();
    7574    }
    7675
    7776    private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     77      if (suppressUpdates) return;
    7878      if (InvokeRequired) {
    7979        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e);
    8080        return;
    8181      }
     82      UpdateDataTableComboBox();
     83      UpdateDataRowComboBox();
    8284      AddRuns(e.Items);
    8385    }
    8486    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     87      if (suppressUpdates) return;
    8588      if (InvokeRequired) {
    8689        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
    8790        return;
    8891      }
     92      UpdateDataTableComboBox();
     93      UpdateDataRowComboBox();
    8994      RemoveRuns(e.Items);
    9095    }
    9196    private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     97      if (suppressUpdates) return;
    9298      if (InvokeRequired) {
    9399        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
    94100        return;
    95101      }
     102      UpdateDataTableComboBox();
     103      UpdateDataRowComboBox();
    96104      RemoveRuns(e.OldItems);
    97105      AddRuns(e.Items);
     
    108116      }
    109117      suppressUpdates = Content.UpdateOfRunsInProgress;
    110       if (!suppressUpdates) UpdateRuns(Content);
     118      if (!suppressUpdates) {
     119        UpdateDataTableComboBox();
     120        UpdateDataRowComboBox();
     121        UpdateRuns(Content);
     122      }
    111123    }
    112124
     
    124136        var run = (IRun)sender;
    125137        if (e.PropertyName == "Color" || e.PropertyName == "Visible")
    126           UpdateRuns(new IRun[] { run });
     138          UpdateRuns(new[] { run });
    127139      }
    128140    }
     
    168180
    169181    private void UpdateRuns(IEnumerable<IRun> runs) {
    170       if (suppressUpdates) return;
    171182      foreach (var run in runs) {
    172183        //update color
    173         foreach (var dataRow in runMapping[run]) {
    174           dataRow.VisualProperties.Color = run.Color;
     184        if (!runMapping.ContainsKey(run)) {
     185          runMapping[run] = ExtractDataRowsFromRun(run).ToList();
     186          RegisterRunEvents(run);
     187        } else {
     188          foreach (var dataRow in runMapping[run]) {
     189            dataRow.VisualProperties.Color = run.Color;
     190          }
    175191        }
    176         //update visibility - remove and add all rows to keep the same order as before
    177         combinedDataTable.Rows.Clear();
    178         combinedDataTable.Rows.AddRange(runMapping.Where(mapping => mapping.Key.Visible).SelectMany(mapping => mapping.Value));
    179       }
     192      }
     193      //update visibility - remove and add all rows to keep the same order as before
     194      combinedDataTable.Rows.Clear();
     195      combinedDataTable.Rows.AddRange(runMapping.Where(mapping => mapping.Key.Visible).SelectMany(mapping => mapping.Value));
    180196    }
    181197
    182198    private IEnumerable<DataRow> ExtractDataRowsFromRun(IRun run) {
    183199      var resultName = (string)dataTableComboBox.SelectedItem;
     200      if (string.IsNullOrEmpty(resultName)) yield break;
     201
    184202      var rowName = (string)dataRowComboBox.SelectedItem;
    185203      if (!run.Results.ContainsKey(resultName)) yield break;
     
    199217
    200218    private void UpdateDataTableComboBox() {
     219      string selectedItem = (string)dataTableComboBox.SelectedItem;
     220
    201221      dataTableComboBox.Items.Clear();
    202222      var dataTables = (from run in Content
     
    206226
    207227      dataTableComboBox.Items.AddRange(dataTables);
    208       if (dataTableComboBox.Items.Count > 0) dataTableComboBox.SelectedItem = dataTableComboBox.Items[0];
     228      if (selectedItem != null && dataTableComboBox.Items.Contains(selectedItem)) {
     229        dataTableComboBox.SelectedItem = selectedItem;
     230      } else if (dataTableComboBox.Items.Count > 0) {
     231        dataTableComboBox.SelectedItem = dataTableComboBox.Items[0];
     232      }
    209233    }
    210234
     
    214238
    215239    private void UpdateDataRowComboBox() {
     240      string selectedItem = (string)dataRowComboBox.SelectedItem;
     241
    216242      dataRowComboBox.Items.Clear();
    217243      var resultName = (string)dataTableComboBox.SelectedItem;
     
    225251      dataRowComboBox.Items.AddRange(rowNames);
    226252      dataRowComboBox.Items.Add(AllDataRows);
    227       if (dataRowComboBox.Items.Count > 0) dataRowComboBox.SelectedItem = dataRowComboBox.Items[0];
    228     }
    229 
    230     private void dataTableComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
    231       UpdateDataRowComboBox();
    232     }
    233     private void dataRowComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
     253      if (selectedItem != null && dataRowComboBox.Items.Contains(selectedItem)) {
     254        dataRowComboBox.SelectedItem = selectedItem;
     255      } else if (dataRowComboBox.Items.Count > 0) {
     256        dataRowComboBox.SelectedItem = dataRowComboBox.Items[0];
     257      }
     258    }
     259
     260    private void dataTableComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     261      UpdateDataRowComboBox();
     262    }
     263    private void dataRowComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     264      if (suppressUpdates) return;
    234265      RebuildCombinedDataTable();
    235266    }
Note: See TracChangeset for help on using the changeset viewer.