- Timestamp:
- 11/25/16 16:16:20 (8 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r14384 r14418 61 61 InitData(); 62 62 GenerateChart(); 63 64 foreach (var row in dataRows) { 65 string variableName = row.Name; 66 if (!IsVariableChecked(variableName)) { 67 dataTableView.SetRowEnabled(variableName, false); 68 dataTable.SelectedRows.Remove(variableName); 69 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName))); 70 } 71 } 63 72 } 64 73 } … … 71 80 72 81 //add data rows to data tables according to checked item list 73 foreach (var checkedItem in Content.VariableItemList.CheckedItems) { 74 string variableName = Content.VariableItemList[checkedItem.Index].Value; 82 foreach (var row in dataRows) { 83 string variableName = row.Name; 84 85 //add row to data table 86 dataTable.Rows.Add(row); 87 88 //add row to data table per variable 75 89 PreprocessingDataTable d = new PreprocessingDataTable(variableName); 76 DataRow row = GetDataRow(variableName); 77 78 if (row != null) { 79 //add row to data table 80 dataTable.Rows.Add(row); 81 82 //add row to data table per variable 83 d.Rows.Add(row); 84 dataTablePerVariable.Add(d); 85 } 90 d.Rows.Add(row); 91 dataTablePerVariable.Add(d); 86 92 } 87 93 … … 95 101 string variableName = item.Value.Value; 96 102 97 // not checked -> remove 103 98 104 if (!IsVariableChecked(variableName)) { 105 // not checked -> remove 99 106 dataTableView.SetRowEnabled(variableName, false); 100 107 dataTable.SelectedRows.Remove(variableName); 101 108 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName))); 102 109 } else { 110 // checked -> add 103 111 DataRow row = GetDataRow(variableName); 104 112 DataRow selectedRow = GetSelectedDataRow(variableName); -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs
r14384 r14418 56 56 57 57 if (Content.VariableItemList == null) { 58 Content.VariableItemList = Content.CreateVariableItemList(); 58 IList<string> inputs = Content.PreprocessingData.InputVariables; 59 if (Content.PreprocessingData.TargetVariable != null) 60 inputs = inputs.Union(new[] {Content.PreprocessingData.TargetVariable}).ToList(); 61 Content.VariableItemList = Content.CreateVariableItemList(inputs); 59 62 } else { 60 63 var checkedNames = Content.VariableItemList.CheckedItems.Select(x => x.Value.Value); 61 Content.VariableItemList = Content.CreateVariableItemList(checkedNames );64 Content.VariableItemList = Content.CreateVariableItemList(checkedNames.ToList()); 62 65 } 63 66 Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged; -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs
r14185 r14418 23 23 using System.Collections.Generic; 24 24 using System.Drawing; 25 using System.Linq;26 25 using HeuristicLab.Analysis; 27 26 using HeuristicLab.Common; … … 126 125 127 126 128 public ICheckedItemList<StringValue> CreateVariableItemList(IEnumerable<string> checkedItems = null) { 127 public ICheckedItemList<StringValue> CreateVariableItemList(IList<string> checkedItems = null) { 128 if (checkedItems == null) checkedItems = new string[0]; 129 129 ICheckedItemList<StringValue> itemList = new CheckedItemList<StringValue>(); 130 130 foreach (string name in PreprocessingData.GetDoubleVariableNames()) { 131 131 var n = new StringValue(name); 132 itemList.Add(n, (checkedItems == null) ? true :checkedItems.Contains(name));132 itemList.Add(n, checkedItems.Contains(name)); 133 133 } 134 134 return new ReadOnlyCheckedItemList<StringValue>(itemList);
Note: See TracChangeset
for help on using the changeset viewer.