Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/03/13 16:15:24 (11 years ago)
Author:
abeham
Message:

#1833:

  • Changed behavior to output results only of those operators that have been checked
  • Removed additional "Checked" result
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/CheckedMultiOperator.cs

    r9838 r9934  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
     24using System.Linq;
    2325using HeuristicLab.Common;
    2426using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
     
    5556
    5657    public override void CollectParameterValues(IDictionary<string, IItem> values) {
    57       base.CollectParameterValues(values);
     58      foreach (var param in Parameters.OfType<IValueParameter>().Except(OperatorParameters)) {
     59        var children = GetCollectedValues(param);
     60        foreach (var c in children) {
     61          if (String.IsNullOrEmpty(c.Key))
     62            values.Add(param.Name, c.Value);
     63          else values.Add(param.Name + "." + c.Key, c.Value);
     64        }
     65      }
    5866      foreach (var opParam in OperatorParameters) {
    5967        var op = opParam.Value;
    6068        var @checked = Operators.ItemChecked(op);
    61         values.Add(opParam.Name + ".Checked", new BoolValue(@checked));
     69        if (!@checked) continue;
     70        var children = GetCollectedValues(opParam);
     71        foreach (var c in children) {
     72          if (String.IsNullOrEmpty(c.Key))
     73            values.Add(opParam.Name, c.Value);
     74          else values.Add(opParam.Name + "." + c.Key, c.Value);
     75        }
    6276      }
    6377    }
Note: See TracChangeset for help on using the changeset viewer.