Changeset 11594 for branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
- Timestamp:
- 11/27/14 11:23:37 (9 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r9910 r11594 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Linq; 25 26 using System.Windows.Forms; … … 92 93 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 93 94 foreach (IRun run in runs) 94 run. Changed += new EventHandler(run_Changed);95 run.PropertyChanged += run_PropertyChanged; 95 96 } 96 97 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 97 98 foreach (IRun run in runs) 98 run. Changed -= new EventHandler(run_Changed);99 run.PropertyChanged -= run_PropertyChanged; 99 100 } 100 101 … … 122 123 Invoke(new EventHandler(Content_Reset), sender, e); 123 124 else { 124 this.categoricalMapping.Clear();125 125 UpdateDataPoints(); 126 126 UpdateAxisLabels(); … … 134 134 } 135 135 } 136 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 137 137 if (InvokeRequired) 138 this.Invoke( new EventHandler(run_Changed), sender, e);138 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 139 139 else if (!suppressUpdates) { 140 UpdateDataPoints(); 140 if (e.PropertyName == "Visible") 141 UpdateDataPoints(); 141 142 } 142 143 } … … 189 190 190 191 private void UpdateDataPoints() { 192 this.categoricalMapping.Clear(); 191 193 this.chart.Series.Clear(); 192 194 this.seriesCache.Clear(); … … 216 218 if (datapoint != null) { 217 219 IRun run = (IRun)datapoint.Tag; 218 string selectedAxis = (string)xAxisComboBox.SelectedItem;220 string selectedAxis = xAxisValue; 219 221 IItem value = null; 220 222 … … 234 236 } 235 237 matrix.ColumnNames = columnNames; 236 matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", " Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };238 matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Median", "Average", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" }; 237 239 238 240 for (int i = 0; i < seriesCache.Count; i++) { … … 242 244 matrix[1, i] = seriesValues.Min(); 243 245 matrix[2, i] = seriesValues.Max(); 244 matrix[3, i] = seriesValues. Average();245 matrix[4, i] = seriesValues. Median();246 matrix[3, i] = seriesValues.Median(); 247 matrix[4, i] = seriesValues.Average(); 246 248 matrix[5, i] = seriesValues.StandardDeviation(); 247 249 matrix[6, i] = seriesValues.Variance(); … … 325 327 } 326 328 } 327 private double GetCategoricalValue(int dimension, string value) {329 private double? GetCategoricalValue(int dimension, string value) { 328 330 if (!this.categoricalMapping.ContainsKey(dimension)) { 329 331 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 336 338 } 337 339 } 340 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 338 341 return this.categoricalMapping[dimension][value]; 339 342 } 340 private double GetValue(IRun run, AxisDimension axisDimension) {341 double value = double.NaN;343 private double? GetValue(IRun run, AxisDimension axisDimension) { 344 double? value = double.NaN; 342 345 switch (axisDimension) { 343 346 case AxisDimension.Color: { … … 373 376 Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY; 374 377 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 375 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 376 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 377 if (xAxisComboBox.SelectedItem != null) 378 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 379 if (yAxisComboBox.SelectedItem != null) 380 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 378 //mkommend: combobox.SelectedIndex could not be used as this changes during hoovering over possible values 379 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 380 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 381 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 382 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 383 if (xAxisValue != null) 384 xAxis.Title = xAxisValue; 385 if (yAxisValue != null) 386 yAxis.Title = yAxisValue; 381 387 } 382 388
Note: See TracChangeset
for help on using the changeset viewer.