Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/17 14:19:29 (7 years ago)
Author:
pfleck
Message:

#2809: Removed SearchLogic

Location:
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.cs

    r15110 r15269  
    5252
    5353    private void InitData() {
    54       IDictionary<int, IList<int>> missingValueIndices = Content.SearchLogic.GetMissingValueIndices();
    55 
    56       bool[,] valueMissing = new bool[Content.SearchLogic.Rows, Content.SearchLogic.Columns];
    57       foreach (var columnMissingValues in missingValueIndices) {
    58         var column = columnMissingValues.Key;
    59         foreach (var missingValueIndex in columnMissingValues.Value)
    60           valueMissing[missingValueIndex, column] = true;
     54      bool[,] valueMissing = new bool[Content.PreprocessingData.Rows, Content.PreprocessingData.Columns];
     55      for (int row = 0; row < Content.PreprocessingData.Rows; row++) {
     56        for (int column = 0; column < Content.PreprocessingData.Columns; column++)
     57          valueMissing[row, column] = Content.PreprocessingData.IsCellEmpty(column, row);
    6158      }
    6259
     
    7875      //custom x axis label
    7976      double from = 0.5;
    80       foreach (String columnName in Content.SearchLogic.VariableNames) {
     77      foreach (String columnName in Content.PreprocessingData.VariableNames) {
    8178        double to = from + 1;
    8279        chart.ChartAreas[0].AxisX.CustomLabels.Add(from, to, columnName);
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r15185 r15269  
    5050        var data = Content.Data;
    5151        var filterLogic = new FilterLogic(data);
    52         var searchLogic = new SearchLogic(data, filterLogic);
    53         var statisticsLogic = new StatisticsLogic(data, searchLogic);
    54         var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);
     52        var statisticsLogic = new StatisticsLogic(data);
     53        var manipulationLogic = new ManipulationLogic(data, statisticsLogic);
    5554
    5655        var viewShortcuts = new ItemList<IViewShortcut> {
     
    6362          new MultiScatterPlotContent(data),
    6463          new CorrelationMatrixContent(Content),
    65           new DataCompletenessChartContent(searchLogic),
     64          new DataCompletenessChartContent(data),
    6665
    6766          new FilterContent(filterLogic),
    68           new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
     67          new ManipulationContent(manipulationLogic, filterLogic),
    6968          new TransformationContent(data, filterLogic)
    7069        };
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs

    r15110 r15269  
    127127
    128128    private void ReplaceMissingValues() {
    129       var allIndices = Content.SearchLogic.GetMissingValueIndices();
     129      var missingValuesIndices = new List<int>();
    130130      var columnIndex = cmbVariableNames.SelectedIndex;
    131       var columnIndices = new Dictionary<int, IList<int>>{
    132           {columnIndex,   allIndices[columnIndex]}
    133       };
     131      var columnIndices = new Dictionary<int, IList<int>> { { columnIndex, missingValuesIndices } };
     132
     133      for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreProcessingData.Rows; rowIndex++)
     134        if (Content.ManipulationLogic.PreProcessingData.IsCellEmpty(columnIndex, rowIndex))
     135          missingValuesIndices.Add(rowIndex);
    134136
    135137      switch (cmbReplaceWith.SelectedIndex) {
     
    165167          sb.Append(Environment.NewLine);
    166168          sb.Append("Columns: ");
    167           sb.Append(Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     169          sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
    168170          for (int i = 1; i < filteredColumns.Count; i++) {
    169             string columnName = Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     171            string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
    170172            sb.Append(", ");
    171173            sb.Append(columnName);
     
    196198          sb.Append(Environment.NewLine);
    197199          sb.Append("Columns: ");
    198           sb.Append(Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     200          sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
    199201          for (int i = 1; i < filteredColumns.Count; i++) {
    200             string columnName = Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     202            string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
    201203            sb.Append(", ");
    202204            sb.Append(columnName);
     
    250252      }
    251253      if (btnApply.Enabled) {
    252         var allIndices = Content.SearchLogic.GetMissingValueIndices();
    253         int count = allIndices[columnIndex].Count;
     254        int count = 0;
     255        for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreProcessingData.Rows; rowIndex++)
     256          if (Content.ManipulationLogic.PreProcessingData.IsCellEmpty(columnIndex, rowIndex)) count++;
     257
    254258        int cellCount = Content.FilterLogic.PreprocessingData.Rows * Content.FilterLogic.PreprocessingData.Columns;
    255259        lblPreviewReplaceMissingValues.Text = count + " cell" + (count > 1 || count == 0 ? "s" : "")
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.cs

    r15110 r15269  
    4242    //Clone chart items
    4343    protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
    44       if (itemsListView.SelectedItems.Count == 1) {
    45         IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut;
    46         if (item != null) {
    47           try {
    48             item = (IViewShortcut)item.Clone();
    49             var view = MainFormManager.MainForm.ShowContent(item);
    50             if (view != null) {
    51               view.ReadOnly = ReadOnly;
    52               view.Locked = Locked;
    53             }
    54           } catch (NullReferenceException) {
    55             // cloning for preprocessing not done properly yet
    56           }
     44      if (itemsListView.SelectedItems.Count != 1) return;
     45      IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut;
     46      if (item == null) return;
     47      try {
     48        item = (IViewShortcut)item.Clone();
     49        var view = MainFormManager.MainForm.ShowContent(item);
     50        if (view != null) {
     51          view.ReadOnly = ReadOnly;
     52          view.Locked = Locked;
    5753        }
     54      } catch (NullReferenceException) {
     55        // cloning for preprocessing not done properly yet
    5856      }
    5957    }
Note: See TracChangeset for help on using the changeset viewer.