Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/14 15:31:48 (10 years ago)
Author:
rstoll
Message:
  • StatisticsView values added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/StatisticsView.cs

    r10371 r10374  
    1313
    1414    private List<List<string>> columnsRowsMatrix;
    15     private readonly int COLUMNS = 5;
     15    private readonly int COLUMNS = 10;
    1616
    1717    public new StatisticsContent Content {
     
    4545      txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString();
    4646
    47       DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS];
    48 
    4947      columnsRowsMatrix = new List<List<string>>();
    50 
    51 
    52       for (int i = 0; i < logic.GetColumnCount(); ++i) {
     48      DataGridViewColumn[] columns = new DataGridViewColumn[10];
     49      for (int i = 0; i < COLUMNS; ++i) {
    5350        var column = new DataGridViewTextBoxColumn();
    5451        column.FillWeight = 1;
    5552        columns[i] = column;
     53      }
    5654
     55      for (int i = 0; i < logic.GetColumnCount(); ++i) {
    5756        List<string> list;
    5857        if (logic.IsType<double>(i)) {
     
    6564          list = new List<string>();
    6665          for (int j = 0; j < COLUMNS; ++j) {
    67             list.Add("");
     66            list.Add("unknown column type");
    6867          }
    6968        }
     
    9493
    9594    private List<string> GetStringColumns(int columnIndex) {
    96       return null;
     95      var logic = Content.StatisticsLogic;
     96      return new List<string> {
     97        logic.GetColumnTypeAsString(columnIndex),
     98        logic.GetMissingValueCount(columnIndex).ToString(),
     99        "", //min
     100        "", //max
     101        "", //median
     102        "", //average
     103        "", //standard deviation
     104        "", //variance
     105        logic.GetMostCommonValue<string>(columnIndex).ToString(),
     106        logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     107      };
    97108    }
    98     private List<string> GetDateTimeColumns(int columndIndex) {
    99       return null;
     109
     110    private List<string> GetDateTimeColumns(int columnIndex) {
     111      var logic = Content.StatisticsLogic;
     112      return new List<string> {
     113        logic.GetColumnTypeAsString(columnIndex),
     114        logic.GetMissingValueCount(columnIndex).ToString(),
     115        logic.GetMin<DateTime>(columnIndex).ToString(),
     116        logic.GetMax<DateTime>(columnIndex).ToString(),
     117        "", //median
     118        "", //average
     119        "", //standard deviation
     120        "", //variance
     121        logic.GetMostCommonValue<string>(columnIndex).ToString(),
     122        logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     123      };
    100124    }
    101125
     
    106130    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    107131      if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < Content.StatisticsLogic.GetColumnCount()) {
    108 
     132        dataGridView[e.ColumnIndex, e.RowIndex].Value = columnsRowsMatrix[e.ColumnIndex][e.RowIndex];
    109133      }
    110134    }
Note: See TracChangeset for help on using the changeset viewer.