Changeset 9937
- Timestamp:
- 09/05/13 13:28:34 (11 years ago)
- Location:
- branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/HeuristicLab.Analysis.Statistics-3.3.csproj
r9917 r9937 47 47 </Reference> 48 48 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 49 <Private>False</Private> 50 </Reference> 51 <Reference Include="HeuristicLab.Analysis.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 52 <SpecificVersion>False</SpecificVersion> 53 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis.Views-3.3.dll</HintPath> 49 54 <Private>False</Private> 50 55 </Reference> -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.cs
r9936 r9937 25 25 using System.Threading.Tasks; 26 26 using System.Windows.Forms; 27 using HeuristicLab.Collections; 27 28 using HeuristicLab.Core.Views; 28 29 using HeuristicLab.Data; … … 70 71 protected override void RegisterContentEvents() { 71 72 base.RegisterContentEvents(); 72 Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);73 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);74 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);73 Content.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); 74 Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 75 Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 75 76 Content.UpdateOfRunsInProgressChanged += Content_UpdateOfRunsInProgressChanged; 76 77 } … … 78 79 protected override void DeregisterContentEvents() { 79 80 base.DeregisterContentEvents(); 80 Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);81 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);82 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);81 Content.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); 82 Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 83 Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 83 84 Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged; 84 85 } 85 86 86 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {87 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 87 88 RebuildDataTable(); 88 89 } 89 90 90 private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {91 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 91 92 RebuildDataTable(); 92 93 } 93 94 94 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {95 private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) { 95 96 RebuildDataTable(); 96 97 } … … 186 187 DoubleMatrix dt = new DoubleMatrix(groups.Select(x => x.Count()).Max(), columnNames.Count()); 187 188 dt.ColumnNames = columnNames; 188 189 int i = 0; 190 int j = 0; 191 foreach (string columnName in columnNames) { 192 j = 0; 189 DataTable histogramDataTable = new DataTable(resultName); 190 191 for (int i = 0; i < columnNames.Count(); i++) { 192 int j = 0; 193 193 data[i] = new double[groups[i].Count()]; 194 DataRow row = new DataRow(columnNames[i]); 195 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 196 histogramDataTable.Rows.Add(row); 197 194 198 foreach (IRun run in groups[i]) { 195 199 dt[j, i] = (double)((dynamic)run.Results[resultName]).Value; 196 200 data[i][j] = dt[j, i]; 201 row.Values.Add(dt[j, i]); 197 202 j++; 198 203 } 199 i++;200 } 201 204 } 205 206 dataTableView.Content = histogramDataTable; 202 207 stringConvertibleMatrixView.Content = dt; 203 208 } … … 237 242 } 238 243 244 private bool VerifyDataLength(bool showMessage) { 245 if (data == null || data.Length == 0) 246 return false; 247 248 //alglib needs at least 5 samples for computation 249 if (data.Any(x => x.Length <= 5)) { 250 if (showMessage) 251 MessageBox.Show(this, "You need to choose samples with a size greater 5.", "HeuristicLab", MessageBoxButtons.OK, 252 MessageBoxIcon.Error); 253 return false; 254 } 255 return true; 256 } 257 239 258 private void CalculateValues() { 259 if (!VerifyDataLength(true)) 260 return; 261 240 262 if (data != null) { 241 263 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>() … … 258 280 259 281 private void CalculatePairwise(string groupName) { 282 if (!VerifyDataLength(false)) 283 return; 284 260 285 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating..."); 261 286 Task.Factory.StartNew(() => CalculatePairwiseAsync(groupName)); -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.designer.cs
r9936 r9937 71 71 this.normalityLabel = new System.Windows.Forms.Label(); 72 72 this.selectDataGroupBox = new System.Windows.Forms.GroupBox(); 73 this.tabControl = new System.Windows.Forms.TabControl(); 74 this.tabPage1 = new System.Windows.Forms.TabPage(); 75 this.tabPage2 = new System.Windows.Forms.TabPage(); 76 this.dataTableView = new HeuristicLab.Analysis.Views.DataTableView(); 73 77 this.contextMenuStrip1.SuspendLayout(); 74 78 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); … … 84 88 this.normalityGroupBox.SuspendLayout(); 85 89 this.selectDataGroupBox.SuspendLayout(); 90 this.tabControl.SuspendLayout(); 91 this.tabPage1.SuspendLayout(); 92 this.tabPage2.SuspendLayout(); 86 93 this.SuspendLayout(); 87 94 // … … 99 106 this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = false; 100 107 this.stringConvertibleMatrixView.ShowStatisticalInformation = true; 101 this.stringConvertibleMatrixView.Size = new System.Drawing.Size( 674, 534);108 this.stringConvertibleMatrixView.Size = new System.Drawing.Size(567, 523); 102 109 this.stringConvertibleMatrixView.TabIndex = 0; 103 110 // … … 145 152 this.resultComboBox.Location = new System.Drawing.Point(62, 3); 146 153 this.resultComboBox.Name = "resultComboBox"; 147 this.resultComboBox.Size = new System.Drawing.Size( 311, 21);154 this.resultComboBox.Size = new System.Drawing.Size(250, 21); 148 155 this.resultComboBox.TabIndex = 5; 149 156 this.resultComboBox.SelectedValueChanged += new System.EventHandler(this.resultComboBox_SelectedValueChanged); … … 168 175 this.pValTextBox.Name = "pValTextBox"; 169 176 this.pValTextBox.ReadOnly = true; 170 this.pValTextBox.Size = new System.Drawing.Size( 302, 20);177 this.pValTextBox.Size = new System.Drawing.Size(241, 20); 171 178 this.pValTextBox.TabIndex = 13; 172 179 // … … 180 187 this.groupComboBox.Location = new System.Drawing.Point(62, 3); 181 188 this.groupComboBox.Name = "groupComboBox"; 182 this.groupComboBox.Size = new System.Drawing.Size( 311, 21);189 this.groupComboBox.Size = new System.Drawing.Size(250, 21); 183 190 this.groupComboBox.TabIndex = 14; 184 191 this.groupComboBox.SelectedValueChanged += new System.EventHandler(this.groupComboBox_SelectedValueChanged); … … 202 209 this.splitContainer1.Panel2.Controls.Add(this.groupByLabel); 203 210 this.splitContainer1.Panel2.Controls.Add(this.groupComboBox); 204 this.splitContainer1.Size = new System.Drawing.Size(3 76, 54);211 this.splitContainer1.Size = new System.Drawing.Size(315, 54); 205 212 this.splitContainer1.SplitterDistance = 25; 206 213 this.splitContainer1.TabIndex = 18; … … 211 218 | System.Windows.Forms.AnchorStyles.Left) 212 219 | System.Windows.Forms.AnchorStyles.Right))); 213 this.splitContainer3.Location = new System.Drawing.Point( 8, 3);220 this.splitContainer3.Location = new System.Drawing.Point(6, 6); 214 221 this.splitContainer3.Name = "splitContainer3"; 215 222 // … … 224 231 this.splitContainer3.Panel2.Controls.Add(this.normalityGroupBox); 225 232 this.splitContainer3.Panel2.Controls.Add(this.selectDataGroupBox); 226 this.splitContainer3.Size = new System.Drawing.Size( 1078, 540);227 this.splitContainer3.SplitterDistance = 680;233 this.splitContainer3.Size = new System.Drawing.Size(910, 529); 234 this.splitContainer3.SplitterDistance = 573; 228 235 this.splitContainer3.TabIndex = 20; 229 236 // … … 242 249 this.pairwiseTestGroupBox.Location = new System.Drawing.Point(3, 289); 243 250 this.pairwiseTestGroupBox.Name = "pairwiseTestGroupBox"; 244 this.pairwiseTestGroupBox.Size = new System.Drawing.Size(3 88, 229);251 this.pairwiseTestGroupBox.Size = new System.Drawing.Size(327, 218); 245 252 this.pairwiseTestGroupBox.TabIndex = 22; 246 253 this.pairwiseTestGroupBox.TabStop = false; … … 260 267 this.pairwiseStringConvertibleMatrixView.ShowRowsAndColumnsTextBox = false; 261 268 this.pairwiseStringConvertibleMatrixView.ShowStatisticalInformation = false; 262 this.pairwiseStringConvertibleMatrixView.Size = new System.Drawing.Size(3 76, 151);269 this.pairwiseStringConvertibleMatrixView.Size = new System.Drawing.Size(315, 140); 263 270 this.pairwiseStringConvertibleMatrixView.TabIndex = 19; 264 271 // … … 267 274 this.pairwiseLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 268 275 this.pairwiseLabel.AutoSize = true; 269 this.pairwiseLabel.Location = new System.Drawing.Point(3 66, 47);276 this.pairwiseLabel.Location = new System.Drawing.Point(305, 47); 270 277 this.pairwiseLabel.MaximumSize = new System.Drawing.Size(16, 16); 271 278 this.pairwiseLabel.MinimumSize = new System.Drawing.Size(16, 16); … … 293 300 this.equalDistsTextBox.Name = "equalDistsTextBox"; 294 301 this.equalDistsTextBox.ReadOnly = true; 295 this.equalDistsTextBox.Size = new System.Drawing.Size(2 74, 20);302 this.equalDistsTextBox.Size = new System.Drawing.Size(213, 20); 296 303 this.equalDistsTextBox.TabIndex = 18; 297 304 // … … 315 322 this.groupCompComboBox.Location = new System.Drawing.Point(123, 19); 316 323 this.groupCompComboBox.Name = "groupCompComboBox"; 317 this.groupCompComboBox.Size = new System.Drawing.Size( 259, 21);324 this.groupCompComboBox.Size = new System.Drawing.Size(198, 21); 318 325 this.groupCompComboBox.TabIndex = 17; 319 326 this.groupCompComboBox.SelectedValueChanged += new System.EventHandler(this.groupCompComboBox_SelectedValueChanged); … … 329 336 this.allGroupTestGroupBox.Location = new System.Drawing.Point(3, 237); 330 337 this.allGroupTestGroupBox.Name = "allGroupTestGroupBox"; 331 this.allGroupTestGroupBox.Size = new System.Drawing.Size(3 88, 46);338 this.allGroupTestGroupBox.Size = new System.Drawing.Size(327, 46); 332 339 this.allGroupTestGroupBox.TabIndex = 21; 333 340 this.allGroupTestGroupBox.TabStop = false; … … 338 345 this.groupCompLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 339 346 this.groupCompLabel.AutoSize = true; 340 this.groupCompLabel.Location = new System.Drawing.Point(3 66, 22);347 this.groupCompLabel.Location = new System.Drawing.Point(305, 22); 341 348 this.groupCompLabel.MaximumSize = new System.Drawing.Size(16, 16); 342 349 this.groupCompLabel.MinimumSize = new System.Drawing.Size(16, 16); … … 355 362 this.normalityGroupBox.Location = new System.Drawing.Point(3, 88); 356 363 this.normalityGroupBox.Name = "normalityGroupBox"; 357 this.normalityGroupBox.Size = new System.Drawing.Size(3 88, 143);364 this.normalityGroupBox.Size = new System.Drawing.Size(327, 143); 358 365 this.normalityGroupBox.TabIndex = 20; 359 366 this.normalityGroupBox.TabStop = false; … … 383 390 this.normalityStringConvertibleMatrixView.ShowRowsAndColumnsTextBox = false; 384 391 this.normalityStringConvertibleMatrixView.ShowStatisticalInformation = false; 385 this.normalityStringConvertibleMatrixView.Size = new System.Drawing.Size(3 73, 102);392 this.normalityStringConvertibleMatrixView.Size = new System.Drawing.Size(312, 102); 386 393 this.normalityStringConvertibleMatrixView.TabIndex = 17; 387 394 // … … 404 411 this.selectDataGroupBox.Location = new System.Drawing.Point(3, 3); 405 412 this.selectDataGroupBox.Name = "selectDataGroupBox"; 406 this.selectDataGroupBox.Size = new System.Drawing.Size(3 88, 79);413 this.selectDataGroupBox.Size = new System.Drawing.Size(327, 79); 407 414 this.selectDataGroupBox.TabIndex = 19; 408 415 this.selectDataGroupBox.TabStop = false; 409 416 this.selectDataGroupBox.Text = "1. Select Data"; 410 417 // 418 // tabControl 419 // 420 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 421 | System.Windows.Forms.AnchorStyles.Left) 422 | System.Windows.Forms.AnchorStyles.Right))); 423 this.tabControl.Controls.Add(this.tabPage1); 424 this.tabControl.Controls.Add(this.tabPage2); 425 this.tabControl.Location = new System.Drawing.Point(3, 3); 426 this.tabControl.Name = "tabControl"; 427 this.tabControl.SelectedIndex = 0; 428 this.tabControl.Size = new System.Drawing.Size(930, 567); 429 this.tabControl.TabIndex = 21; 430 // 431 // tabPage1 432 // 433 this.tabPage1.Controls.Add(this.splitContainer3); 434 this.tabPage1.Location = new System.Drawing.Point(4, 22); 435 this.tabPage1.Name = "tabPage1"; 436 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 437 this.tabPage1.Size = new System.Drawing.Size(922, 541); 438 this.tabPage1.TabIndex = 0; 439 this.tabPage1.Text = "Tests"; 440 this.tabPage1.UseVisualStyleBackColor = true; 441 // 442 // tabPage2 443 // 444 this.tabPage2.Controls.Add(this.dataTableView); 445 this.tabPage2.Location = new System.Drawing.Point(4, 22); 446 this.tabPage2.Name = "tabPage2"; 447 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 448 this.tabPage2.Size = new System.Drawing.Size(922, 541); 449 this.tabPage2.TabIndex = 1; 450 this.tabPage2.Text = "Histogram"; 451 this.tabPage2.UseVisualStyleBackColor = true; 452 // 453 // dataTableView 454 // 455 this.dataTableView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 456 | System.Windows.Forms.AnchorStyles.Left) 457 | System.Windows.Forms.AnchorStyles.Right))); 458 this.dataTableView.Caption = "DataTable View"; 459 this.dataTableView.Content = null; 460 this.dataTableView.Location = new System.Drawing.Point(6, 6); 461 this.dataTableView.Name = "dataTableView"; 462 this.dataTableView.ReadOnly = false; 463 this.dataTableView.Size = new System.Drawing.Size(910, 529); 464 this.dataTableView.TabIndex = 0; 465 // 411 466 // StatisticalTestingView 412 467 // 413 this.Controls.Add(this. splitContainer3);468 this.Controls.Add(this.tabControl); 414 469 this.Name = "StatisticalTestingView"; 415 this.Size = new System.Drawing.Size( 1089, 546);470 this.Size = new System.Drawing.Size(936, 573); 416 471 this.contextMenuStrip1.ResumeLayout(false); 417 472 this.splitContainer1.Panel1.ResumeLayout(false); … … 432 487 this.normalityGroupBox.PerformLayout(); 433 488 this.selectDataGroupBox.ResumeLayout(false); 489 this.tabControl.ResumeLayout(false); 490 this.tabPage1.ResumeLayout(false); 491 this.tabPage2.ResumeLayout(false); 434 492 this.ResumeLayout(false); 435 493 … … 462 520 private Data.Views.StringConvertibleMatrixView pairwiseStringConvertibleMatrixView; 463 521 private System.Windows.Forms.Label label4; 522 private System.Windows.Forms.TabControl tabControl; 523 private System.Windows.Forms.TabPage tabPage1; 524 private System.Windows.Forms.TabPage tabPage2; 525 private Views.DataTableView dataTableView; 464 526 } 465 527 } -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.resx
r9936 r9937 119 119 </resheader> 120 120 <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value> 133, 17</value>121 <value>28, 18</value> 122 122 </metadata> 123 123 <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 124 <value>5 4</value>124 <value>50</value> 125 125 </metadata> 126 126 </root>
Note: See TracChangeset
for help on using the changeset viewer.