Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10844


Ignore:
Timestamp:
05/14/14 11:44:17 (10 years ago)
Author:
rstoll
Message:
  • FilterResult was inversed at some point (true meaning it is filtered, not displayed respectively and thus not found and false means found)
  • Fixed that search applies a preview (data shall not be filtered, it only uses the FilterLogic)
Location:
branches/DataPreprocessing
Files:
3 edited

Legend:

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

    r10820 r10844  
    223223      for (int i = 0; i < Content.FilterLogic.PreprocessingData.Columns; i++) {
    224224        comparisonFilter.ConstraintColumn = i;
    225         bool[] filteredRows = Content.FilterLogic.Preview(filters, true);
    226         foundCells[i] = filteredRows.Select((value, index) => new { Index = index, Value = value })
    227           .Where(pair => pair.Value)
    228           .Select(pair => pair.Index)
    229           .ToList();
     225        bool[] filteredRows = Content.FilterLogic.GetFilterResult(filters, true);
     226        var foundIndices = new List<int>();
     227        for (int idx = 0; idx < filteredRows.Length; ++idx) {
     228          var notFilteredThusFound = !filteredRows[idx];
     229          if (notFilteredThusFound) {
     230            foundIndices.Add(idx);
     231          }
     232        }
     233        foundCells[i] = foundIndices;
    230234        IList<int> selectedList;
    231235        if (searchInSelection && HightlightedCellsBackground.TryGetValue(i, out selectedList)) {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs

    r10843 r10844  
    3333    }
    3434
    35 
    36 
    37     public bool[] Preview(IList<IFilter> filters, bool isAndCombination) {
     35    public bool[] GetFilterResult(IList<IFilter> filters, bool isAndCombination) {
    3836      IList<IFilter> activeFilters = filters.Where(f => f.Active && f.ConstraintData != null).ToList<IFilter>();
    3937
     
    5048        }
    5149      }
     50      return result;
     51    }
    5252
     53    public bool[] Preview(IList<IFilter> filters, bool isAndCombination) {
     54      var result = GetFilterResult(filters, isAndCombination);
    5355      preprocessingData.SetFilter(result);
    54 
    5556      return result;
    5657    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IFilterLogic.cs

    r10785 r10844  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using HeuristicLab.DataPreprocessing.Filter;
    23 using System.Collections.Generic;
    2424namespace HeuristicLab.DataPreprocessing {
    2525  public interface IFilterLogic {
     26    bool[] GetFilterResult(IList<IFilter> filters, bool isAndCombination);
    2627    bool[] Preview(IList<IFilter> filters, bool isAndCombination);
    2728    void Apply(IList<IFilter> filters, bool isAndCombination);
    28     IPreprocessingData PreprocessingData{get;}
     29    IPreprocessingData PreprocessingData { get; }
    2930    void Reset();
    3031  }
Note: See TracChangeset for help on using the changeset viewer.