Ignore:
Timestamp:
03/27/18 15:46:12 (3 years ago)
Author:
pfleck
Message:

#2906 Added PreprocessingTransformation as a custom view-model for transformations in preprocessing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/Content/TransformationContent.cs

    r15846 r15865  
    2929
    3030namespace HeuristicLab.DataPreprocessing {
     31
    3132  [Item("Transformation", "Represents the transformation grid.")]
    3233  [StorableClass]
     
    3738
    3839    [Storable]
    39     public ICheckedItemList<IDataAnalysisTransformation> CheckedTransformationList { get; private set; }
     40    public IItemList<PreprocessingTransformation> TransformationList { get; private set; }
    4041
    4142    #region Constructor, Cloning & Persistence
    4243    public TransformationContent(IFilteredPreprocessingData preprocessingData)
    4344      : base(preprocessingData) {
    44       CheckedTransformationList = new CheckedItemList<IDataAnalysisTransformation>();
     45      TransformationList = new ItemList<PreprocessingTransformation>();
    4546    }
    4647
    4748    public TransformationContent(TransformationContent original, Cloner cloner)
    4849      : base(original, cloner) {
    49       CheckedTransformationList = cloner.Clone(original.CheckedTransformationList);
     50      TransformationList = cloner.Clone(original.TransformationList);
    5051    }
    5152    public override IDeepCloneable Clone(Cloner cloner) {
     
    5960
    6061    public bool ApplyTransformations(out IEnumerable<string> errorMessages) {
    61       var transformations = CheckedTransformationList.CheckedItems.Select(x => x.Value);
    62 
    6362      bool success = true;
    6463      var errors = new List<string>();
    6564      errorMessages = errors;
    6665
    67       foreach (var transformation in transformations) {
     66      foreach (var transformation in TransformationList.Where(x => !x.IsApplied)) {
    6867        var sourceVariable = transformation.OriginalVariable;
    6968        var targetVariable = transformation.TransformedVariable ?? sourceVariable + " Transformed";
     
    8685
    8786          PreprocessingData.Transformations.Add(transformation);
    88           CheckedTransformationList.SetItemCheckedState(transformation, false);
     87          transformation.IsApplied = true;
     88          // TODO: remove unused valid values in constrainedParameters
    8989        } else {
    9090          success = false;
Note: See TracChangeset for help on using the changeset viewer.