Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/04/21 17:04:01 (2 years ago)
Author:
dpiringe
Message:

#3026

  • added the dockerhub readme file
  • fixed a bug which caused changed values (changed by events) to be overwritten with wrong values
File:
1 edited

Legend:

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

    r18043 r18077  
    1212
    1313    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    14       IntArray arr = item as IntArray;
    15       IntArrayJsonItem intArrayItem = data as IntArrayJsonItem;
    16       bool resizeTmp = arr.Resizable;
    17       arr.Resizable = true;
    18       arr.Length = intArrayItem.Value.Length;
    19       for (int i = 0; i < intArrayItem.Value.Length; ++i)
    20         arr[i] = intArrayItem.Value[i];
    21       arr.Resizable = resizeTmp;
     14      if(data.Active) {
     15        IntArray arr = item as IntArray;
     16        IntArrayJsonItem intArrayItem = data as IntArrayJsonItem;
     17        bool resizeTmp = arr.Resizable;
     18        arr.Resizable = true;
     19        arr.Length = intArrayItem.Value.Length;
     20        for (int i = 0; i < intArrayItem.Value.Length; ++i)
     21          arr[i] = intArrayItem.Value[i];
     22        arr.Resizable = resizeTmp;
     23      }
    2224    }
    2325
     
    3941
    4042    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    41       DoubleArray arr = item as DoubleArray;
    42       DoubleArrayJsonItem doubleArrayItem = data as DoubleArrayJsonItem;
    43       bool resizeTmp = arr.Resizable;
    44       arr.Resizable = true;
    45       arr.Length = doubleArrayItem.Value.Length;
    46       for (int i = 0; i < doubleArrayItem.Value.Length; ++i)
    47         arr[i] = doubleArrayItem.Value[i];
    48       arr.Resizable = resizeTmp;
     43      if(data.Active) {
     44        DoubleArray arr = item as DoubleArray;
     45        DoubleArrayJsonItem doubleArrayItem = data as DoubleArrayJsonItem;
     46        bool resizeTmp = arr.Resizable;
     47        arr.Resizable = true;
     48        arr.Length = doubleArrayItem.Value.Length;
     49        for (int i = 0; i < doubleArrayItem.Value.Length; ++i)
     50          arr[i] = doubleArrayItem.Value[i];
     51        arr.Resizable = resizeTmp;
     52      }
    4953    }
    5054
     
    6670
    6771    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    68       PercentArray arr = item as PercentArray;
    69       DoubleArrayJsonItem doubleArrayItem = data as DoubleArrayJsonItem;
    70       bool resizeTmp = arr.Resizable;
    71       arr.Resizable = true;
    72       arr.Length = doubleArrayItem.Value.Length;
    73       for (int i = 0; i < doubleArrayItem.Value.Length; ++i)
    74         arr[i] = doubleArrayItem.Value[i];
    75       arr.Resizable = resizeTmp;
     72      if(data.Active) {
     73        PercentArray arr = item as PercentArray;
     74        DoubleArrayJsonItem doubleArrayItem = data as DoubleArrayJsonItem;
     75        bool resizeTmp = arr.Resizable;
     76        arr.Resizable = true;
     77        arr.Length = doubleArrayItem.Value.Length;
     78        for (int i = 0; i < doubleArrayItem.Value.Length; ++i)
     79          arr[i] = doubleArrayItem.Value[i];
     80        arr.Resizable = resizeTmp;
     81      }
    7682    }
    7783
     
    9399
    94100    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    95       BoolArray arr = item as BoolArray;
    96       BoolArrayJsonItem boolArrayItem = data as BoolArrayJsonItem;
    97       bool resizeTmp = arr.Resizable;
    98       arr.Resizable = true;
    99       arr.Length = boolArrayItem.Value.Length;
    100       for(int i = 0; i < boolArrayItem.Value.Length; ++i)
    101         arr[i] = boolArrayItem.Value[i];
    102       arr.Resizable = resizeTmp;
     101      if(data.Active) {
     102        BoolArray arr = item as BoolArray;
     103        BoolArrayJsonItem boolArrayItem = data as BoolArrayJsonItem;
     104        bool resizeTmp = arr.Resizable;
     105        arr.Resizable = true;
     106        arr.Length = boolArrayItem.Value.Length;
     107        for (int i = 0; i < boolArrayItem.Value.Length; ++i)
     108          arr[i] = boolArrayItem.Value[i];
     109        arr.Resizable = resizeTmp;
     110      }
    103111    }
    104112
Note: See TracChangeset for help on using the changeset viewer.