Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/12 12:04:35 (12 years ago)
Author:
bburlacu
Message:

#1890: Added License Information to files that didn't include it.

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.Designer.cs

    r7980 r8924  
    4949      this.label2 = new System.Windows.Forms.Label();
    5050      this.dataRowComboBox = new System.Windows.Forms.ComboBox();
     51      this.label3 = new System.Windows.Forms.Label();
     52      this.groupByComboBox = new System.Windows.Forms.ComboBox();
    5153      this.SuspendLayout();
    5254      //
    5355      // dataTableComboBox
    5456      //
    55       this.dataTableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     57      this.dataTableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    5658            | System.Windows.Forms.AnchorStyles.Right)));
    5759      this.dataTableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    7476      // viewHost
    7577      //
    76       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    77             | System.Windows.Forms.AnchorStyles.Left)
     78      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     79            | System.Windows.Forms.AnchorStyles.Left) 
    7880            | System.Windows.Forms.AnchorStyles.Right)));
    7981      this.viewHost.Caption = "View";
     
    99101      // dataRowComboBox
    100102      //
    101       this.dataRowComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     103      this.dataRowComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    102104            | System.Windows.Forms.AnchorStyles.Right)));
    103105      this.dataRowComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    109111      this.dataRowComboBox.SelectedIndexChanged += new System.EventHandler(this.dataRowComboBox_SelectedIndexChanged);
    110112      //
     113      // label3
     114      //
     115      this.label3.AutoSize = true;
     116      this.label3.Location = new System.Drawing.Point(3, 61);
     117      this.label3.Name = "label3";
     118      this.label3.Size = new System.Drawing.Size(53, 13);
     119      this.label3.TabIndex = 5;
     120      this.label3.Text = "Grouping:";
     121      //
     122      // groupByComboBox
     123      //
     124      this.groupByComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     125            | System.Windows.Forms.AnchorStyles.Right)));
     126      this.groupByComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     127      this.groupByComboBox.FormattingEnabled = true;
     128      this.groupByComboBox.Items.AddRange(new object[] {
     129            "None",
     130            "Same runs",
     131            "All"});
     132      this.groupByComboBox.Location = new System.Drawing.Point(69, 58);
     133      this.groupByComboBox.Name = "groupByComboBox";
     134      this.groupByComboBox.Size = new System.Drawing.Size(455, 21);
     135      this.groupByComboBox.TabIndex = 6;
     136      this.groupByComboBox.SelectedIndexChanged += new System.EventHandler(this.groupByComboBox_SelectedIndexChanged);
     137      //
    111138      // RunCollectionDataTableView
    112139      //
    113       this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
    114140      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     141      this.Controls.Add(this.groupByComboBox);
     142      this.Controls.Add(this.label3);
    115143      this.Controls.Add(this.dataRowComboBox);
    116144      this.Controls.Add(this.label2);
     
    132160    private System.Windows.Forms.Label label2;
    133161    private System.Windows.Forms.ComboBox dataRowComboBox;
     162    private System.Windows.Forms.Label label3;
     163    private System.Windows.Forms.ComboBox groupByComboBox;
    134164  }
    135165}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs

    r8738 r8924  
    220220      dataRowComboBox.Items.Add(AllDataRows);
    221221      if (dataRowComboBox.Items.Count > 0) dataRowComboBox.SelectedItem = dataRowComboBox.Items[0];
     222      groupByComboBox.SelectedItem = groupByComboBox.Items[0];
    222223    }
    223224
     
    226227    }
    227228    private void dataRowComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
    228       RebuildCombinedDataTable();
     229      //      RebuildCombinedDataTable();
     230      groupByComboBox_SelectedIndexChanged(sender, e);
     231    }
     232    private void groupByComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
     233      var resultName = (string)dataTableComboBox.SelectedItem;
     234      var groupByCriteriaName = (string)groupByComboBox.SelectedItem;
     235      switch (groupByCriteriaName) {
     236        case ("None"): {
     237            combinedDataTable.Rows.Clear();
     238            RebuildCombinedDataTable();
     239            break;
     240          }
     241        case ("Same runs"): {
     242            var rowName = (string)dataRowComboBox.SelectedItem;
     243            var runGroups = Content.GroupBy(r => r.Algorithm);
     244            combinedDataTable.Rows.Clear();
     245            foreach (var g in runGroups) {
     246              var dataTable = g.Select(r => r.Results[resultName] as DataTable);
     247              var rows = dataTable.SelectMany(d => d.Rows.Where(row => row.Name == rowName)).ToList();
     248              var avgRow = new DataRow { VisualProperties = { StartIndexZero = true }, Name = resultName + "." + rowName };
     249              var min = rows.Min(r => r.Values.Count);
     250              for (int i = 0; i != min; ++i) {
     251                avgRow.Values.Add(rows.Average(r => r.Values[i]));
     252              }
     253              combinedDataTable.Rows.Add(avgRow);
     254            }
     255            break;
     256          }
     257        case ("All"): {
     258            var rowName = (string)dataRowComboBox.SelectedItem;
     259            RebuildCombinedDataTable();
     260            var rows = combinedDataTable.Rows;
     261            var avgRow = new DataRow { VisualProperties = { StartIndexZero = true }, Name = resultName + "." + rowName };
     262            var min = rows.Min(r => r.Values.Count);
     263            for (int i = 0; i != min; ++i) {
     264              avgRow.Values.Add(rows.Average(r => r.Values[i]));
     265            }
     266            combinedDataTable.Rows.Clear();
     267            combinedDataTable.Rows.Add(avgRow);
     268            break;
     269          }
     270      }
    229271    }
    230272  }
Note: See TracChangeset for help on using the changeset viewer.