- Timestamp:
- 07/08/15 15:32:12 (9 years ago)
- 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.Views merged eligible /stable/HeuristicLab.Optimization.Views merged eligible /trunk/sources/HeuristicLab.Optimization.Views merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Optimization.Views 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Optimization.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Optimization.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.Optimization.Views 4656-4721 /branches/CodeEditor/HeuristicLab.Optimization.Views 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Optimization.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Optimization.Views 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Optimization.Views 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization.Views 5060 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Optimization.Views 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Optimization.Views 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Optimization.Views 10202-10483 /branches/NET40/sources/HeuristicLab.Optimization.Views 5138-5162 /branches/NSGA-II Changes/HeuristicLab.Optimization.Views 12033-12122 /branches/ParallelEngine/HeuristicLab.Optimization.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Optimization.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Optimization.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.Optimization.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.Optimization.Views 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Optimization.Views 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Optimization.Views 5370-5682 /branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views 9438-12626 /branches/Trunk/HeuristicLab.Optimization.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.Optimization.Views 9168-9215 /branches/VNS/HeuristicLab.Optimization.Views 5594-5752 /branches/histogram/HeuristicLab.Optimization.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r12102 r12689 281 281 <DependentUpon>RunCollectionChartAggregationView.cs</DependentUpon> 282 282 </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> 283 289 <Compile Include="UserDefinedAlgorithmView.cs"> 284 290 <SubType>UserControl</SubType> -
branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
r12012 r12689 24 24 using System.ComponentModel; 25 25 using System.Linq; 26 using System.Windows.Forms;27 26 using HeuristicLab.Analysis; 28 27 using HeuristicLab.Collections; … … 41 40 } 42 41 43 private int rowNumber = 0;42 private int rowNumber; 44 43 private bool suppressUpdates; 45 44 private readonly Dictionary<IRun, IEnumerable<DataRow>> runMapping; … … 60 59 protected override void RegisterContentEvents() { 61 60 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; 67 66 } 68 67 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; 74 73 base.DeregisterContentEvents(); 75 74 } 76 75 77 76 private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) { 77 if (suppressUpdates) return; 78 78 if (InvokeRequired) { 79 79 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e); 80 80 return; 81 81 } 82 UpdateDataTableComboBox(); 83 UpdateDataRowComboBox(); 82 84 AddRuns(e.Items); 83 85 } 84 86 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 87 if (suppressUpdates) return; 85 88 if (InvokeRequired) { 86 89 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e); 87 90 return; 88 91 } 92 UpdateDataTableComboBox(); 93 UpdateDataRowComboBox(); 89 94 RemoveRuns(e.Items); 90 95 } 91 96 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 97 if (suppressUpdates) return; 92 98 if (InvokeRequired) { 93 99 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e); 94 100 return; 95 101 } 102 UpdateDataTableComboBox(); 103 UpdateDataRowComboBox(); 96 104 RemoveRuns(e.OldItems); 97 105 AddRuns(e.Items); … … 108 116 } 109 117 suppressUpdates = Content.UpdateOfRunsInProgress; 110 if (!suppressUpdates) UpdateRuns(Content); 118 if (!suppressUpdates) { 119 UpdateDataTableComboBox(); 120 UpdateDataRowComboBox(); 121 UpdateRuns(Content); 122 } 111 123 } 112 124 … … 124 136 var run = (IRun)sender; 125 137 if (e.PropertyName == "Color" || e.PropertyName == "Visible") 126 UpdateRuns(new IRun[] { run });138 UpdateRuns(new[] { run }); 127 139 } 128 140 } … … 168 180 169 181 private void UpdateRuns(IEnumerable<IRun> runs) { 170 if (suppressUpdates) return;171 182 foreach (var run in runs) { 172 183 //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 } 175 191 } 176 //update visibility - remove and add all rows to keep the same order as before177 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)); 180 196 } 181 197 182 198 private IEnumerable<DataRow> ExtractDataRowsFromRun(IRun run) { 183 199 var resultName = (string)dataTableComboBox.SelectedItem; 200 if (string.IsNullOrEmpty(resultName)) yield break; 201 184 202 var rowName = (string)dataRowComboBox.SelectedItem; 185 203 if (!run.Results.ContainsKey(resultName)) yield break; … … 199 217 200 218 private void UpdateDataTableComboBox() { 219 string selectedItem = (string)dataTableComboBox.SelectedItem; 220 201 221 dataTableComboBox.Items.Clear(); 202 222 var dataTables = (from run in Content … … 206 226 207 227 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 } 209 233 } 210 234 … … 214 238 215 239 private void UpdateDataRowComboBox() { 240 string selectedItem = (string)dataRowComboBox.SelectedItem; 241 216 242 dataRowComboBox.Items.Clear(); 217 243 var resultName = (string)dataTableComboBox.SelectedItem; … … 225 251 dataRowComboBox.Items.AddRange(rowNames); 226 252 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; 234 265 RebuildCombinedDataTable(); 235 266 }
Note: See TracChangeset
for help on using the changeset viewer.