Free cookie consent management tool by TermsFeed Policy Generator

Changeset 677 for trunk


Ignore:
Timestamp:
10/17/08 10:54:57 (16 years ago)
Author:
mkommend
Message:

PointXYChart refactored to use generic ItemList instead of Itemlist<ItemList<DoubleArrayData>> (ticket #310)

Location:
trunk/sources/HeuristicLab.Logging
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Logging/PointXYChart.cs

    r671 r677  
    2929namespace HeuristicLab.Logging {
    3030  public class PointXYChart : ItemBase, IVisualizationItem {
    31     private ItemList<ItemList<DoubleArrayData>> myValues;
    32     public ItemList<ItemList<DoubleArrayData>> Values {
     31    private ItemList myValues;
     32    public ItemList Values {
    3333      get { return myValues; }
    3434      set {
     
    5656      myConnectDots = new BoolData(true);
    5757    }
    58     public PointXYChart(bool connectDots,ItemList<ItemList<DoubleArrayData>> values) {
     58    public PointXYChart(bool connectDots,ItemList values) {
    5959      myConnectDots = new BoolData(connectDots);
    6060      myValues = values;
     
    6363    public override object Clone(IDictionary<Guid, object> clonedObjects) {
    6464      PointXYChart clone = (PointXYChart)base.Clone(clonedObjects);
    65       clone.myValues = (ItemList<ItemList<DoubleArrayData>>)Auxiliary.Clone(Values, clonedObjects);
     65      clone.myValues = (ItemList)Auxiliary.Clone(Values, clonedObjects);
    6666      return clone;
    6767    }
     
    9292      base.Populate(node, restoredObjects);
    9393      myConnectDots = (BoolData)PersistenceManager.Restore(node.SelectSingleNode("ConnectDots"), restoredObjects);
    94       myValues = (ItemList<ItemList<DoubleArrayData>>)PersistenceManager.Restore(node.SelectSingleNode("Values"), restoredObjects);
     94      myValues = (ItemList)PersistenceManager.Restore(node.SelectSingleNode("Values"), restoredObjects);
    9595    }
    9696    #endregion
  • trunk/sources/HeuristicLab.Logging/PointXYChartInjector.cs

    r671 r677  
    3838      AddVariableInfo(connectDotsInfo);
    3939      AddVariable(new Variable("ConnectDots", new BoolData(true)));
    40       AddVariableInfo(new VariableInfo("Values", "Item list holding the values of the pointXYchart", typeof(ItemList<ItemList<DoubleArrayData>>), VariableKind.In));
     40      AddVariableInfo(new VariableInfo("Values", "Item list holding the values of the pointXYchart", typeof(ItemList), VariableKind.In));
    4141      AddVariableInfo(new VariableInfo("PointXYchart", "Object representing a pointXYchart", typeof(PointXYChart), VariableKind.New | VariableKind.Out));
    4242    }
     
    4444    public override IOperation Apply(IScope scope) {
    4545      bool connectDots = GetVariableValue<BoolData>("ConnectDots", scope, true).Data;
    46       ItemList<ItemList<DoubleArrayData>> values = GetVariableValue<ItemList<ItemList<DoubleArrayData>>>("Values", scope, true);
     46      ItemList values = GetVariableValue<ItemList>("Values", scope, true);
    4747      PointXYChart pointXYchart = GetVariableValue<PointXYChart>("PointXYchart", scope, false, false);
    4848      if (pointXYchart == null) {
  • trunk/sources/HeuristicLab.Logging/PointXYChartView.cs

    r673 r677  
    9999
    100100        for (int i = 0; i < PointXYChart.Values.Count; i++) {
    101           ItemList<DoubleArrayData> list = (ItemList<DoubleArrayData>)PointXYChart.Values[i];
     101          ItemList list = (ItemList) PointXYChart.Values[i];
    102102          for (int j = 0; j < list.Count; j++) {
    103             double[] value = ((DoubleArrayData)list[j]).Data;
    104             if (!double.IsInfinity(value[0]) && !double.IsNaN(value[0]) && !double.IsInfinity(value[1]) && !double.IsNaN(value[1])) {
    105               if (value[0] < minX) minX = value[0];
    106               if (value[0] > maxX) maxX = value[0];
    107               if (value[1] < minY) minY = value[1];
    108               if (value[1] > maxY) maxY = value[1];
     103           ItemList value = ((ItemList)list[j]);
     104           double x = ((DoubleData)value[0]).Data;
     105           double y = ((DoubleData)value[1]).Data;
     106            if (!double.IsInfinity(x) && !double.IsNaN(x) && !double.IsInfinity(y) && !double.IsNaN(y)) {
     107              if (x < minX) minX = x;
     108              if (x > maxX) maxX = x;
     109              if (y < minY) minY = y;
     110              if (y > maxY) maxY = y;
    109111
    110               datachart.AddDataPoint(i, value[0], value[1]);                                                         
     112              datachart.AddDataPoint(i, x, y);                                                         
    111113            }
    112114          }
Note: See TracChangeset for help on using the changeset viewer.