Changeset 15865 for branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/Content/TransformationContent.cs
- Timestamp:
- 03/27/18 15:46:12 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/Content/TransformationContent.cs
r15846 r15865 29 29 30 30 namespace HeuristicLab.DataPreprocessing { 31 31 32 [Item("Transformation", "Represents the transformation grid.")] 32 33 [StorableClass] … … 37 38 38 39 [Storable] 39 public I CheckedItemList<IDataAnalysisTransformation> CheckedTransformationList { get; private set; }40 public IItemList<PreprocessingTransformation> TransformationList { get; private set; } 40 41 41 42 #region Constructor, Cloning & Persistence 42 43 public TransformationContent(IFilteredPreprocessingData preprocessingData) 43 44 : base(preprocessingData) { 44 CheckedTransformationList = new CheckedItemList<IDataAnalysisTransformation>();45 TransformationList = new ItemList<PreprocessingTransformation>(); 45 46 } 46 47 47 48 public TransformationContent(TransformationContent original, Cloner cloner) 48 49 : base(original, cloner) { 49 CheckedTransformationList = cloner.Clone(original.CheckedTransformationList);50 TransformationList = cloner.Clone(original.TransformationList); 50 51 } 51 52 public override IDeepCloneable Clone(Cloner cloner) { … … 59 60 60 61 public bool ApplyTransformations(out IEnumerable<string> errorMessages) { 61 var transformations = CheckedTransformationList.CheckedItems.Select(x => x.Value);62 63 62 bool success = true; 64 63 var errors = new List<string>(); 65 64 errorMessages = errors; 66 65 67 foreach (var transformation in transformations) {66 foreach (var transformation in TransformationList.Where(x => !x.IsApplied)) { 68 67 var sourceVariable = transformation.OriginalVariable; 69 68 var targetVariable = transformation.TransformedVariable ?? sourceVariable + " Transformed"; … … 86 85 87 86 PreprocessingData.Transformations.Add(transformation); 88 CheckedTransformationList.SetItemCheckedState(transformation, false); 87 transformation.IsApplied = true; 88 // TODO: remove unused valid values in constrainedParameters 89 89 } else { 90 90 success = false;
Note: See TracChangeset
for help on using the changeset viewer.