Changeset 15274 for branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.cs
- Timestamp:
- 07/19/17 14:32:57 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.cs
r15110 r15274 74 74 rBtnAnd.Enabled = (activeFilters > 0); 75 75 rBtnOr.Enabled = (activeFilters > 0); 76 Content.FilterLogic.Reset(); 77 bool[] result = Content.FilterLogic.Preview(filters, rBtnAnd.Checked); 76 Content.PreprocessingData.ResetFilter(); 77 bool isAndCombination = rBtnAnd.Checked; 78 bool[] ret; 79 IList<IFilter> activeFilters1 = filters.Where(f => f.Active && f.ConstraintData != null).ToList(); 80 if (activeFilters1.Count > 0) { 81 var result1 = Enumerable.Repeat(!isAndCombination, Content.PreprocessingData.Rows).ToArray(); 82 83 foreach (IFilter filter in activeFilters1) { 84 bool[] filterResult = filter.Check(); 85 for (int row = 0; row < result1.Length; ++row) { 86 result1[row] = isAndCombination ? result1[row] || filterResult[row] : result1[row] && filterResult[row]; 87 } 88 } 89 Content.PreprocessingData.SetFilter(result1); 90 ret = result1; 91 } else { 92 ret = Enumerable.Repeat(false, Content.PreprocessingData.Rows).ToArray(); 93 } 94 bool[] result = ret; 78 95 79 96 int filteredCnt = result.Count(c => !c); … … 89 106 List<IFilter> filters = Content.Filters.ToList(); 90 107 //apply filters 91 Content.FilterLogic.Apply(filters, rBtnAnd.Checked); 108 bool isAndCombination = rBtnAnd.Checked; 109 Content.PreprocessingData.PersistFilter(); 110 Content.PreprocessingData.ResetFilter(); 92 111 //deactivate checked filters 93 112 filters = checkedFilterView.Content.CheckedItems.ToList(); … … 104 123 if (Content != null) { 105 124 foreach (IFilter filter in e.Items) { 106 filter.ConstrainedValue = Content. FilterLogic.PreprocessingData;125 filter.ConstrainedValue = Content.PreprocessingData; 107 126 } 108 127 }
Note: See TracChangeset
for help on using the changeset viewer.