Changeset 5877


Ignore:
Timestamp:
03/30/11 01:39:37 (11 years ago)
Author:
swagner
Message:

Adapted DataTableValuesCollector in order to be able to specify the start index of the collected data values (#1457)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTableValuesCollector.cs

    r5445 r5877  
    3939      get { return (ValueLookupParameter<DataTable>)Parameters["DataTable"]; }
    4040    }
     41    private IFixedValueParameter<BoolValue> StartIndexZeroParameter {
     42      get { return (FixedValueParameter<BoolValue>)Parameters["StartIndexZero"]; }
     43    }
     44
     45    public bool StartIndexZero {
     46      get { return StartIndexZeroParameter.Value.Value; }
     47      set { StartIndexZeroParameter.Value.Value = value; }
     48    }
    4149
    4250    #region Storing & Cloning
     
    5159      : base() {
    5260      Parameters.Add(new ValueLookupParameter<DataTable>("DataTable", "The table of data values where the collected values should be stored."));
     61      Parameters.Add(new FixedValueParameter<BoolValue>("StartIndexZero", "True, if the collected data values should start with index 0, otherwise false.", new BoolValue(true), false));
     62      StartIndexZeroParameter.Hidden = true;
     63    }
     64
     65    [StorableHook(HookType.AfterDeserialization)]
     66    private void AfterDeserialization() {
     67      // BackwardsCompatibility3.3
     68      #region Backwards compatible code (remove with 3.4)
     69      if (!Parameters.ContainsKey("StartIndexZero")) {
     70        Parameters.Add(new FixedValueParameter<BoolValue>("StartIndexZero", "True, if the collected data values should start with index 0, otherwise false.", new BoolValue(true), false));
     71        StartIndexZeroParameter.Hidden = true;
     72      }
     73      #endregion
    5374    }
    5475
     
    104125      if (row == null) {
    105126        row = new DataRow(name, description);
     127        row.VisualProperties.StartIndexZero = StartIndexZero;
    106128        row.Values.Add(data);
    107129        table.Rows.Add(row);
Note: See TracChangeset for help on using the changeset viewer.