Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17473 for branches


Ignore:
Timestamp:
03/10/20 17:17:37 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • refactored inheritance structure of json items, now the default JsonItem is an abstract class without properties Value and Range -> splitted up into new interfaces
  • updated view models for new json item structure
  • updated SingleLineArrayJsonWriter
Location:
branches/3026_IntegrationIntoSymSpace
Files:
12 added
1 deleted
52 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IJsonItemVM.cs

    r17471 r17473  
    88
    99namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10   public interface IJsonItemVM : INotifyPropertyChanged, IDisposable {
     10  public interface IJsonItemVM : INotifyPropertyChanged, IDisposable
     11  {
    1112    event Action ItemChanged;
    1213
    13     Type JsonItemType { get; }
     14    Type TargetedJsonItemType { get; }
    1415
    1516    UserControl Control { get; }
    16 
    17     IJsonItem Item { get; set; }
    18 
    1917    bool Selected { get; set; }
    2018
     
    2624
    2725    TreeView TreeView { get; set; }
     26    IJsonItem Item { get; set; }
     27
     28  }
     29
     30  public interface IJsonItemVM<JsonItemType> : IJsonItemVM
     31    where JsonItemType : IJsonItem
     32  {
     33    new JsonItemType Item { get; set; }
    2834  }
    2935}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs

    r17471 r17473  
    2828      this.textBoxName = new System.Windows.Forms.TextBox();
    2929      this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
     30      this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
     31      this.textBoxDescription = new System.Windows.Forms.TextBox();
     32      this.checkBoxActive = new System.Windows.Forms.CheckBox();
     33      this.label1 = new System.Windows.Forms.Label();
    3034      this.labelDescription = new System.Windows.Forms.Label();
    31       this.textBoxDescription = new System.Windows.Forms.TextBox();
    32       this.label1 = new System.Windows.Forms.Label();
    3335      this.labelEnable = new System.Windows.Forms.Label();
    34       this.checkBoxActive = new System.Windows.Forms.CheckBox();
    35       this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
    3636      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3737      this.tableLayoutPanel1.SuspendLayout();
     
    4848      this.textBoxName.Dock = System.Windows.Forms.DockStyle.Fill;
    4949      this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    50       this.textBoxName.Location = new System.Drawing.Point(100, 24);
     50      this.textBoxName.Location = new System.Drawing.Point(100, 25);
    5151      this.textBoxName.Margin = new System.Windows.Forms.Padding(0);
    5252      this.textBoxName.Name = "textBoxName";
     
    7272      this.tableLayoutPanel1.TabIndex = 16;
    7373      //
    74       // labelDescription
    75       //
    76       this.labelDescription.AutoSize = true;
    77       this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill;
    78       this.labelDescription.Location = new System.Drawing.Point(0, 48);
    79       this.labelDescription.Margin = new System.Windows.Forms.Padding(0);
    80       this.labelDescription.Name = "labelDescription";
    81       this.labelDescription.Size = new System.Drawing.Size(100, 27);
    82       this.labelDescription.TabIndex = 13;
    83       this.labelDescription.Text = "Description";
    84       this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    85       //
    86       // textBoxDescription
    87       //
    88       this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
    89       this.textBoxDescription.Location = new System.Drawing.Point(100, 50);
    90       this.textBoxDescription.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
    91       this.textBoxDescription.Name = "textBoxDescription";
    92       this.textBoxDescription.Size = new System.Drawing.Size(394, 20);
    93       this.textBoxDescription.TabIndex = 14;
    94       //
    95       // label1
    96       //
    97       this.label1.AutoSize = true;
    98       this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
    99       this.label1.Location = new System.Drawing.Point(0, 24);
    100       this.label1.Margin = new System.Windows.Forms.Padding(0);
    101       this.label1.Name = "label1";
    102       this.label1.Size = new System.Drawing.Size(100, 24);
    103       this.label1.TabIndex = 9;
    104       this.label1.Text = "Name";
    105       this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    106       //
    107       // labelEnable
    108       //
    109       this.labelEnable.AutoSize = true;
    110       this.labelEnable.Dock = System.Windows.Forms.DockStyle.Fill;
    111       this.labelEnable.Location = new System.Drawing.Point(0, 0);
    112       this.labelEnable.Margin = new System.Windows.Forms.Padding(0);
    113       this.labelEnable.Name = "labelEnable";
    114       this.labelEnable.Size = new System.Drawing.Size(100, 24);
    115       this.labelEnable.TabIndex = 3;
    116       this.labelEnable.Text = "Enable";
    117       this.labelEnable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    118       //
    119       // checkBoxActive
    120       //
    121       this.checkBoxActive.AutoSize = true;
    122       this.checkBoxActive.Dock = System.Windows.Forms.DockStyle.Fill;
    123       this.checkBoxActive.Location = new System.Drawing.Point(100, 0);
    124       this.checkBoxActive.Margin = new System.Windows.Forms.Padding(0);
    125       this.checkBoxActive.Name = "checkBoxActive";
    126       this.checkBoxActive.Size = new System.Drawing.Size(394, 24);
    127       this.checkBoxActive.TabIndex = 2;
    128       this.checkBoxActive.UseVisualStyleBackColor = true;
    129       //
    13074      // tableLayoutPanel5
    13175      //
     
    15094      this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 75);
    15195      this.tableLayoutPanel5.TabIndex = 17;
     96      //
     97      // textBoxDescription
     98      //
     99      this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
     100      this.textBoxDescription.Location = new System.Drawing.Point(100, 52);
     101      this.textBoxDescription.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
     102      this.textBoxDescription.Name = "textBoxDescription";
     103      this.textBoxDescription.Size = new System.Drawing.Size(394, 20);
     104      this.textBoxDescription.TabIndex = 14;
     105      //
     106      // checkBoxActive
     107      //
     108      this.checkBoxActive.AutoSize = true;
     109      this.checkBoxActive.Dock = System.Windows.Forms.DockStyle.Fill;
     110      this.checkBoxActive.Location = new System.Drawing.Point(100, 0);
     111      this.checkBoxActive.Margin = new System.Windows.Forms.Padding(0);
     112      this.checkBoxActive.Name = "checkBoxActive";
     113      this.checkBoxActive.Size = new System.Drawing.Size(394, 25);
     114      this.checkBoxActive.TabIndex = 2;
     115      this.checkBoxActive.UseVisualStyleBackColor = true;
     116      //
     117      // label1
     118      //
     119      this.label1.AutoSize = true;
     120      this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
     121      this.label1.Location = new System.Drawing.Point(0, 25);
     122      this.label1.Margin = new System.Windows.Forms.Padding(0);
     123      this.label1.Name = "label1";
     124      this.label1.Size = new System.Drawing.Size(100, 25);
     125      this.label1.TabIndex = 9;
     126      this.label1.Text = "Name";
     127      this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     128      //
     129      // labelDescription
     130      //
     131      this.labelDescription.AutoSize = true;
     132      this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill;
     133      this.labelDescription.Location = new System.Drawing.Point(0, 50);
     134      this.labelDescription.Margin = new System.Windows.Forms.Padding(0);
     135      this.labelDescription.Name = "labelDescription";
     136      this.labelDescription.Size = new System.Drawing.Size(100, 25);
     137      this.labelDescription.TabIndex = 13;
     138      this.labelDescription.Text = "Description";
     139      this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     140      //
     141      // labelEnable
     142      //
     143      this.labelEnable.AutoSize = true;
     144      this.labelEnable.Dock = System.Windows.Forms.DockStyle.Fill;
     145      this.labelEnable.Location = new System.Drawing.Point(0, 0);
     146      this.labelEnable.Margin = new System.Windows.Forms.Padding(0);
     147      this.labelEnable.Name = "labelEnable";
     148      this.labelEnable.Size = new System.Drawing.Size(100, 25);
     149      this.labelEnable.TabIndex = 3;
     150      this.labelEnable.Text = "Enable";
     151      this.labelEnable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    152152      //
    153153      // JsonItemBaseControl
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs

    r17471 r17473  
    1010
    1111  public class DoubleArrayValueVM : ArrayValueVM<double, DoubleArrayJsonItem> {
    12     public override Type JsonItemType => typeof(DoubleArrayJsonItem);
     12    public override Type TargetedJsonItemType => typeof(DoubleArrayJsonItem);
    1313
    1414    protected override double MinTypeValue => double.MinValue;
     
    2929
    3030  public class IntArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {
    31     public override Type JsonItemType => typeof(IntArrayJsonItem);
     31    public override Type TargetedJsonItemType => typeof(IntArrayJsonItem);
    3232
    3333    protected override int MinTypeValue => int.MinValue;
     
    4747  }
    4848
    49   public abstract class ArrayValueVM<T, JsonItemType> : RangedValueBaseVM<T>, IArrayJsonItemVM
    50     where JsonItemType : IArrayJsonItem {
     49  public abstract class ArrayValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>, IArrayJsonItemVM
     50    where T : IComparable
     51    where JsonItemType : class, IArrayJsonItem, IIntervalRestrictedJsonItem<T> {
    5152   
    5253    public ArrayValueVM() { }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs

    r17471 r17473  
    99
    1010namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    11   public abstract class JsonItemVMBase : IJsonItemVM {
    12     private IJsonItem item;
    13     public IJsonItem Item {
     11  public abstract class JsonItemVMBase<JsonItemType> : IJsonItemVM<JsonItemType>
     12    where JsonItemType : class, IJsonItem
     13  {
     14    IJsonItem IJsonItemVM.Item {
     15      get => item;
     16      set => item = (JsonItemType)value;
     17    }
     18
     19    private JsonItemType item;
     20    public JsonItemType Item {
    1421      get => item;
    1522      set {
     
    2734        Item.Active = value;
    2835        if(TreeNode != null) {
    29           TreeNode.ForeColor = (Selected ? Color.Black : Color.Red);
     36          TreeNode.ForeColor = (Selected ? Color.Green : Color.Black);
    3037          TreeNode.Checked = value;
    3138        }
     
    5057    }
    5158
    52     public abstract Type JsonItemType { get; }
     59    public abstract Type TargetedJsonItemType { get; }
    5360    public abstract UserControl Control { get; }
    5461
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/LookupJsonItemVM.cs

    r17471 r17473  
    77
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    9   public class LookupJsonItemVM : JsonItemVMBase, ILookupJsonItemVM {
    10     public override Type JsonItemType => typeof(LookupJsonItem);
     9  public class LookupJsonItemVM : JsonItemVMBase<LookupJsonItem>, ILookupJsonItemVM {
     10    public override Type TargetedJsonItemType => typeof(LookupJsonItem);
    1111
    1212    public override UserControl Control => new LookupJsonItemControl(this);
    1313
    1414    public string ActualName {
    15       get => ((ILookupJsonItem)Item).ActualName;
     15      get => Item.ActualName;
    1616      set {
    17         ((ILookupJsonItem)Item).ActualName = value;
     17        Item.ActualName = value;
    1818        OnPropertyChange(this, nameof(ActualName));
    1919      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs

    r17471 r17473  
    1010
    1111  public class DoubleMatrixValueVM : MatrixValueVM<double, DoubleMatrixJsonItem> {
    12     public override Type JsonItemType => typeof(DoubleMatrixJsonItem);
     12    public override Type TargetedJsonItemType => typeof(DoubleMatrixJsonItem);
    1313    public override UserControl Control =>
    1414      new JsonItemDoubleMatrixValueControl(this);
     
    2727  }
    2828
    29   public abstract class MatrixValueVM<T, JsonItemType> : RangedValueBaseVM<T>, IMatrixJsonItemVM
    30     where JsonItemType : IMatrixJsonItem {
     29  public abstract class MatrixValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>, IMatrixJsonItemVM
     30    where T : IComparable
     31    where JsonItemType : class, IMatrixJsonItem, IIntervalRestrictedJsonItem<T> {
    3132    public abstract T[][] Value { get; set; }
    3233    public bool RowsResizable {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs

    r17471 r17473  
    99namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1010
    11   public class IntRangeVM : RangeVM<int> {
    12     public override Type JsonItemType => typeof(IntRangeJsonItem);
     11  public class IntRangeVM : RangeVM<int, IntRangeJsonItem> {
     12    public override Type TargetedJsonItemType => typeof(IntRangeJsonItem);
    1313
    1414    protected override int MinTypeValue => int.MinValue;
     
    2020  }
    2121
    22   public class DoubleRangeVM : RangeVM<double> {
    23     public override Type JsonItemType => typeof(DoubleRangeJsonItem);
     22  public class DoubleRangeVM : RangeVM<double, DoubleRangeJsonItem> {
     23    public override Type TargetedJsonItemType => typeof(DoubleRangeJsonItem);
    2424
    2525    protected override double MinTypeValue => double.MinValue;
     
    3131  }
    3232
    33   public abstract class RangeVM<T> : RangedValueBaseVM<T> {
     33  public abstract class RangeVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>
     34    where T : IComparable
     35    where JsonItemType : class, IRangedJsonItem<T>
     36  {
    3437
    3538    public T MinValue {
    36       get => Cast(((Array)Item.Value).GetValue(0));
     39      get => Item.MinValue;
    3740      set {
    38         SetValue(value, (T)((Array)Item.Value).GetValue(1));
     41        Item.MinValue = value;
    3942        OnPropertyChange(this, nameof(MinValue));
    4043      }
     
    4245
    4346    public T MaxValue {
    44       get => Cast(((Array)Item.Value).GetValue(1));
     47      get => Item.MaxValue;
    4548      set {
    46         SetValue((T)((Array)Item.Value).GetValue(0), value);
     49        Item.MaxValue = value;
    4750        OnPropertyChange(this, nameof(MaxValue));
    4851      }
    4952    }
    50 
    51     private void SetValue(T min, T max) =>
    52       Item.Value = new T[] { min, max };
    5353  }
    5454}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs

    r17420 r17473  
    66
    77namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    8   public abstract class RangedValueBaseVM : RangedValueBaseVM<object> { }
    98
    10   public abstract class RangedValueBaseVM<T> : JsonItemVMBase {
     9  public abstract class RangedValueBaseVM<T, JsonItemType> : JsonItemVMBase<JsonItemType>
     10    where T : IComparable
     11    where JsonItemType : class, IIntervalRestrictedJsonItem<T>
     12  {
    1113    public T MinRange {
    12       get => Cast(Item.Range?.First());
     14      get => Item.Minimum;
    1315      set {
    14         SetRange(value, Item.Range?.Last());
     16        Item.Minimum = value;
    1517        OnPropertyChange(this, nameof(MinRange));
    1618      }
     
    1820
    1921    public T MaxRange {
    20       get => Cast(Item.Range?.Last());
     22      get => Item.Maximum;
    2123      set {
    22         SetRange(Item.Range?.First(), value);
     24        Item.Maximum = value;
    2325        OnPropertyChange(this, nameof(MaxRange));
    2426      }
     
    4648      }
    4749    }
    48 
    49     protected T Cast(object obj) => (obj==null) ? default(T) : (T)Convert.ChangeType(obj, typeof(T));
    50 
    51     private void SetRange(object min, object max) {
    52       object[] range = new object[] { min, max };
    53       Item.Range = range;
    54     }
    55 
     50   
    5651    protected abstract T MinTypeValue { get; }
    5752    protected abstract T MaxTypeValue { get; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ResultItemVM.cs

    r17471 r17473  
    77
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    9   public class ResultItemVM : JsonItemVMBase {
    10     public override Type JsonItemType => typeof(ResultJsonItem);
     9  public class ResultItemVM : JsonItemVMBase<ResultJsonItem> {
     10    public override Type TargetedJsonItemType => typeof(ResultJsonItem);
    1111    public override UserControl Control =>
    1212      new JsonItemBaseControl(this);
    13 
    1413  }
    1514}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs

    r17471 r17473  
    88
    99namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10   public class IntValueVM : SingleValueVM<int> {
    11     public override Type JsonItemType => typeof(IntJsonItem);
     10  public class IntValueVM : SingleValueVM<int, IntJsonItem> {
     11    public override Type TargetedJsonItemType => typeof(IntJsonItem);
    1212
    1313    protected override int MinTypeValue => int.MinValue;
     
    1818  }
    1919
    20   public class DoubleValueVM : SingleValueVM<double> {
    21     public override Type JsonItemType => typeof(DoubleJsonItem);
     20  public class DoubleValueVM : SingleValueVM<double, DoubleJsonItem> {
     21    public override Type TargetedJsonItemType => typeof(DoubleJsonItem);
    2222
    2323    protected override double MinTypeValue => double.MinValue;
     
    2828  }
    2929
    30   public class BoolValueVM : SingleValueVM<bool> {
    31     public override Type JsonItemType => typeof(BoolJsonItem);
     30  public class BoolValueVM : JsonItemVMBase<BoolJsonItem> {
     31    public override Type TargetedJsonItemType => typeof(BoolJsonItem);
    3232
    33     protected override bool MinTypeValue => false;
    34     protected override bool MaxTypeValue => true;
    35 
     33    public bool Value {
     34      get => Item.Value;
     35      set {
     36        Item.Value = value;
     37        OnPropertyChange(this, nameof(Value));
     38      }
     39    }
     40   
    3641    public override UserControl Control =>
    3742       new JsonItemBoolControl(this);
    3843  }
    3944
    40   public abstract class SingleValueVM<T> : RangedValueBaseVM<T> {
    41    
     45  public abstract class SingleValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>
     46    where T : IComparable
     47    where JsonItemType : class, IIntervalRestrictedJsonItem<T>, IValueJsonItem<T>
     48  {
     49
    4250    public T Value {
    43       get => Cast(Item.Value);
     51      get => Item.Value;
    4452      set {
    4553        Item.Value = value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs

    r17471 r17473  
    88
    99namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10   public class StringValueVM : JsonItemVMBase {
    11     public override Type JsonItemType => typeof(StringJsonItem);
     10  public class StringValueVM : JsonItemVMBase<StringJsonItem> {
     11    public override Type TargetedJsonItemType => typeof(StringJsonItem);
    1212    public override UserControl Control =>
    1313       new JsonItemValidValuesControl(this);
     
    2222
    2323    public IEnumerable<string> Range {
    24       get => Item.Range?.Cast<string>();
     24      get => Item.ConcreteRestrictedItems;
    2525      set {
    26         Item.Range = value;
     26        Item.ConcreteRestrictedItems = value;
    2727        //check if value is still in range
    2828        if (!Range.Any(x => x == Value)) {
     
    3737      }
    3838    }
     39
    3940  }
    4041}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ValueLookupJsonItemVM.cs

    r17471 r17473  
    44using System.Text;
    55using System.Threading.Tasks;
     6using System.Windows.Forms;
    67
    78namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    89  public class ValueLookupJsonItemVM : LookupJsonItemVM, IValueLookupJsonItemVM {
     10    public override Type TargetedJsonItemType => typeof(ValueLookupJsonItem);
     11    public override UserControl Control => new ValueLookupJsonItemControl(this);
    912    public IJsonItem JsonItemReference => ((IValueLookupJsonItem)Item).JsonItemReference;
    1013  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17471 r17473  
    5353      foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
    5454        IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    55         JI2VM.Add(vm.JsonItemType, vmType);
     55        JI2VM.Add(vm.TargetedJsonItemType, vmType);
    5656      }
    5757    }
     
    102102              if(Node2VM.TryGetValue(childNode, out IJsonItemVM vm))
    103103                vm.Selected = true;
     104             
    104105            } else {
    105106              TreeNode childNode = new TreeNode(c.Name);
     
    126127        Node2Control.Add(node, control);
    127128      } else {
    128         //node.
     129        node.ForeColor = Color.LightGray;
     130        node.NodeFont = new Font(SystemFonts.DialogFont, FontStyle.Italic);
    129131      }
    130132    }
     
    138140      }
    139141     
    140       return b || (item.Value != null || item.Range != null || item is ILookupJsonItem || item is IResultJsonItem);
     142      return b || !(item is EmptyJsonItem);
    141143    }
    142144   
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.resx

    r17444 r17473  
    121121    <value>194, 17</value>
    122122  </metadata>
     123  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     124    <value>37</value>
     125  </metadata>
    123126  <metadata name="jsonItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124127    <value>17, 17</value>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs

    r17471 r17473  
    167167    private void InitRangeBinding() {
    168168      NumericRangeControl = numericRangeControl1;
    169       NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
    170       NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
    171       NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
     169      NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
     170      NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
     171      NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
    172172        false, DataSourceUpdateMode.OnPropertyChanged);
    173       NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
     173      NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
    174174        false, DataSourceUpdateMode.OnPropertyChanged);
    175175    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.Designer.cs

    r17471 r17473  
    2626      this.components = new System.ComponentModel.Container();
    2727      this.groupBox1 = new System.Windows.Forms.GroupBox();
     28      this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
     29      this.label2 = new System.Windows.Forms.Label();
    2830      this.textBoxValueTo = new System.Windows.Forms.TextBox();
     31      this.textBoxValueFrom = new System.Windows.Forms.TextBox();
    2932      this.label4 = new System.Windows.Forms.Label();
    30       this.label2 = new System.Windows.Forms.Label();
    3133      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    32       this.textBoxValueFrom = new System.Windows.Forms.TextBox();
    33       this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
    3434      this.numericRangeControl = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl();
    3535      this.groupBox1.SuspendLayout();
     36      this.tableLayoutPanel1.SuspendLayout();
    3637      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    37       this.tableLayoutPanel1.SuspendLayout();
    3838      this.SuspendLayout();
    3939      //
     
    5050      this.groupBox1.TabStop = false;
    5151      this.groupBox1.Text = "Value";
    52       //
    53       // textBoxValueTo
    54       //
    55       this.textBoxValueTo.Dock = System.Windows.Forms.DockStyle.Fill;
    56       this.textBoxValueTo.Location = new System.Drawing.Point(100, 24);
    57       this.textBoxValueTo.Margin = new System.Windows.Forms.Padding(0);
    58       this.textBoxValueTo.Name = "textBoxValueTo";
    59       this.textBoxValueTo.Size = new System.Drawing.Size(394, 20);
    60       this.textBoxValueTo.TabIndex = 3;
    61       //
    62       // label4
    63       //
    64       this.label4.AutoSize = true;
    65       this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
    66       this.label4.Location = new System.Drawing.Point(0, 24);
    67       this.label4.Margin = new System.Windows.Forms.Padding(0);
    68       this.label4.Name = "label4";
    69       this.label4.Size = new System.Drawing.Size(100, 25);
    70       this.label4.TabIndex = 1;
    71       this.label4.Text = "To:";
    72       this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    73       //
    74       // label2
    75       //
    76       this.label2.AutoSize = true;
    77       this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
    78       this.label2.Location = new System.Drawing.Point(0, 0);
    79       this.label2.Margin = new System.Windows.Forms.Padding(0);
    80       this.label2.Name = "label2";
    81       this.label2.Size = new System.Drawing.Size(100, 24);
    82       this.label2.TabIndex = 0;
    83       this.label2.Text = "From:";
    84       this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    85       //
    86       // errorProvider
    87       //
    88       this.errorProvider.ContainerControl = this;
    89       //
    90       // textBoxValueFrom
    91       //
    92       this.textBoxValueFrom.Dock = System.Windows.Forms.DockStyle.Fill;
    93       this.textBoxValueFrom.Location = new System.Drawing.Point(100, 0);
    94       this.textBoxValueFrom.Margin = new System.Windows.Forms.Padding(0);
    95       this.textBoxValueFrom.Name = "textBoxValueFrom";
    96       this.textBoxValueFrom.Size = new System.Drawing.Size(394, 20);
    97       this.textBoxValueFrom.TabIndex = 2;
    9852      //
    9953      // tableLayoutPanel1
     
    11569      this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 49);
    11670      this.tableLayoutPanel1.TabIndex = 19;
     71      //
     72      // label2
     73      //
     74      this.label2.AutoSize = true;
     75      this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
     76      this.label2.Location = new System.Drawing.Point(0, 0);
     77      this.label2.Margin = new System.Windows.Forms.Padding(0);
     78      this.label2.Name = "label2";
     79      this.label2.Size = new System.Drawing.Size(100, 24);
     80      this.label2.TabIndex = 0;
     81      this.label2.Text = "From:";
     82      this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     83      //
     84      // textBoxValueTo
     85      //
     86      this.textBoxValueTo.Dock = System.Windows.Forms.DockStyle.Fill;
     87      this.textBoxValueTo.Location = new System.Drawing.Point(100, 24);
     88      this.textBoxValueTo.Margin = new System.Windows.Forms.Padding(0);
     89      this.textBoxValueTo.Name = "textBoxValueTo";
     90      this.textBoxValueTo.Size = new System.Drawing.Size(394, 20);
     91      this.textBoxValueTo.TabIndex = 3;
     92      //
     93      // textBoxValueFrom
     94      //
     95      this.textBoxValueFrom.Dock = System.Windows.Forms.DockStyle.Fill;
     96      this.textBoxValueFrom.Location = new System.Drawing.Point(100, 0);
     97      this.textBoxValueFrom.Margin = new System.Windows.Forms.Padding(0);
     98      this.textBoxValueFrom.Name = "textBoxValueFrom";
     99      this.textBoxValueFrom.Size = new System.Drawing.Size(394, 20);
     100      this.textBoxValueFrom.TabIndex = 2;
     101      //
     102      // label4
     103      //
     104      this.label4.AutoSize = true;
     105      this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
     106      this.label4.Location = new System.Drawing.Point(0, 24);
     107      this.label4.Margin = new System.Windows.Forms.Padding(0);
     108      this.label4.Name = "label4";
     109      this.label4.Size = new System.Drawing.Size(100, 25);
     110      this.label4.TabIndex = 1;
     111      this.label4.Text = "To:";
     112      this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     113      //
     114      // errorProvider
     115      //
     116      this.errorProvider.ContainerControl = this;
    117117      //
    118118      // numericRangeControl
     
    137137      this.Size = new System.Drawing.Size(500, 147);
    138138      this.groupBox1.ResumeLayout(false);
    139       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    140139      this.tableLayoutPanel1.ResumeLayout(false);
    141140      this.tableLayoutPanel1.PerformLayout();
     141      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    142142      this.ResumeLayout(false);
    143143
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs

    r17464 r17473  
    3232
    3333    private void InitNumbericRangeControl() {
    34       numericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
    35       numericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
    36       numericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
     34      numericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
     35      numericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
     36      numericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
    3737        false, DataSourceUpdateMode.OnPropertyChanged);
    38       numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
     38      numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
    3939        false, DataSourceUpdateMode.OnPropertyChanged);
    4040    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.cs

    r17464 r17473  
    1212  public partial class JsonItemValidValuesControl : UserControl {
    1313
    14     IJsonItemVM VM { get; set; }
     14    StringValueVM VM { get; set; }
    1515
    1616    public JsonItemValidValuesControl(StringValueVM vm) {
    1717      InitializeComponent();
    1818      VM = vm;
    19       if (VM.Item.Range != null) {
    20         foreach (var i in VM.Item.Range)
    21           SetupOption((string)i);
     19      if (VM.Item.ConcreteRestrictedItems != null) {
     20        foreach (var i in VM.Item.ConcreteRestrictedItems)
     21          SetupOption(i);
    2222        comboBoxValues.DataBindings.Add("SelectedItem", VM, nameof(StringValueVM.Value));
    2323      } else {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs

    r17471 r17473  
    5858    protected void Init() {
    5959      TBValue.DataBindings.Add("Text", VM, ValuePropertyId);
    60       NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
    61       NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
    62       NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
     60      NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
     61      NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
     62      NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
    6363        false, DataSourceUpdateMode.OnPropertyChanged);
    64       NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
     64      NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
    6565        false, DataSourceUpdateMode.OnPropertyChanged);
    6666    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.Designer.cs

    r17471 r17473  
    1 namespace HeuristicLab.JsonInterface.OptimizerIntegration.Views {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    22  partial class ValueLookupJsonItemControl {
    33    /// <summary>
     
    2929      // content
    3030      //
    31       this.content.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    32             | System.Windows.Forms.AnchorStyles.Left)
    33             | System.Windows.Forms.AnchorStyles.Right)));
    34       this.content.Location = new System.Drawing.Point(0, 20);
     31      this.content.Dock = System.Windows.Forms.DockStyle.Fill;
     32      this.content.Location = new System.Drawing.Point(0, 22);
    3533      this.content.Margin = new System.Windows.Forms.Padding(0);
    3634      this.content.Name = "content";
    37       this.content.Size = new System.Drawing.Size(651, 350);
     35      this.content.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
     36      this.content.Size = new System.Drawing.Size(500, 523);
    3837      this.content.TabIndex = 14;
    3938      //
     
    4443      this.Controls.Add(this.content);
    4544      this.Name = "ValueLookupJsonItemControl";
    46       this.Size = new System.Drawing.Size(651, 370);
     45      this.Size = new System.Drawing.Size(500, 545);
    4746      this.Controls.SetChildIndex(this.content, 0);
    4847      this.ResumeLayout(false);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs

    r17471 r17473  
    1010using HeuristicLab.PluginInfrastructure;
    1111
    12 namespace HeuristicLab.JsonInterface.OptimizerIntegration.Views {
     12namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1313  public partial class ValueLookupJsonItemControl : LookupJsonItemControl {
    14     private IDictionary<Type, Type> JI2VM { get; set; }
     14    private static IDictionary<Type, Type> JI2VM { get; set; }
    1515
    16     public ValueLookupJsonItemControl() {
    17       InitializeComponent();
    18     }
    1916    public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) : base(vm) {
    2017      InitializeComponent();
    2118      InitCache();
    22       if (JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) {
     19      if (vm.JsonItemReference != null && JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) {
    2320        IJsonItemVM tmp = (IJsonItemVM)Activator.CreateInstance(vmType);
    24         content.Controls.Add(tmp.Control);
    25       } else {
    26         //node.
     21        tmp.Item = vm.JsonItemReference;
     22        content.Controls.Clear();
     23        UserControl control = tmp.Control;
     24        content.Controls.Add(control);
     25        control.Dock = DockStyle.Fill;
     26       
    2727      }
    2828    }
    2929
    3030    private void InitCache() {
    31       JI2VM = new Dictionary<Type, Type>();
    32       foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
    33         IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    34         JI2VM.Add(vm.JsonItemType, vmType);
     31      if(JI2VM == null) {
     32        JI2VM = new Dictionary<Type, Type>();
     33        foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
     34          IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
     35          JI2VM.Add(vm.TargetedJsonItemType, vmType);
     36        }
    3537      }
    3638    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs

    r17433 r17473  
    1919          parameter.ActualValue = x;
    2020
    21       if (parameter.ActualValue is IParameterizedItem && cdata.Children != null) {
     21      if (parameter.ActualValue != null && /*parameter.ActualValue is IParameterizedItem &&*/ cdata.Children != null) {
    2222        foreach(var param in cdata.Children) {
    2323          if(param.Name == parameter.ActualValue.ItemName)
     
    3434        Description = value.ItemDescription,
    3535        Value = parameter.ActualValue?.ToString(),
    36         Range = GetValidValues(parameter).Select(x => x.ToString())
     36        ConcreteRestrictedItems = GetValidValues(parameter).Select(x => x.ToString())
    3737      };
    3838      item.AddChildren(GetParameterizedChilds(parameter));
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs

    r17433 r17473  
    2424        Description = value.ItemDescription,
    2525        Value = Enum.GetName(enumType, val),
    26         Range = Enum.GetNames(enumType)
     26        ConcreteRestrictedItems = Enum.GetNames(enumType)
    2727    };
    2828    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs

    r17439 r17473  
    1919        IJsonItem childItem = GetChildItem(op.Name, data);
    2020        if(childItem != null) {
    21           if(childItem.Value is bool b) {
    22             val.Operators.SetItemCheckedState(op, b);
     21          if(childItem is BoolJsonItem boolJsonItem) {
     22            val.Operators.SetItemCheckedState(op, boolJsonItem.Value);
    2323          }
    2424          root.Inject((IItem)op, childItem, root);
     
    3434          Name = op.Name,
    3535          Description = op.Description,
    36           Value = val.Operators.ItemChecked(op),
    37           Range = new bool[] { false, true }
     36          Value = val.Operators.ItemChecked(op)
    3837        };
    3938        IJsonItem c = root.Extract((IItem)op, root);
     
    4948    private bool GetOperatorState(string name, IJsonItem data) {
    5049      foreach(var op in data.Children) {
    51         if (op.Name == name && op.Value is bool) return (bool)op.Value;
     50        if (op.Name == name && op is BoolJsonItem b) return b.Value;
    5251      }
    5352      return false;
     
    5554
    5655    private IJsonItem GetChildItem(string name, IJsonItem parent) {
     56      if (parent.Children == null) return null;
    5757      foreach(var c in parent.Children) {
    5858        if (c.Name == name) return c;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs

    r17433 r17473  
    2424      var parameterizedItem = value as IParameterizedItem;
    2525
    26       IJsonItem item = new JsonItem() {
     26      IJsonItem item = new EmptyJsonItem() {
    2727        Name = value.ItemName,
    2828        Description = value.ItemDescription
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r17471 r17473  
    3131      var dataInfo = dataset.GetType().GetField("variableValues", flags);
    3232      dataInfo.SetValue(dataset, dictTmp);
    33       val.TargetVariable = (string)data.Children[3].Value;
    34       val.TrainingPartition.Start = ((IntRangeJsonItem)data.Children[2]).Value.First();
    35       val.TrainingPartition.End = ((IntRangeJsonItem)data.Children[2]).Value.Last();
    36       val.TestPartition.Start = ((IntRangeJsonItem)data.Children[1]).Value.First();
    37       val.TestPartition.End = ((IntRangeJsonItem)data.Children[1]).Value.Last();
     33      val.TargetVariable = ((StringJsonItem)data.Children[3]).Value;
     34      val.TrainingPartition.Start = ((IntRangeJsonItem)data.Children[2]).MinValue;
     35      val.TrainingPartition.End = ((IntRangeJsonItem)data.Children[2]).MaxValue;
     36      val.TestPartition.Start = ((IntRangeJsonItem)data.Children[1]).MinValue;
     37      val.TestPartition.End = ((IntRangeJsonItem)data.Children[1]).MaxValue;
    3838    }
    3939
    4040    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
    41       IJsonItem item = new JsonItem() {
     41      IJsonItem item = new EmptyJsonItem() {
    4242        Name = value.ItemName,
    4343        Description = value.ItemDescription
     
    7171          Name = "Dataset",
    7272          Value = mat,
    73           RowNames = rowNames
     73          RowNames = rowNames,
     74          Minimum = double.MinValue,
     75          Maximum = double.MaxValue
    7476        });
    7577      }
     
    8082      item.AddChildren(new IntRangeJsonItem() {
    8183        Name = "TestPartition",
    82         Value = new int[] { testPartition.Start, testPartition.End },
    83         Range = new int[] { 0, Math.Max(testPartition.End, trainingPartition.End) }
     84        MinValue = testPartition.Start,
     85        MaxValue = testPartition.End,
     86        Minimum = 0,
     87        Maximum = Math.Max(testPartition.End, trainingPartition.End)
    8488      });
    8589
     
    8791      item.AddChildren(new IntRangeJsonItem() {
    8892        Name = "TrainingPartition",
    89         Value = new int[] { trainingPartition.Start, trainingPartition.End },
    90         Range = new int[] { 0, Math.Max(testPartition.End, trainingPartition.End)}
     93        MinValue = trainingPartition.Start,
     94        MaxValue = trainingPartition.End,
     95        Minimum = 0,
     96        Maximum = Math.Max(testPartition.End, trainingPartition.End)
    9197      });
    9298
    9399      IEnumerable<StringValue> variables = (IEnumerable<StringValue>)val.InputVariables;
    94       item.AddChildren(new JsonItem() {
     100      item.AddChildren(new StringJsonItem() {
    95101        Name = "TargetVariable",
    96         Value = (object)targetVariable,
    97         Range = variables.Select(x => x.Value)
     102        Value = (string)targetVariable,
     103        ConcreteRestrictedItems = variables.Select(x => x.Value)
    98104      });
    99105
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs

    r17471 r17473  
    1717      return new ResultJsonItem() {
    1818        Name = res.ActualName,
    19         Value = res.ActualName,
    2019        Description = res.Description
    2120      };
     
    2423    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    2524      IResultParameter res = item as IResultParameter;
    26       res.ActualName = (string)data.Value;
     25      res.ActualName = data.Name;
    2726    }
    2827  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17443 r17473  
    1717    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    1818      new StringJsonItem() {
    19         Name = "[OverridableParamName]",
     19        //Name = "[OverridableParamName]",
     20        Name = value.ItemName,
    2021        Description = value.ItemDescription,
    2122        Value = ((StringValue)value).Value
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17471 r17473  
    1313    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1414      IValueLookupParameter param = item as IValueLookupParameter;
    15       param.ActualName = CastValue<string>(((IValueLookupJsonItem)data).ActualName);
     15      IValueLookupJsonItem lookupItem = data as IValueLookupJsonItem;
     16      param.ActualName = lookupItem.ActualName;
    1617      if (param.Value != null)
    17         root.Inject(param.Value, data, root);
     18        root.Inject(param.Value, lookupItem.JsonItemReference, root);
    1819    }
    1920
     
    2526      if (param.Value != null) {
    2627        IJsonItem tmp = root.Extract(param.Value, root);
    27         item.Value = tmp.Value;
    28         item.Range = tmp.Range;
    29         item.Name = tmp.Name;
    30         item.Description = tmp.Description;
    3128        item.AddChildren(tmp.Children);
    32         item.Active = tmp.Active;
    3329        item.JsonItemReference = tmp;
    34       } else {
    35         var min = GetMinValue(param.DataType);
    36         var max = GetMaxValue(param.DataType);
    37         if (min != null && max != null)
    38           item.Range = new object[] { min, max };
    39         else
    40           item.Range = null;
    4130      }
    4231      item.Name = param.Name;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17439 r17473  
    1414      IParameter parameter = value as IParameter;
    1515
    16       if (parameter.ActualValue == null && data.Value != null)
     16      if (parameter.ActualValue == null)
    1717        parameter.ActualValue = Instantiate(parameter.DataType);
    1818
     
    2121            root.Inject(parameter.ActualValue, data, root);
    2222          else
    23             root.Inject(parameter.ActualValue, data.Children?.First(), root);
     23            root.Inject(parameter.ActualValue, /*data.Children?.First()*/ data, root);
    2424         
    2525      }
     
    2929      IParameter parameter = value as IParameter;
    3030
    31       IJsonItem item = new JsonItem() {
     31      IJsonItem item = new EmptyJsonItem() {
    3232        Name = parameter.Name,
    3333        Description = parameter.Description
     
    3737        IJsonItem tmp = root.Extract(parameter.ActualValue, root);
    3838        if (!(tmp is UnsupportedJsonItem)) {
     39          tmp.Name = parameter.Name;
     40          tmp.Description = parameter.Description;
     41          item = tmp;
     42          /*
    3943          if (tmp.Name == "[OverridableParamName]") {
    4044            tmp.Name = parameter.Name;
     
    4448          } else
    4549            item.AddChildren(tmp);
     50            */
    4651        }
    4752      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs

    r17451 r17473  
    1818      IntRange range = item as IntRange;
    1919      IntRangeJsonItem cdata = data as IntRangeJsonItem;
    20       range.Start = cdata.Value[0];
    21       range.End = cdata.Value[1];
     20      range.Start = cdata.MinValue;
     21      range.End = cdata.MaxValue;
    2222    }
    2323
     
    2525      IntRange range = value as IntRange;
    2626      return new IntRangeJsonItem() {
    27         Name = "[OverridableParamName]",
     27        //Name = "[OverridableParamName]",
     28        Name = value.ItemName,
    2829        Description = value.ItemDescription,
    29         Value = new int[] { range.Start, range.End },
    30         Range = new int[] { int.MinValue, int.MaxValue }
     30        MinValue = range.Start,
     31        MaxValue = range.End,
     32        Minimum = int.MinValue,
     33        Maximum = int.MaxValue
    3134      };
    3235    }
     
    4043      DoubleRange range = item as DoubleRange;
    4144      DoubleRangeJsonItem cdata = data as DoubleRangeJsonItem;
    42       range.Start = cdata.Value[0];
    43       range.End = cdata.Value[1];
     45      range.Start = cdata.MinValue;
     46      range.End = cdata.MaxValue;
    4447    }
    4548
     
    4750      DoubleRange range = value as DoubleRange;
    4851      return new DoubleRangeJsonItem() {
    49         Name = "[OverridableParamName]",
     52        //Name = "[OverridableParamName]",
     53        Name = value.ItemName,
    5054        Description = value.ItemDescription,
    51         Value = new double[] { range.Start, range.End },
    52         Range = new double[] { double.MinValue, double.MaxValue }
     55        MinValue = range.Start,
     56        MaxValue = range.End,
     57        Minimum = double.MinValue,
     58        Maximum = double.MaxValue
    5359      };
    5460    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs

    r17451 r17473  
    3030        Description = value.ItemDescription,
    3131        Value = ((IntArray)value).CloneAsArray(),
    32         Range = new int[] { int.MinValue, int.MaxValue }
     32        Minimum = int.MinValue,
     33        Maximum = int.MaxValue
    3334      };
    3435  }
     
    5657        Description = value.ItemDescription,
    5758        Value = ((DoubleArray)value).CloneAsArray(),
    58         Range = new double[] { double.MinValue, double.MaxValue }
     59        Minimum = double.MinValue,
     60        Maximum = double.MaxValue
    5961      };
    6062  }
     
    8082        Description = value.ItemDescription,
    8183        Value = ((PercentArray)value).CloneAsArray(),
    82         Range = new double[] { 0.0d, 1.0d }
     84        Minimum = 0.0d,
     85        Maximum = 1.0d
    8386      };
    8487  }
     
    101104    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    102105      new BoolArrayJsonItem() {
    103         Name = "[OverridableParamName]",
     106        //Name = "[OverridableParamName]",
     107        Name = value.ItemName,
    104108        Description = value.ItemDescription,
    105         Value = ((BoolArray)value).CloneAsArray(),
    106         Range = new bool[] { false, true }
     109        Value = ((BoolArray)value).CloneAsArray()
    107110      };
    108111  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs

    r17471 r17473  
    2323        Description = value.ItemDescription,
    2424        Value = Transform((IntMatrix)value),
    25         Range = new int[] { int.MinValue, int.MaxValue }
     25        Minimum = int.MinValue,
     26        Maximum = int.MaxValue
    2627      };
    2728  }
     
    4243        Description = value.ItemDescription,
    4344        Value = Transform((DoubleMatrix)value),
    44         Range = new double[] { double.MinValue, double.MaxValue },
     45        Minimum = double.MinValue,
     46        Maximum = double.MaxValue,
    4547        RowNames = ((DoubleMatrix)value).RowNames,
    4648        ColumnNames = ((DoubleMatrix)value).ColumnNames
     
    6365        Description = value.ItemDescription,
    6466        Value = Transform((PercentMatrix)value),
    65         Range = new double[] { 0.0d, 1.0d }
     67        Minimum = 0.0d,
     68        Maximum = 1.0d
    6669      };
    6770  }
     
    7982    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    8083      new BoolMatrixJsonItem() {
    81         Name = "[OverridableParamName]",
     84        //Name = "[OverridableParamName]",
     85        Name = value.ItemName,
    8286        Description = value.ItemDescription,
    83         Value = Transform((BoolMatrix)value),
    84         Range = new bool[] { false, true }
     87        Value = Transform((BoolMatrix)value)
    8588      };
    8689  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs

    r17433 r17473  
    1818    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    1919      new IntJsonItem() {
    20         Name = "[OverridableParamName]",
     20        //Name = "[OverridableParamName]",
     21        Name = value.ItemName,
    2122        Description = value.ItemDescription,
    2223        Value = ((IntValue)value).Value,
    23         Range = new int[] { int.MinValue, int.MaxValue }
     24        Minimum = int.MinValue,
     25        Maximum = int.MaxValue
    2426      };
    2527  }
     
    3436    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    3537      new DoubleJsonItem() {
    36         Name = "[OverridableParamName]",
     38        //Name = "[OverridableParamName]",
     39        Name = value.ItemName,
    3740        Description = value.ItemDescription,
    3841        Value = ((DoubleValue)value).Value,
    39         Range = new double[] { double.MinValue, double.MaxValue }
     42        Minimum = double.MinValue,
     43        Maximum = double.MaxValue
    4044      };
    4145  }
     
    5054    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    5155      new DoubleJsonItem() {
    52         Name = "[OverridableParamName]",
     56        //Name = "[OverridableParamName]",
     57        Name = value.ItemName,
    5358        Description = value.ItemDescription,
    5459        Value = ((PercentValue)value).Value,
    55         Range = new double[] { double.MinValue, double.MaxValue }
     60        Minimum = double.MinValue,
     61        Maximum = double.MaxValue
    5662      };
    5763  }
     
    6672    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    6773      new BoolJsonItem() {
    68         Name = "[OverridableParamName]",
     74        //Name = "[OverridableParamName]",
     75        Name = value.ItemName,
    6976        Description = value.ItemDescription,
    70         Value = ((BoolValue)value).Value,
    71         Range = new bool[] { false, true }
     77        Value = ((BoolValue)value).Value
    7278      };
    7379  }
     
    8288    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    8389      new DateTimeJsonItem() {
    84         Name = "[OverridableParamName]",
     90        //Name = "[OverridableParamName]",
     91        Name = value.ItemName,
    8592        Description = value.ItemDescription,
    8693        Value = ((DateTimeValue)value).Value,
    87         Range = new DateTime[] { DateTime.MinValue, DateTime.MaxValue }
     94        Minimum = DateTime.MinValue,
     95        Maximum = DateTime.MaxValue
    8896      };
    8997  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj

    r17471 r17473  
    6868    <Compile Include="Converters\ValueRangeConverter.cs" />
    6969    <Compile Include="Interfaces\IArrayJsonItem.cs" />
     70    <Compile Include="Interfaces\IConcreteRestrictedJsonItem.cs" />
     71    <Compile Include="Interfaces\IIntervalRestrictedJsonItem.cs" />
    7072    <Compile Include="Interfaces\IJsonItem.cs" />
    7173    <Compile Include="Interfaces\IJsonItemValidator.cs" />
    7274    <Compile Include="Interfaces\ILookupJsonItem.cs" />
    7375    <Compile Include="Interfaces\IMatrixJsonItem.cs" />
     76    <Compile Include="Interfaces\IRangedJsonItem.cs" />
    7477    <Compile Include="Interfaces\IResultJsonItem.cs" />
     78    <Compile Include="Interfaces\IValueJsonItem.cs" />
    7579    <Compile Include="Interfaces\IValueLookupJsonItem.cs" />
    76     <Compile Include="Models\ArrayJsonItemBase.cs" />
     80    <Compile Include="Models\ArrayJsonItem.cs" />
    7781    <Compile Include="Models\BoolJsonItems.cs" />
     82    <Compile Include="Models\ConcreteRestrictedArrayJsonItem.cs" />
     83    <Compile Include="Models\ConcreteRestrictedValueJsonItem.cs" />
    7884    <Compile Include="Models\DateTimeJsonItem.cs" />
    7985    <Compile Include="Models\DoubleJsonItems.cs" />
    80     <Compile Include="Models\GenericJsonItem.cs" />
     86    <Compile Include="Models\EmptyJsonItem.cs" />
     87    <Compile Include="Models\IntervalRestrictedArrayJsonItem.cs" />
     88    <Compile Include="Models\IntervalRestrictedMatrixJsonItem.cs" />
     89    <Compile Include="Models\IntervalRestrictedValueJsonItem.cs" />
    8190    <Compile Include="Models\IntJsonItems.cs" />
    8291    <Compile Include="Models\JsonItem.cs" />
    8392    <Compile Include="Models\LookupJsonItem.cs" />
    84     <Compile Include="Models\MatrixJsonItemBase.cs" />
     93    <Compile Include="Models\MatrixJsonItem.cs" />
     94    <Compile Include="Models\RangedJsonItem.cs" />
    8595    <Compile Include="Models\ResultJsonItem.cs" />
    8696    <Compile Include="Models\StringJsonItem.cs" />
    8797    <Compile Include="Models\UnsupportedJsonItem.cs" />
     98    <Compile Include="Models\ValueJsonItem.cs" />
    8899    <Compile Include="Models\ValueLookupJsonItem.cs" />
    89100    <Compile Include="SingleLineArrayJsonWriter.cs" />
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IArrayJsonItem.cs

    r17446 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public interface IArrayJsonItem : IJsonItem {
     8  public interface IArrayJsonItem : IValueJsonItem {
    99    bool Resizable { get; set; }
    1010  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs

    r17471 r17473  
    2424    IJsonItem Parent { get; set; }
    2525
    26     object Value { get; set; }
     26    //object Value { get; set; }
    2727
    28     IEnumerable<object> Range { get; set; }
     28    //IEnumerable<object> Range { get; set; }
    2929   
    3030    IJsonItemValidator GetValidator();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IMatrixJsonItem.cs

    r17471 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public interface IMatrixJsonItem : IJsonItem {
     8  public interface IMatrixJsonItem : IValueJsonItem {
    99    bool RowsResizable { get; set; }
    1010    bool ColumnsResizable { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCGenerator.cs

    r17471 r17473  
    6262      IEnumerable<IJsonItem> children = item.Children;
    6363     
    64       if (item.Active && (item.Value != null || item.Range != null || item is IResultJsonItem || item is ILookupJsonItem)) {
     64      if (item.Active && !(item is EmptyJsonItem)) {
    6565        jsonItems.Add(item);
    6666      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r17446 r17473  
    105105        instData.Objects.Add(tmp.Path, tmp);
    106106      }
     107      //IList<IJsonItem> faultyItems = new List<IJsonItem>();
     108      //root.GetValidator().Validate(ref faultyItems);
    107109    }
    108110   
     
    113115        // override default value
    114116        if (instData.Objects.TryGetValue(path, out IJsonItem param)) {
    115           // save range from template
    116           IEnumerable<object> tmpRange = param.Range;
     117          // remove fixed template parameter => dont allow to copy them from concrete config
     118          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Minimum))?.Remove();
     119          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Maximum))?.Remove();
     120          obj.Property(nameof(IConcreteRestrictedJsonItem<string>.ConcreteRestrictedItems))?.Remove();
     121          // merge
    117122          param.SetFromJObject(obj);
    118           // set range from template
    119           param.Range = tmpRange;
    120123        } else throw new InvalidDataException($"No parameter with path='{path}' defined!");
    121124      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ArrayJsonItem.cs

    r17472 r17473  
    77
    88namespace HeuristicLab.JsonInterface {
    9   public class ArrayJsonItemBase<T> : JsonItem<T[], T>, IArrayJsonItem {
     9  public abstract class ArrayJsonItem<T> : ValueJsonItem<T[]>, IArrayJsonItem {
    1010    public virtual bool Resizable { get; set; }
    1111    public override void SetFromJObject(JObject jObject) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/BoolJsonItems.cs

    r17446 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public class BoolJsonItem : JsonItem<bool> { }
     8  public class BoolJsonItem : ValueJsonItem<bool> {
     9    protected override bool Validate() => true;
     10  }
    911
    10   public class BoolArrayJsonItem : ArrayJsonItemBase<bool> { }
     12  public class BoolArrayJsonItem : ArrayJsonItem<bool> {
     13    protected override bool Validate() => true;
     14  }
    1115
    12   public class BoolMatrixJsonItem : MatrixJsonItemBase<bool> { }
     16  public class BoolMatrixJsonItem : MatrixJsonItem<bool> {
     17    protected override bool Validate() => true;
     18  }
    1319}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/DateTimeJsonItem.cs

    r17446 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public class DateTimeJsonItem : JsonItem<DateTime> { }
     8  public class DateTimeJsonItem : IntervalRestrictedValueJsonItem<DateTime> {
     9    protected override bool Validate() => Minimum.CompareTo(Value) >= 0 && Maximum.CompareTo(Value) <= 0;
     10  }
    911}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/DoubleJsonItems.cs

    r17471 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public class DoubleJsonItem : JsonItem<double> { }
    9   public class DoubleArrayJsonItem : ArrayJsonItemBase<double> { }
    10   public class DoubleRangeJsonItem : ArrayJsonItemBase<double> {
    11     public override bool Resizable { get => false; set { } }
    12   }
     8  public class DoubleJsonItem : IntervalRestrictedValueJsonItem<double> { }
     9  public class DoubleArrayJsonItem : IntervalRestrictedArrayJsonItem<double> { }
     10  public class DoubleRangeJsonItem : RangedJsonItem<double> { }
    1311
    14   public class DoubleMatrixJsonItem : MatrixJsonItemBase<double> {
     12  public class DoubleMatrixJsonItem : IntervalRestrictedMatrixJsonItem<double> {
     13    /*
    1514    protected override bool IsInRange() {
    1615      for (int c = 0; c < Value.Length; ++c) {
     
    2221      return true;
    2322    }
     23    */
    2424  }
    2525}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntJsonItems.cs

    r17471 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public class IntJsonItem : JsonItem<int> {
    9     //public new IEnumerable<int> Range { get; }
     8  public class IntJsonItem : IntervalRestrictedValueJsonItem<int> { }
     9  public class IntArrayJsonItem : IntervalRestrictedArrayJsonItem<int> { }
     10  public class IntRangeJsonItem : RangedJsonItem<int> { }
     11  public class IntMatrixJsonItem : IntervalRestrictedMatrixJsonItem<int> {
    1012    /*
    11     public int MinValue { get; set; }
    12     public int MaxValue { get; set; }
    13     */
    14   }
    15   public class IntArrayJsonItem : ArrayJsonItemBase<int> { }
    16   public class IntRangeJsonItem : ArrayJsonItemBase<int> {
    17     public override bool Resizable { get => false; set { } }
    18   }
    19   public class IntMatrixJsonItem : MatrixJsonItemBase<int> {
    20 
    2113    protected override bool IsInRange() {
    2214      for (int c = 0; c < Value.Length; ++c) {
     
    2820      return true;
    2921    }
     22    */
    3023  }
    3124}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs

    r17471 r17473  
    1111  /// Main data class for json interface.
    1212  /// </summary>
    13   public class JsonItem : IJsonItem {
     13  public abstract class JsonItem : IJsonItem {
    1414
    1515    public class JsonItemValidator : IJsonItemValidator {
     
    2525      }
    2626
     27      // TODO: return ValidationResult ?
    2728      private bool ValidateHelper(JsonItem item, ref IList<IJsonItem> faultyItems) {
    2829        int hash = item.GetHashCode();
     
    3031          return r;
    3132
    32         bool res = true;
    33         if (item.Value != null && item.Range != null)
    34           res = item.IsInRange();
     33        bool res = item.Validate();
    3534        if (!res) faultyItems.Add(item);
    3635        Cache.Add(hash, res);
    37         if(item.Children != null)
     36        if(item.Children != null) {
    3837          foreach (var child in item.Children)
    39             res = res && ValidateHelper(child as JsonItem, ref faultyItems);
     38            if (!ValidateHelper(child as JsonItem, ref faultyItems))
     39              res = false && res;
     40        }
    4041        return res;
    4142      }
     
    6263    }
    6364
    64     public virtual object Value { get; set; }
     65    //public virtual object Value { get; set; }
    6566
    66     public virtual IEnumerable<object> Range { get; set; }
     67    //public virtual IEnumerable<object> Range { get; set; }
    6768   
    6869    // TODO jsonIgnore dataType?
     
    105106
    106107    public virtual void SetFromJObject(JObject jObject) {
    107       Value = jObject[nameof(IJsonItem.Value)]?.ToObject<object>();
    108       Range = jObject[nameof(IJsonItem.Range)]?.ToObject<object[]>();
     108      //Value = jObject[nameof(IJsonItem.Value)]?.ToObject<object>();
     109      //Range = jObject[nameof(IJsonItem.Range)]?.ToObject<object[]>();
    109110    }
    110111    #endregion
     
    114115     * TODO protected abstract bool Validate();
    115116     */
    116      
     117    protected abstract bool Validate();
     118    /*
    117119    protected virtual bool IsInRange() {
    118120      bool b1 = true, b2 = true;
     
    156158        (((T)max).CompareTo(value) == 1 || ((T)max).CompareTo(value) == 0);
    157159    }
     160    */
    158161    #endregion
    159162  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/LookupJsonItem.cs

    r17471 r17473  
    1414      ActualName = jObject[nameof(ILookupJsonItem.ActualName)]?.ToString();
    1515    }
     16
     17    protected override bool Validate() => true;
    1618  }
    1719}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/MatrixJsonItem.cs

    r17472 r17473  
    77
    88namespace HeuristicLab.JsonInterface {
    9   public class MatrixJsonItemBase<T> : JsonItem<T[][], T>, IMatrixJsonItem {
     9  public abstract class MatrixJsonItem<T> : ValueJsonItem<T[][]>, IMatrixJsonItem {
    1010    public virtual bool RowsResizable { get; set; }
    1111    public virtual bool ColumnsResizable { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ResultJsonItem.cs

    r17471 r17473  
    77namespace HeuristicLab.JsonInterface {
    88  public class ResultJsonItem : JsonItem, IResultJsonItem {
    9 
     9    protected override bool Validate() => true;
    1010  }
    1111}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/StringJsonItem.cs

    r17451 r17473  
    66
    77namespace HeuristicLab.JsonInterface {
    8   public class StringJsonItem : JsonItem<string> { }
    9   public class StringArrayJsonItem : JsonItem<string[], string> { }
     8  public class StringJsonItem : ConcreteRestrictedValueJsonItem<string> { }
     9  public class StringArrayJsonItem : ConcreteRestrictedArrayJsonItem<string> { }
    1010}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/UnsupportedJsonItem.cs

    r17471 r17473  
    3434    }
    3535
    36     public override object Value {
    37       get => throw new NotSupportedException();
    38       set => throw new NotSupportedException();
    39     }
    40 
    41     public override IEnumerable<object> Range {
    42       get => throw new NotSupportedException();
    43       set => throw new NotSupportedException();
    44     }
     36    protected override bool Validate() => true;
    4537  }
    4638}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ValueLookupJsonItem.cs

    r17471 r17473  
    1010    [JsonIgnore]
    1111    public IJsonItem JsonItemReference { get; set; }
     12
     13    protected override bool Validate() {
     14      if (JsonItemReference == null) return true;
     15      IList<IJsonItem> faultyItems = new List<IJsonItem>();
     16      return JsonItemReference.GetValidator().Validate(ref faultyItems);
     17    }
    1218  }
    1319}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/SingleLineArrayJsonWriter.cs

    r17442 r17473  
    1919      base.Formatting = Formatting.Indented;
    2020      base.WritePropertyName(name);
    21       isRangeArray = name == nameof(IJsonItem.Range) || name == nameof(IJsonItem.Value);
     21      isRangeArray =
     22        name == nameof(IConcreteRestrictedJsonItem<int>.ConcreteRestrictedItems) ||
     23        name == nameof(IValueJsonItem.Value) ||
     24        name == nameof(IMatrixJsonItem.RowNames) ||
     25        name == nameof(IMatrixJsonItem.ColumnNames);
    2226    }
    2327
  • branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs

    r17451 r17473  
    4646
    4747      IJsonItem root = JsonItemConverter.Extract(alg);
    48       var x = root.Children[0];
    49       root.Children.Remove(x);
    50       x.Parent = null;
     48      ActivateJsonItems(root);
     49      //var x = root.Children[0];
     50      //root.Children.Remove(x);
     51      //x.Parent = null;
    5152
    5253
     
    6465     
    6566    }
     67
     68    private static void ActivateJsonItems(IJsonItem item) {
     69      item.Active = true;
     70      if(item.Children != null) {
     71        foreach (var x in item.Children)
     72          ActivateJsonItems(x);
     73      }
     74    }
    6675  }
    6776}
Note: See TracChangeset for help on using the changeset viewer.