Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/14 14:33:36 (11 years ago)
Author:
rstoll
Message:
  • Renamed PreprocessingDataManipulation to ManipulationLogic
  • Proceeded with StatisticsView
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10367 r10369  
    7979    <Compile Include="Implementations\DataGridLogic.cs" />
    8080    <Compile Include="Interfaces\IDataGridLogic.cs" />
    81     <Compile Include="Interfaces\IPreprocessingDataManipulation.cs" />
     81    <Compile Include="Interfaces\IManipulationLogic.cs" />
    8282    <Compile Include="Implementations\FilterContent.cs" />
    8383    <Compile Include="Implementations\DataPreprocessorStarter.cs" />
     
    135135    <Compile Include="Implementations\PreprocessingContext.cs" />
    136136    <Compile Include="Implementations\PreprocessingData.cs" />
    137     <Compile Include="Implementations\PreprocessingDataManipulation.cs" />
     137    <Compile Include="Implementations\ManipulationLogic.cs" />
    138138    <Compile Include="Implementations\SearchLogic.cs" />
    139139    <Compile Include="Implementations\StatisticsLogic.cs" />
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs

    r10313 r10369  
    1111
    1212    private readonly IDataGridLogic dataGridLogic;
    13     private readonly IPreprocessingDataManipulation preprocessingDataManipulation;
    14     public DataGridContent(IDataGridLogic theDataGridLogic, IPreprocessingDataManipulation thePreprocessingDataManipulation) {
     13    private readonly IManipulationLogic preprocessingDataManipulation;
     14    public DataGridContent(IDataGridLogic theDataGridLogic, IManipulationLogic thePreprocessingDataManipulation) {
    1515      dataGridLogic = theDataGridLogic;
    1616      preprocessingDataManipulation = thePreprocessingDataManipulation;
     
    2121    }
    2222
    23     public IPreprocessingDataManipulation PreprocessingDataManipulation {
     23    public IManipulationLogic PreprocessingDataManipulation {
    2424      get { return preprocessingDataManipulation; }
    2525    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs

    r10367 r10369  
    55
    66namespace HeuristicLab.DataPreprocessing {
    7   public class PreprocessingDataManipulation : IPreprocessingDataManipulation {
     7  public class ManipulationLogic : IManipulationLogic {
    88    private IPreprocessingData preprocessingData;
    99    private IStatisticsLogic statisticInfo;
    1010    private ISearchLogic searchLogic;
    1111
    12     public PreprocessingDataManipulation(IPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) {
     12    public ManipulationLogic(IPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) {
    1313      preprocessingData = _prepocessingData;
    1414      searchLogic = theSearchLogic;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs

    r10367 r10369  
    2525    public int GetNumericColumnCount() {
    2626      int count = 0;
    27       foreach (var variableName in preprocessingData.VariableNames) {
    28         if (preprocessingData.IsType<double>(variableName)) {
     27
     28      for (int i = 0; i < preprocessingData.Columns; ++i) {
     29        if (preprocessingData.IsType<double>(i)) {
    2930          ++count;
    3031        }
     
    3940    public int GetMissingValueCount() {
    4041      int count = 0;
    41       for(int i = 0; i < preprocessingData.Columns; ++i){
     42      for (int i = 0; i < preprocessingData.Columns; ++i) {
    4243        count += GetMissingValueCount(i);
    4344      }
     
    104105    public int GetRowMissingValueCount(int rowIndex) {
    105106      int count = 0;
    106        for(int i = 0; i < preprocessingData.Columns; ++i){
     107      for (int i = 0; i < preprocessingData.Columns; ++i) {
    107108        if (searchLogic.IsMissingValue(i, rowIndex)) {
    108109          ++count;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs

    r10253 r10369  
    88  public interface IDataGridContent : IStringConvertibleMatrix {
    99    IDataGridLogic DataGridLogic { get; }
    10     IPreprocessingDataManipulation PreprocessingDataManipulation { get; }
     10    IManipulationLogic PreprocessingDataManipulation { get; }
    1111  }
    1212}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridLogic.cs

    r10367 r10369  
    33  public interface IDataGridLogic {
    44    IEnumerable<string> ColumnNames { get; }
    5     string GetColumnTypeAsString(int columnIndex);
    65    IEnumerable<string> RowNames { get; }
    76    int Columns { get; }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs

    r10367 r10369  
    22using System.Collections.Generic;
    33namespace HeuristicLab.DataPreprocessing {
    4   public interface IPreprocessingDataManipulation {
     4  public interface IManipulationLogic {
    55    void reOrderToIndices(IEnumerable<int> indices);
    66    void reOrderToIndices(IList<Tuple<int, int>> indices);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs

    r10367 r10369  
    1919    double GetVariance(int columnIndex);
    2020    int GetDifferentValuesCount<T>(int columnIndex);
     21
    2122    bool IsType<T>(int columnIndex);
     23    string GetColumnTypeAsString(int columnIndex);
    2224  }
    2325}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs

    r10367 r10369  
    4646      ISearchLogic searchLogic = new SearchLogic(data);
    4747      var dataGridLogic = new DataGridLogic(data);
    48       dataGridContent = new DataGridContent(dataGridLogic, new PreprocessingDataManipulation(data, searchLogic, new StatisticsLogic(data, searchLogic)));
     48      dataGridContent = new DataGridContent(dataGridLogic, new ManipulationLogic(data, searchLogic, new StatisticsLogic(data, searchLogic)));
    4949      statisticsContent = new StatisticsContent(new StatisticsLogic(data, searchLogic), dataGridLogic);
    5050      filterContent = new FilterContent(new FilterLogic());
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/StatisticsView.cs

    r10320 r10369  
    1 using System.Windows.Forms;
     1using System;
     2using System.Collections.Generic;
     3using System.Windows.Forms;
    24using HeuristicLab.Core.Views;
    35using HeuristicLab.MainForm;
     
    911  [Content(typeof(StatisticsContent), false)]
    1012  public partial class StatisticsView : ItemView {
     13
     14    private List<List<string>> columnsRowsMatrix;
     15    private readonly int COLUMNS = 5;
    1116
    1217    public new StatisticsContent Content {
     
    2126    protected override void OnContentChanged() {
    2227      base.OnContentChanged();
    23       if (Content != null) {
    24         var logic = Content.StatisticsLogic;
    25         txtRows.Text = logic.GetRowCount().ToString();
    26         txtColumns.Text = logic.GetColumnCount().ToString();
    27         txtNumericColumns.Text = logic.GetNumericColumnCount().ToString();
    28         txtNominalColumns.Text = logic.GetNominalColumnCount().ToString();
    29         txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString();
     28      if (Content == null) {
     29        txtRows.Text = "";
     30        txtColumns.Text = "";
     31        txtNumericColumns.Text = "";
     32        txtNominalColumns.Text = "";
     33        txtMissingValuesTotal.Text = "";
     34        dataGridView.Columns.Clear();
     35      } else {
     36        UpdateData();
     37      }
     38    }
     39    private void UpdateData() {
     40      var statisticsLogic = Content.StatisticsLogic;
     41      var dataGridLogic = Content.DataDridLogic;
     42      txtRows.Text = statisticsLogic.GetRowCount().ToString();
     43      txtColumns.Text = statisticsLogic.GetColumnCount().ToString();
     44      txtNumericColumns.Text = statisticsLogic.GetNumericColumnCount().ToString();
     45      txtNominalColumns.Text = statisticsLogic.GetNominalColumnCount().ToString();
     46      txtMissingValuesTotal.Text = statisticsLogic.GetMissingValueCount().ToString();
     47
     48      DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS];
     49
     50      columnsRowsMatrix = new List<List<string>>();
     51
     52
     53      for (int i = 0; i < Content.DataDridLogic.Columns; ++i) {
     54        var column = new DataGridViewTextBoxColumn();
     55        column.FillWeight = 1;
     56        columns[i] = column;
     57
     58        List<string> list;
     59        if (statisticsLogic.IsType<double>(i)) {
     60          list = GetDoubleColumns(i);
     61        } else if (statisticsLogic.IsType<string>(i)) {
     62          list = GetStringColumns(i);
     63        } else if (statisticsLogic.IsType<DateTime>(i)) {
     64          list = GetDateTimeColumns(i);
     65        } else {
     66          list = new List<string>();
     67        }
     68        columnsRowsMatrix.Add(list);
     69      }
     70
     71      dataGridView.Columns.Clear();
     72      dataGridView.Columns.AddRange(columns);
     73      dataGridView.RowCount = columnsRowsMatrix[0].Count;
     74
     75    }
     76
     77    private List<string> GetDoubleColumns(int columnIndex) {
     78      var logic = Content.StatisticsLogic;
     79      return new List<string> {
     80        //logic.GetColumnTypeAsString(columnIndex),
     81        //logic.GetMissingValueCount(columnIndex).tostring(),
     82        //logic.GetMin<double>(columnIndex),
     83        //logic.GetMax<double>(columnIndex),
     84        //logic.getmedian(columnIndex),
     85        //logic.getaverage(columnIndex),
     86        //logic.-(columnIndex),
     87      };
     88    }
     89
     90    private List<string> GetStringColumns(int columnIndex) {
     91      return null;
     92    }
     93    private List<string> GetDateTimeColumns(int columndIndex) {
     94      return null;
     95    }
     96
     97    private List<string> GetDoubleColums(int i) {
     98      throw new NotImplementedException();
     99    }
     100
     101    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
     102      if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < Content.DataDridLogic.Columns) {
     103
    30104      }
    31105    }
Note: See TracChangeset for help on using the changeset viewer.