Changeset 9240
- Timestamp:
- 02/21/13 16:20:52 (12 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Optimization.Views merged eligible /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/HeuristicLab.Optimization.Views 3219-3222
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r9079 r9240 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 50 50 <DebugType>pdbonly</DebugType> 51 51 <Optimize>true</Optimize> 52 <OutputPath> $(SolutionDir)\bin\</OutputPath>52 <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath> 53 53 <DefineConstants>TRACE</DefineConstants> 54 54 <ErrorReport>prompt</ErrorReport> … … 99 99 </PropertyGroup> 100 100 <ItemGroup> 101 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 102 <SpecificVersion>False</SpecificVersion> 103 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 104 </Reference> 105 <Reference Include="HeuristicLab.Analysis.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 106 <SpecificVersion>False</SpecificVersion> 107 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Analysis.Views-3.3.dll</HintPath> 108 </Reference> 109 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 110 <SpecificVersion>False</SpecificVersion> 111 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 112 </Reference> 113 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 114 <SpecificVersion>False</SpecificVersion> 115 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 116 </Reference> 117 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 118 <SpecificVersion>False</SpecificVersion> 119 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 120 </Reference> 121 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 122 <SpecificVersion>False</SpecificVersion> 123 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 124 </Reference> 125 <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 126 <SpecificVersion>False</SpecificVersion> 127 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath> 128 </Reference> 129 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 130 <SpecificVersion>False</SpecificVersion> 131 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 132 </Reference> 133 <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 134 <SpecificVersion>False</SpecificVersion> 135 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath> 136 </Reference> 137 <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 138 <SpecificVersion>False</SpecificVersion> 139 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> 140 </Reference> 141 <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 142 <SpecificVersion>False</SpecificVersion> 143 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 144 </Reference> 145 <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 146 <SpecificVersion>False</SpecificVersion> 147 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 148 </Reference> 149 <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 150 <SpecificVersion>False</SpecificVersion> 151 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 152 </Reference> 153 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 154 <SpecificVersion>False</SpecificVersion> 155 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 156 </Reference> 157 <Reference Include="HeuristicLab.Problems.Instances.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 158 <SpecificVersion>False</SpecificVersion> 159 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.Instances.Views-3.3.dll</HintPath> 160 </Reference> 161 <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 162 <SpecificVersion>False</SpecificVersion> 163 <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath> 164 </Reference> 101 165 <Reference Include="Microsoft.CSharp" /> 102 166 <Reference Include="System" /> … … 317 381 </ItemGroup> 318 382 <ItemGroup> 319 <ProjectReference Include="..\..\HeuristicLab.Analysis.Views\3.3\HeuristicLab.Analysis.Views-3.3.csproj"> 320 <Project>{76945D76-CA61-4147-9DC2-0ACDCDDF87F9}</Project> 321 <Name>HeuristicLab.Analysis.Views-3.3</Name> 322 <Private>False</Private> 323 </ProjectReference> 324 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 325 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 326 <Name>HeuristicLab.Collections-3.3</Name> 327 <Private>False</Private> 328 </ProjectReference> 329 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 330 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 331 <Name>HeuristicLab.Common.Resources-3.3</Name> 332 <Private>False</Private> 333 </ProjectReference> 334 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 335 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 336 <Name>HeuristicLab.Common-3.3</Name> 337 <Private>False</Private> 338 </ProjectReference> 339 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 340 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> 341 <Name>HeuristicLab.Core.Views-3.3</Name> 342 <Private>False</Private> 343 </ProjectReference> 344 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 345 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 346 <Name>HeuristicLab.Core-3.3</Name> 347 <Private>False</Private> 348 </ProjectReference> 349 <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj"> 350 <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project> 351 <Name>HeuristicLab.Data.Views-3.3</Name> 352 <Private>False</Private> 353 </ProjectReference> 354 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 355 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 356 <Name>HeuristicLab.Data-3.3</Name> 357 <Private>False</Private> 358 </ProjectReference> 359 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 360 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> 361 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name> 362 <Private>False</Private> 363 </ProjectReference> 364 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 365 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> 366 <Name>HeuristicLab.MainForm-3.3</Name> 367 <Private>False</Private> 368 </ProjectReference> 369 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 370 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 371 <Name>HeuristicLab.Optimization-3.3</Name> 372 <Private>False</Private> 373 </ProjectReference> 374 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 375 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 376 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 377 <Private>False</Private> 378 </ProjectReference> 379 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances.Views\3.3\HeuristicLab.Problems.Instances.Views-3.3.csproj"> 380 <Project>{B1BA398F-953F-4C3A-B07B-1E5E17A27DD9}</Project> 381 <Name>HeuristicLab.Problems.Instances.Views-3.3</Name> 382 <Private>False</Private> 383 </ProjectReference> 384 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 385 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 386 <Name>HeuristicLab.Problems.Instances-3.3</Name> 387 <Private>False</Private> 388 </ProjectReference> 389 <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj"> 390 <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project> 391 <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name> 392 <Private>False</Private> 393 </ProjectReference> 394 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 395 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 396 <Name>HeuristicLab.Analysis-3.3</Name> 397 <Private>False</Private> 398 </ProjectReference> 383 <EmbeddedResource Include="RunCollectionViews\RunCollectionDataTableView.resx"> 384 <DependentUpon>RunCollectionDataTableView.cs</DependentUpon> 385 </EmbeddedResource> 399 386 </ItemGroup> 400 387 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs
r7967 r9240 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea 2= new System.Windows.Forms.DataVisualization.Charting.ChartArea();49 System.Windows.Forms.DataVisualization.Charting.Series series 2= new System.Windows.Forms.DataVisualization.Charting.Series();48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 49 System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 50 50 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionBubbleChartView)); 51 51 this.yJitterLabel = new System.Windows.Forms.Label(); … … 72 72 this.noRunsLabel = new System.Windows.Forms.Label(); 73 73 this.sizeTrackBar = new System.Windows.Forms.TrackBar(); 74 this.getDataAsMatrixToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 74 75 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit(); 75 76 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit(); … … 188 189 // 189 190 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 190 191 192 chartArea 2.Name = "ChartArea1";193 this.chart.ChartAreas.Add(chartArea 2);191 | System.Windows.Forms.AnchorStyles.Left) 192 | System.Windows.Forms.AnchorStyles.Right))); 193 chartArea1.Name = "ChartArea1"; 194 this.chart.ChartAreas.Add(chartArea1); 194 195 this.chart.Location = new System.Drawing.Point(6, 30); 195 196 this.chart.Name = "chart"; 196 series 2.ChartArea = "ChartArea1";197 series 2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;198 series 2.IsVisibleInLegend = false;199 series 2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;200 series 2.Name = "Bubbles";201 series 2.YValuesPerPoint = 2;202 this.chart.Series.Add(series 2);197 series1.ChartArea = "ChartArea1"; 198 series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; 199 series1.IsVisibleInLegend = false; 200 series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; 201 series1.Name = "Bubbles"; 202 series1.YValuesPerPoint = 2; 203 this.chart.Series.Add(series1); 203 204 this.chart.Size = new System.Drawing.Size(843, 425); 204 205 this.chart.TabIndex = 16; … … 215 216 this.openBoxPlotViewToolStripMenuItem.Text = "Open BoxPlot View"; 216 217 this.openBoxPlotViewToolStripMenuItem.Click += new System.EventHandler(this.openBoxPlotViewToolStripMenuItem_Click); 217 // 218 // 218 219 // hideRunToolStripMenuItem 219 // 220 // 220 221 this.hideRunToolStripMenuItem.Name = "hideRunToolStripMenuItem"; 221 222 this.hideRunToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 222 223 this.hideRunToolStripMenuItem.Text = "Hide Run"; 223 this.hideRunToolStripMenuItem.Click += new System.EventHandler( hideRunToolStripMenuItem_Click);224 this.hideRunToolStripMenuItem.Click += new System.EventHandler(this.hideRunToolStripMenuItem_Click); 224 225 // 225 226 // zoomButton … … 325 326 this.sizeTrackBar.Value = 10; 326 327 this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged); 328 // 329 // ToolStripMenuItem 330 // 331 this.getDataAsMatrixToolStripMenuItem.Name = "getDataAsMatrixToolStripMenuItem"; 332 this.getDataAsMatrixToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 333 this.getDataAsMatrixToolStripMenuItem.Text = "Get Data as Matrix"; 334 this.getDataAsMatrixToolStripMenuItem.Click += new System.EventHandler(this.getDataAsMatrixToolStripMenuItem_Click); 327 335 // 328 336 // RunCollectionBubbleChartView … … 386 394 private System.Windows.Forms.Button colorYAxisButton; 387 395 private System.Windows.Forms.TrackBar sizeTrackBar; 396 private System.Windows.Forms.ToolStripMenuItem getDataAsMatrixToolStripMenuItem; 388 397 } 389 398 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r9068 r9240 20 20 #endregion 21 21 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.MainForm; 26 using HeuristicLab.MainForm.WindowsForms; 22 27 using System; 23 28 using System.Collections.Generic; … … 26 31 using System.Windows.Forms; 27 32 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Common;29 using HeuristicLab.Core;30 using HeuristicLab.Data;31 using HeuristicLab.MainForm;32 using HeuristicLab.MainForm.WindowsForms;33 33 34 34 namespace HeuristicLab.Optimization.Views { … … 58 58 chart.ContextMenuStrip.Items.Insert(0, hideRunToolStripMenuItem); 59 59 chart.ContextMenuStrip.Items.Insert(1, openBoxPlotViewToolStripMenuItem); 60 chart.ContextMenuStrip.Items.Add(getDataAsMatrixToolStripMenuItem); 60 61 chart.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening); 61 62 … … 688 689 boxplotView.Show(); 689 690 } 691 692 private void getDataAsMatrixToolStripMenuItem_Click(object sender, EventArgs e) { 693 int xCol = Matrix.ColumnNames.ToList().IndexOf(xAxisValue); 694 var grouped = new Dictionary<string, List<string>>(); 695 Dictionary<double, string> reverseMapping = null; 696 if (categoricalMapping.ContainsKey(xCol)) 697 reverseMapping = categoricalMapping[xCol].ToDictionary(x => x.Value, y => y.Key.ToString()); 698 foreach (var run in Content.Where(r => r.Visible)) { 699 var x = GetValue(run, xAxisValue); 700 var y = GetValue(run, yAxisValue); 701 if (!(x.HasValue && y.HasValue)) continue; 702 703 var category = reverseMapping == null ? x.Value.ToString() : reverseMapping[x.Value]; 704 if (!grouped.ContainsKey(category)) grouped[category] = new List<string>(); 705 grouped[category].Add(y.Value.ToString()); 706 } 707 708 if (!grouped.Any()) return; 709 var matrix = new StringMatrix(grouped.Values.Max(x => x.Count), grouped.Count) { 710 ColumnNames = grouped.Keys.ToArray() 711 }; 712 int i = 0; 713 foreach (var col in matrix.ColumnNames) { 714 int j = 0; 715 foreach (var y in grouped[col]) 716 matrix[j++, i] = y; 717 i++; 718 } 719 720 MainFormManager.MainForm.ShowContent(matrix); 721 } 690 722 #endregion 691 723 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.Designer.cs
r8925 r9240 49 49 this.label2 = new System.Windows.Forms.Label(); 50 50 this.dataRowComboBox = new System.Windows.Forms.ComboBox(); 51 this.meanButton = new System.Windows.Forms.Button(); 51 52 this.SuspendLayout(); 52 53 // 53 54 // dataTableComboBox 54 55 // 55 this.dataTableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)56 | System.Windows.Forms.AnchorStyles.Right)));57 56 this.dataTableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 58 57 this.dataTableComboBox.FormattingEnabled = true; 59 58 this.dataTableComboBox.Location = new System.Drawing.Point(69, 3); 60 59 this.dataTableComboBox.Name = "dataTableComboBox"; 61 this.dataTableComboBox.Size = new System.Drawing.Size( 455, 21);60 this.dataTableComboBox.Size = new System.Drawing.Size(360, 21); 62 61 this.dataTableComboBox.TabIndex = 0; 63 62 this.dataTableComboBox.SelectedIndexChanged += new System.EventHandler(this.dataTableComboBox_SelectedIndexChanged); … … 74 73 // viewHost 75 74 // 76 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 77 | System.Windows.Forms.AnchorStyles.Left) 75 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 76 | System.Windows.Forms.AnchorStyles.Left) 78 77 | System.Windows.Forms.AnchorStyles.Right))); 79 78 this.viewHost.Caption = "View"; … … 99 98 // dataRowComboBox 100 99 // 101 this.dataRowComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)102 | System.Windows.Forms.AnchorStyles.Right)));103 100 this.dataRowComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 104 101 this.dataRowComboBox.FormattingEnabled = true; 105 102 this.dataRowComboBox.Location = new System.Drawing.Point(69, 30); 106 103 this.dataRowComboBox.Name = "dataRowComboBox"; 107 this.dataRowComboBox.Size = new System.Drawing.Size( 455, 21);104 this.dataRowComboBox.Size = new System.Drawing.Size(360, 21); 108 105 this.dataRowComboBox.TabIndex = 4; 109 106 this.dataRowComboBox.SelectedIndexChanged += new System.EventHandler(this.dataRowComboBox_SelectedIndexChanged); 110 107 // 108 // meanButton 109 // 110 this.meanButton.Location = new System.Drawing.Point(436, 3); 111 this.meanButton.Name = "meanButton"; 112 this.meanButton.Size = new System.Drawing.Size(88, 48); 113 this.meanButton.TabIndex = 5; 114 this.meanButton.Text = "Compute Mean"; 115 this.meanButton.UseVisualStyleBackColor = true; 116 this.meanButton.Click += new System.EventHandler(this.meanButton_Click); 117 // 111 118 // RunCollectionDataTableView 112 119 // 113 this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);114 120 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 121 this.Controls.Add(this.meanButton); 115 122 this.Controls.Add(this.dataRowComboBox); 116 123 this.Controls.Add(this.label2); … … 132 139 private System.Windows.Forms.Label label2; 133 140 private System.Windows.Forms.ComboBox dataRowComboBox; 141 private System.Windows.Forms.Button meanButton; 134 142 } 135 143 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs
r8962 r9240 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 25 26 using System.Windows.Forms; 26 27 using HeuristicLab.Analysis; … … 226 227 } 227 228 private void dataRowComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { 229 CombinedDataTable.Rows.Clear(); // to also clear the mean values row 228 230 RebuildCombinedDataTable(); 231 } 232 233 private void meanButton_Click(object sender, EventArgs e) { 234 var caption = (string)dataRowComboBox.SelectedItem + " Mean Values"; 235 236 var rows = combinedDataTable.Rows.ToList(); 237 238 if (combinedDataTable.Rows.ContainsKey(caption)) 239 combinedDataTable.Rows.Remove(caption); 240 241 // add an additional data row with the mean values 242 int maxCount = combinedDataTable.Rows.Max(row => row.Values.Count); 243 int rowCount = combinedDataTable.Rows.Count; 244 var meanValues = new List<double>(); 245 246 for (int i = 0; i != maxCount; ++i) { 247 double mean = 0; 248 for (int j = 0; j != rowCount; ++j) { 249 mean += i < rows[j].Values.Count ? rows[j].Values[i] : 0; 250 } 251 meanValues.Add(mean / rowCount); 252 } 253 254 combinedDataTable.Rows.Add(new DataRow(caption)); 255 combinedDataTable.Rows[caption].Values.AddRange(meanValues); 256 var sb = new StringBuilder(); 257 foreach (var val in meanValues) 258 sb.AppendLine(val.ToString()); 259 Clipboard.SetText(sb.ToString()); 229 260 } 230 261 }
Note: See TracChangeset
for help on using the changeset viewer.