Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/20 15:13:17 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • fixed a bug in HeuristicLab.JsonInterface.App -> now the Runner checks if the instantiated optimizer is an EngineAlgorithm, if true: Engine = SequentialEngine (engine can be configured in later versions)
  • added a TabControl in ExportJsonDialog for parameters and results
  • updated parameter tree view with checkboxes (and linked them with VM)
  • renamed ActivatedResults to Results for templates
  • fixed a bug with injection of operators in MultiCheckedOperatorConverter -> now operators of an ValueParameter get set correctly
  • updated MultiCheckedOperatorConverter to extract/inject parameters of operators
  • fixed bug with path for template -> removed usage of method Path.GetDirectoryName, returned wrong results
  • splitted cache for JsonItemConverter into a cache for injection and extraction
  • JsonTemplateInstantiator now uses first item in objects array instead of searching for an object with template name
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs

    r17433 r17439  
    1616
    1717      dynamic val = item as dynamic;
    18       foreach (var op in val.Operators)
    19         val.Operators.SetItemCheckedState(op, GetOperatorState(op.Name, data));
     18      foreach (var op in val.Operators) {
     19        IJsonItem childItem = GetChildItem(op.Name, data);
     20        if(childItem != null) {
     21          if(childItem.Value is bool b) {
     22            val.Operators.SetItemCheckedState(op, b);
     23          }
     24          root.Inject((IItem)op, childItem, root);
     25        }
     26      }
    2027    }
    2128
     
    2431      dynamic val = value as dynamic;
    2532      foreach (var op in val.Operators) {
    26         item.AddChildren(new BoolJsonItem() {
     33        IJsonItem operatorItem = new BoolJsonItem() {
    2734          Name = op.Name,
    2835          Description = op.Description,
    2936          Value = val.Operators.ItemChecked(op),
    3037          Range = new bool[] { false, true }
    31         });
     38        };
     39        IJsonItem c = root.Extract((IItem)op, root);
     40        if(c != null && c.Children != null)
     41          operatorItem.AddChildren(c.Children);
     42        item.AddChildren(operatorItem);
    3243      }
    3344      return item;
     
    4253      return false;
    4354    }
     55
     56    private IJsonItem GetChildItem(string name, IJsonItem parent) {
     57      foreach(var c in parent.Children) {
     58        if (c.Name == name) return c;
     59      }
     60      return null;
     61    }
    4462    #endregion
    4563  }
Note: See TracChangeset for help on using the changeset viewer.