- Timestamp:
- 02/03/20 17:32:50 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 2 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/HeuristicLab.JsonInterface.OptimizerIntegration.csproj
r17417 r17420 97 97 <Compile Include="ViewModels\ArrayValueVM.cs" /> 98 98 <Compile Include="ViewModels\JsonItemVMBase.cs" /> 99 <Compile Include="ViewModels\RangedValueBaseVM.cs" /> 99 100 <Compile Include="ViewModels\RangeVM.cs" /> 100 101 <Compile Include="ViewModels\SingleValueVM.cs" /> … … 197 198 <EmbeddedResource Include="Views\ExportJsonDialog.resx"> 198 199 <DependentUpon>ExportJsonDialog.cs</DependentUpon> 200 </EmbeddedResource> 201 <EmbeddedResource Include="Views\JsonItemArrayValueControl.resx"> 202 <DependentUpon>JsonItemArrayValueControl.cs</DependentUpon> 199 203 </EmbeddedResource> 200 204 <EmbeddedResource Include="Views\JsonItemBoolControl.resx"> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
r17417 r17420 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel; 3 4 using System.Linq; 4 5 using System.Text; … … 6 7 7 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 public class ArrayValueVM : JsonItemVMBase { 9 10 public class DoubleArrayValueVM : ArrayValueVM<double> { 9 11 public override Type JsonItemType => typeof(DoubleArrayJsonItem); 10 public override JsonItemBaseControl GetControl() => new JsonItemArrayValueControl(this); 12 13 protected override double MinTypeValue => double.MinValue; 14 15 protected override double MaxTypeValue => double.MaxValue; 16 17 public override JsonItemBaseControl GetControl() => new JsonItemDoubleArrayValueControl(this); 18 19 protected override void OnItemChanged() { 20 IList<IndexedArrayValueVM> list = new List<IndexedArrayValueVM>(); 21 var arr = ((DoubleArrayJsonItem)Item).Value; 22 for(int i = 0; i < arr.Length; ++i) { 23 list.Add(new IndexedArrayValueVM(arr, i)); 24 } 25 Value = list.ToArray(); 26 } 27 } 28 29 public class IntArrayValueVM : ArrayValueVM<int> { 30 public override Type JsonItemType => typeof(IntArrayJsonItem); 31 32 protected override int MinTypeValue => int.MinValue; 33 34 protected override int MaxTypeValue => int.MaxValue; 35 36 public override JsonItemBaseControl GetControl() => new JsonItemIntArrayValueControl(this); 37 38 protected override void OnItemChanged() { 39 IList<IndexedArrayValueVM> list = new List<IndexedArrayValueVM>(); 40 var arr = ((IntArrayJsonItem)Item).Value; 41 for (int i = 0; i < arr.Length; ++i) { 42 list.Add(new IndexedArrayValueVM(arr, i)); 43 } 44 Value = list.ToArray(); 45 } 46 } 47 48 public abstract class ArrayValueVM<T> : RangedValueBaseVM<T> { 49 50 public class IndexedArrayValueVM : INotifyPropertyChanged { 51 private T[] arr; 52 private int index; 53 54 public IndexedArrayValueVM(T[] arr, int index) { 55 this.arr = arr; 56 this.index = index; 57 } 58 59 public T Value { 60 get => arr[index]; 61 set { 62 arr[index] = value; 63 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value))); 64 } 65 } 66 67 public event PropertyChangedEventHandler PropertyChanged; 68 } 69 70 public ArrayValueVM() { 71 base.ItemChanged += OnItemChanged; 72 } 73 74 protected abstract void OnItemChanged(); 75 76 IndexedArrayValueVM[] vms; 77 public IndexedArrayValueVM[] Value { 78 get => vms; 79 set { 80 vms = value; 81 OnPropertyChange(this, nameof(Value)); 82 } 83 } 11 84 } 12 85 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17412 r17420 9 9 public class JsonItemVMBase : INotifyPropertyChanged { 10 10 public event PropertyChangedEventHandler PropertyChanged; 11 public IJsonItem Item { get; set; } 11 public event Action ItemChanged; 12 13 private IJsonItem item; 14 public IJsonItem Item { 15 get => item; 16 set { 17 item = value; 18 ItemChanged?.Invoke(); 19 } 20 } 12 21 13 22 protected void OnPropertyChange(object sender, string propertyName) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs
r17412 r17420 9 9 10 10 public class IntRangeVM : RangeVM<int> { 11 public override Type JsonItemType => typeof(IntArrayJsonItem); 12 } 11 public override Type JsonItemType => typeof(IntRangeJsonItem); 13 12 14 public class DoubleRangeVM : RangeVM<double> { 15 public override Type JsonItemType => typeof(DoubleArrayJsonItem); 13 protected override int MinTypeValue => int.MinValue; 14 15 protected override int MaxTypeValue => int.MaxValue; 16 16 17 public override JsonItemBaseControl GetControl() => 17 18 new JsonItemRangeControl(this); 18 19 } 19 20 20 public abstract class RangeVM<T> : JsonItemVMBase { 21 public class DoubleRangeVM : RangeVM<double> { 22 public override Type JsonItemType => typeof(DoubleRangeJsonItem); 23 24 protected override double MinTypeValue => double.MinValue; 25 26 protected override double MaxTypeValue => double.MaxValue; 27 28 public override JsonItemBaseControl GetControl() => 29 new JsonItemRangeControl(this); 30 } 31 32 public abstract class RangeVM<T> : RangedValueBaseVM<T> { 21 33 22 34 public T MinValue { … … 36 48 } 37 49 38 public T MinRange {39 get => Cast(Item.Range.First());40 set {41 SetRange(value, Item.Range.Last());42 OnPropertyChange(this, nameof(MinRange));43 }44 }45 46 public T MaxRange {47 get => Cast(Item.Range.Last());48 set {49 SetRange(Item.Range.First(), value);50 OnPropertyChange(this, nameof(MaxRange));51 }52 }53 54 private T Cast(object obj) => (T)Convert.ChangeType(obj, typeof(T));55 56 50 private void SetValue(object min, object max) => 57 51 Item.Value = new object[] { min, max }; 58 59 private void SetRange(object min, object max) =>60 Item.Range = new object[] { min, max };61 52 } 62 53 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs
r17412 r17420 38 38 } 39 39 40 public abstract class SingleValueVM<T> : JsonItemVMBase{40 public abstract class SingleValueVM<T> : RangedValueBaseVM<T> { 41 41 42 42 public T Value { … … 47 47 } 48 48 } 49 50 public T MinRange {51 get => Cast(Item.Range.First());52 set {53 SetRange(value, Item.Range.Last());54 OnPropertyChange(this, nameof(MinRange));55 }56 }57 58 public T MaxRange {59 get => Cast(Item.Range.Last());60 set {61 SetRange(Item.Range.First(), value);62 OnPropertyChange(this, nameof(MaxRange));63 }64 }65 66 private bool enableMinRange = false;67 public bool EnableMinRange {68 get => enableMinRange;69 set {70 enableMinRange = value;71 if (!enableMinRange)72 MinRange = MinTypeValue;73 OnPropertyChange(this, nameof(EnableMinRange));74 }75 }76 77 private bool enableMaxRange = false;78 public bool EnableMaxRange {79 get => enableMaxRange;80 set {81 enableMaxRange = value;82 if (!enableMaxRange)83 MaxRange = MaxTypeValue;84 OnPropertyChange(this, nameof(EnableMaxRange));85 }86 }87 88 private T Cast(object obj) => (T)Convert.ChangeType(obj, typeof(T));89 90 private void SetRange(object min, object max) {91 object[] range = new object[] { min, max };92 Item.Range = range;93 }94 95 protected abstract T MinTypeValue { get; }96 protected abstract T MaxTypeValue { get; }97 49 } 98 50 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemArrayValueControl.Designer.cs
r17417 r17420 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 components = new System.ComponentModel.Container(); 26 this.dataGridView = new System.Windows.Forms.DataGridView(); 27 this.numericRangeControl1 = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl(); 28 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 29 this.SuspendLayout(); 30 // 31 // dataGridView 32 // 33 this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 34 | System.Windows.Forms.AnchorStyles.Left) 35 | System.Windows.Forms.AnchorStyles.Right))); 36 this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 37 this.dataGridView.Location = new System.Drawing.Point(9, 75); 38 this.dataGridView.Name = "dataGridView"; 39 this.dataGridView.Size = new System.Drawing.Size(487, 171); 40 this.dataGridView.TabIndex = 13; 41 // 42 // numericRangeControl1 43 // 44 this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 45 | System.Windows.Forms.AnchorStyles.Right))); 46 this.numericRangeControl1.Location = new System.Drawing.Point(9, 252); 47 this.numericRangeControl1.Name = "numericRangeControl1"; 48 this.numericRangeControl1.Size = new System.Drawing.Size(487, 128); 49 this.numericRangeControl1.TabIndex = 14; 50 // 51 // JsonItemArrayValueControl 52 // 53 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 27 54 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 55 this.Controls.Add(this.numericRangeControl1); 56 this.Controls.Add(this.dataGridView); 57 this.Name = "JsonItemArrayValueControl"; 58 this.Size = new System.Drawing.Size(502, 386); 59 this.Controls.SetChildIndex(this.dataGridView, 0); 60 this.Controls.SetChildIndex(this.numericRangeControl1, 0); 61 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); 62 this.ResumeLayout(false); 63 this.PerformLayout(); 64 28 65 } 29 66 30 67 #endregion 68 69 private System.Windows.Forms.DataGridView dataGridView; 70 private NumericRangeControl numericRangeControl1; 31 71 } 32 72 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemArrayValueControl.cs
r17417 r17420 10 10 11 11 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 12 public partial class JsonItemArrayValueControl : JsonItemBaseControl { 13 public JsonItemArrayValueControl(JsonItemVMBase vm) : base(vm) { 12 13 public class JsonItemIntArrayValueControl : JsonItemArrayValueControl { 14 public JsonItemIntArrayValueControl(IntArrayValueVM vm) : base(vm, vm.Value) { } 15 } 16 17 public class JsonItemDoubleArrayValueControl : JsonItemArrayValueControl { 18 public JsonItemDoubleArrayValueControl(DoubleArrayValueVM vm) : base(vm, vm.Value) { } 19 } 20 21 public abstract partial class JsonItemArrayValueControl : JsonItemBaseControl { 22 protected NumericRangeControl NumericRangeControl { get; set; } 23 24 public JsonItemArrayValueControl(JsonItemVMBase vm, object dataSource) : base(vm) { 14 25 InitializeComponent(); 26 dataGridView.DataSource = dataSource; 27 NumericRangeControl = numericRangeControl1; 28 29 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange)); 30 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange)); 31 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange), 32 false, DataSourceUpdateMode.OnPropertyChanged); 33 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange), 34 false, DataSourceUpdateMode.OnPropertyChanged); 15 35 } 16 36 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs
r17410 r17420 14 14 15 15 public JsonItemRangeControl(DoubleRangeVM vm) : base(vm) { 16 InitializeComponent(); 17 /* 18 this.isDouble = isDouble; 19 textBoxValueFrom.Text = ((Array)VM.Item.Value).GetValue(0).ToString(); 20 textBoxValueTo.Text = ((Array)VM.Item.Value).GetValue(1).ToString(); 21 textBoxValueFrom.Text = VM.Item.Range.First().ToString(); 22 textBoxValueTo.Text = VM.Item.Range.Last().ToString(); 23 */ 24 } 25 public JsonItemRangeControl(IntRangeVM vm) : base(vm) { 16 26 InitializeComponent(); 17 27 /* -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs
r17417 r17420 16 16 #region Overriden Properties 17 17 protected override string ValuePropertyId => nameof(IntValueVM.Value); 18 protected override string MinRangePropertyId => nameof(IntValueVM.MinRange);19 protected override string MaxRangePropertyId => nameof(IntValueVM.MaxRange);20 protected override string EnableMinRangePropertyId => nameof(IntValueVM.EnableMinRange);21 protected override string EnableMaxRangePropertyId => nameof(IntValueVM.EnableMaxRange);22 18 #endregion 23 19 … … 32 28 #region Overriden Properties 33 29 protected override string ValuePropertyId => nameof(DoubleValueVM.Value); 34 protected override string MinRangePropertyId => nameof(DoubleValueVM.MinRange);35 protected override string MaxRangePropertyId => nameof(DoubleValueVM.MaxRange);36 protected override string EnableMinRangePropertyId => nameof(DoubleValueVM.EnableMinRange);37 protected override string EnableMaxRangePropertyId => nameof(DoubleValueVM.EnableMaxRange);38 30 #endregion 39 31 … … 52 44 #region Abstract Properties 53 45 protected abstract string ValuePropertyId { get; } 54 protected abstract string MinRangePropertyId { get; }55 protected abstract string MaxRangePropertyId { get; }56 protected abstract string EnableMinRangePropertyId { get; }57 protected abstract string EnableMaxRangePropertyId { get; }58 46 #endregion 59 47 … … 66 54 protected void Init() { 67 55 TBValue.DataBindings.Add("Text", base.VM, ValuePropertyId); 68 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, MinRangePropertyId);69 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, MaxRangePropertyId);70 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, EnableMinRangePropertyId,56 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange)); 57 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange)); 58 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange), 71 59 false, DataSourceUpdateMode.OnPropertyChanged); 72 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, EnableMaxRangePropertyId,60 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange), 73 61 false, DataSourceUpdateMode.OnPropertyChanged); 74 62 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs
r17407 r17420 25 25 IAlgorithm algorithm = value as IAlgorithm; 26 26 foreach (var res in algorithm.Results) { 27 item.AddChild s(new ResultItem() {27 item.AddChildren(new ResultItem() { 28 28 Name = res.Name, 29 29 Value = true, … … 31 31 }); 32 32 } 33 item.AddChild s(root.Extract(algorithm.Problem, root));33 item.AddChildren(root.Extract(algorithm.Problem, root)); 34 34 return item; 35 35 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs
r17410 r17420 35 35 Range = GetValidValues(parameter).Select(x => x.ToString()) 36 36 }; 37 item.AddChild s(GetParameterizedChilds(parameter));37 item.AddChildren(GetParameterizedChilds(parameter)); 38 38 39 39 return item; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs
r17410 r17420 24 24 dynamic val = value as dynamic; 25 25 foreach (var op in val.Operators) { 26 item.AddChild s(new BoolJsonItem() {26 item.AddChildren(new BoolJsonItem() { 27 27 Name = op.Name, 28 28 Value = val.Operators.ItemChecked(op), -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs
r17410 r17420 29 29 IJsonItem tmp = root.Extract(param, root); 30 30 if (!(tmp is UnsupportedJsonItem)) 31 item.AddChild s(tmp);31 item.AddChildren(tmp); 32 32 } 33 33 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r17407 r17420 27 27 FieldInfo dataInfo = dataset.GetType().GetField("storableData", flags); 28 28 // TODO: aufteilen in trainings und test daten abschnitte 29 item.AddChild s(new JsonItem() {29 item.AddChildren(new JsonItem() { 30 30 Name = "Dataset", 31 31 Value = dataInfo.GetValue(dataset) … … 33 33 34 34 IEnumerable<StringValue> variables = (IEnumerable<StringValue>)val.InputVariables; 35 item.AddChild s(new JsonItem() {35 item.AddChildren(new JsonItem() { 36 36 Name = "TargetVariable", 37 37 Value = (object)targetVariable, … … 40 40 41 41 42 item.AddChild s(new JsonItem() {42 item.AddChildren(new JsonItem() { 43 43 Name = "AllowedInputVariables", 44 44 Value = (object)val.AllowedInputVariables, -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs
r17407 r17420 21 21 IValueLookupParameter param = value as IValueLookupParameter; 22 22 23 IJsonItem item = new JsonItem() { 24 Name = param.Name, 25 ActualName = param.ActualName 26 }; 23 IJsonItem item = new JsonItem() {}; 27 24 28 object actualValue = null;29 IEnumerable<object> actualRange = null;30 25 if (param.Value != null) { 31 26 IJsonItem tmp = root.Extract(param.Value, root); 32 tmp.Parent = item;27 /*tmp.Parent = item; 33 28 actualValue = tmp.Value; 34 29 actualRange = tmp.Range; 30 */ 31 item = tmp; 35 32 } else { 36 actualRange = new object[] { GetMinValue(param.DataType), GetMaxValue(param.DataType) };33 item.Range = new object[] { GetMinValue(param.DataType), GetMaxValue(param.DataType) }; 37 34 } 38 item. Value = actualValue;39 item. Range = actualRange;35 item.Name = param.Name; 36 item.ActualName = param.ActualName; 40 37 return item; 41 38 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs
r17410 r17420 34 34 //JsonItem.Merge(item as JsonItem, tmp as JsonItem); 35 35 } else 36 item.AddChild s(tmp);36 item.AddChildren(tmp); 37 37 } 38 38 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs
r17410 r17420 24 24 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { 25 25 IntRange range = value as IntRange; 26 return new Int ArrayJsonItem() {26 return new IntRangeJsonItem() { 27 27 Name = "[OverridableParamName]", 28 28 Value = new int[] { range.Start, range.End }, … … 45 45 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { 46 46 DoubleRange range = value as DoubleRange; 47 return new Double ArrayJsonItem() {47 return new DoubleRangeJsonItem() { 48 48 Name = "[OverridableParamName]", 49 49 Value = new double[] { range.Start, range.End }, -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs
r17417 r17420 28 28 new IntArrayJsonItem() { 29 29 Name = "[OverridableParamName]", 30 Value = ((IntArray)value).CloneAsArray() 30 Value = ((IntArray)value).CloneAsArray(), 31 Range = new int[] { int.MinValue, int.MaxValue } 31 32 }; 32 33 } … … 50 51 new DoubleArrayJsonItem() { 51 52 Name = "[OverridableParamName]", 52 Value = ((DoubleArray)value).CloneAsArray() 53 Value = ((DoubleArray)value).CloneAsArray(), 54 Range = new double[] { double.MinValue, double.MaxValue } 53 55 }; 54 56 } … … 72 74 new DoubleArrayJsonItem() { 73 75 Name = "[OverridableParamName]", 74 Value = ((PercentArray)value).CloneAsArray() 76 Value = ((PercentArray)value).CloneAsArray(), 77 Range = new double[] { 0.0d, 1.0d } 75 78 }; 76 79 } … … 94 97 new BoolArrayJsonItem() { 95 98 Name = "[OverridableParamName]", 96 Value = ((BoolArray)value).CloneAsArray() 99 Value = ((BoolArray)value).CloneAsArray(), 100 Range = new bool[] { false, true } 97 101 }; 98 102 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs
r17417 r17420 21 21 new IntMatrixJsonItem() { 22 22 Name = "[OverridableParamName]", 23 Value = Transform((IntMatrix)value) 23 Value = Transform((IntMatrix)value), 24 Range = new int[] { int.MinValue, int.MaxValue } 24 25 }; 25 26 } … … 38 39 new DoubleMatrixJsonItem() { 39 40 Name = "[OverridableParamName]", 40 Value = Transform((DoubleMatrix)value) 41 Value = Transform((DoubleMatrix)value), 42 Range = new double[] { double.MinValue, double.MaxValue } 41 43 }; 42 44 } … … 55 57 new DoubleMatrixJsonItem() { 56 58 Name = "[OverridableParamName]", 57 Value = Transform((PercentMatrix)value) 59 Value = Transform((PercentMatrix)value), 60 Range = new double[] { 0.0d, 1.0d } 58 61 }; 59 62 } … … 72 75 new BoolMatrixJsonItem() { 73 76 Name = "[OverridableParamName]", 74 Value = Transform((BoolMatrix)value) 77 Value = Transform((BoolMatrix)value), 78 Range = new bool[] { false, true } 75 79 }; 76 80 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs
r17406 r17420 15 15 16 16 [JsonIgnore] 17 IList<IJsonItem> Children { get; } 17 IList<IJsonItem> Children { get; } //TODO: IEnumerable 18 18 19 19 [JsonIgnore] … … 28 28 IJsonItemValidator GetValidator(); 29 29 30 void AddChild s(params IJsonItem[] childs);30 void AddChildren(params IJsonItem[] childs); 31 31 32 void AddChild s(IEnumerable<IJsonItem> childs);32 void AddChildren(IEnumerable<IJsonItem> childs); 33 33 } 34 34 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs
r17410 r17420 2 2 using System.Collections; 3 3 using System.Collections.Generic; 4 using System.IO;5 4 using System.Linq; 6 5 using System.Text; 7 using System.Threading.Tasks;8 using HeuristicLab.Core;9 6 using Newtonsoft.Json; 10 using Newtonsoft.Json.Linq;11 7 12 8 namespace HeuristicLab.JsonInterface { … … 74 70 75 71 public JsonItem(IEnumerable<IJsonItem> childs) { 76 AddChild s(childs);72 AddChildren(childs); 77 73 } 78 74 #endregion … … 94 90 95 91 #region Public Methods 96 public void AddChild s(params IJsonItem[] childs) =>97 AddChild s(childs as IEnumerable<IJsonItem>);92 public void AddChildren(params IJsonItem[] childs) => 93 AddChildren(childs as IEnumerable<IJsonItem>); 98 94 99 public void AddChild s(IEnumerable<IJsonItem> childs) {95 public void AddChildren(IEnumerable<IJsonItem> childs) { 100 96 if (Children == null) 101 97 Children = new List<IJsonItem>(); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItems.cs
r17417 r17420 8 8 public class IntJsonItem : JsonItem<int> {} 9 9 public class IntArrayJsonItem: JsonItem<int[], int> { } 10 public class IntRangeJsonItem : JsonItem<int[], int> { } 10 11 public class IntMatrixJsonItem : JsonItem<int[][], int> { } 11 12 12 13 public class DoubleJsonItem: JsonItem<double> {} 13 14 public class DoubleArrayJsonItem: JsonItem<double[], double> { } 15 public class DoubleRangeJsonItem : JsonItem<double[], double> { } 14 16 public class DoubleMatrixJsonItem : JsonItem<double[][], double> { } 15 17
Note: See TracChangeset
for help on using the changeset viewer.