Free cookie consent management tool by TermsFeed Policy Generator

Changeset 864


Ignore:
Timestamp:
11/29/08 12:28:22 (15 years ago)
Author:
cbahner
Message:

#318 implemented interfaces + new datarowdummy model

Location:
trunk/sources/HeuristicLab.Visualization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs

    r859 r864  
    11using System;
    22using System.Collections.Generic;
     3using System.Globalization;
    34using System.Xml;
    45using HeuristicLab.Core;
     
    129130    }
    130131
    131    
    132 
    133132    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    134133      throw new NotImplementedException();
    135 
    136 //      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    137 //
    138 //      foreach (ChartDataRowsModelColumn column in Columns){
    139 //        XmlNode columnElement = document.CreateNode(XmlNodeType.Element, "column", null);
    140 //
    141 //        XmlAttribute idAttr = document.CreateAttribute("id");
    142 //        idAttr.Value = (column.ColumnId).ToString();
    143 //        columnElement.Attributes.Append(idAttr);
    144 //
    145 //        for (int i = 0; i < column.Values.Length; i++){
    146 //          if (i == 0){
    147 //            columnElement.InnerText += column.Values[i].ToString(CultureInfo.InvariantCulture.NumberFormat);
    148 //          } else{
    149 //            columnElement.InnerText += ";" + column.Values[i].ToString(CultureInfo.InvariantCulture.NumberFormat);
    150 //          }
    151 //        }
    152 //        node.AppendChild(columnElement);
    153 //      }
    154 //     
    155 //      return node;
     134     
    156135    }
    157136
    158 
    159    
    160137    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    161138      throw new NotImplementedException();
    162139
    163 //      base.Populate(node, restoredObjects);
    164 //
    165 //      foreach (XmlNode column in node.ChildNodes){
    166 //        XmlAttributeCollection attrs = column.Attributes;
    167 //        XmlAttribute rowIdAttr = (XmlAttribute)attrs.GetNamedItem("id");
    168 //        int rowId = int.Parse(rowIdAttr.Value);
    169 //        AddDataRow(rowId);
    170 //        string[] tokens = column.InnerText.Split(';');
    171 //        double[] data = new double[tokens.Length];
    172 //        for (int i = 0; i < data.Length; i++){
    173 //          if (tokens[i].Length != 0){
    174 //            if (
    175 //              double.TryParse(tokens[i], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data[i]) ==
    176 //              false){
    177 //              throw new FormatException("Can't parse " + tokens[i] + " as double value.");
    178 //            }
    179 //          }
    180 //        }
    181 //        Columns[rowId-1].Values = data;
    182 //      }
    183140    }
    184141  }
  • trunk/sources/HeuristicLab.Visualization/ChartDataRowsModelDummy.cs

    r761 r864  
    11using System;
    22using System.Collections.Generic;
     3using System.Drawing;
    34using System.Linq;
    45using System.Text;
     
    67namespace HeuristicLab.Visualization{
    78  public class ChartDataRowsModelDummy : ChartDataRowsModel  {
     9   
    810    public ChartDataRowsModelDummy(){
    911      Random rand = new Random();
    1012
    11       // TODO an neues model interface anpassen   
    12       throw new NotImplementedException();
     13      // test rows
    1314
    14       // test rows
    15 //      for (int i = 0; i < 10; i++){
    16 //        AddDataRow(i);
    17 //        PushData(i, rand.NextDouble() * 1000);
    18 //        PushData(i, rand.NextDouble() * 1000);
    19 //        PushData(i, rand.NextDouble() * 1000);
    20 //      }
     15      // TODO change to call new DataRow("Datarow 1");
     16      DataRow row1 = new DataRow();
     17      row1.Label = "Datarow 1";
     18      row1.Color = Color.Red;
     19      DataRow row2 = new DataRow();
     20      row2.Label = "Datarow 2";
     21      row2.Color = Color.Blue;
     22      DataRow row3 = new DataRow();
     23      row3.Label = "Datarow 3";
     24      row3.Color = Color.DeepPink;
     25
     26      AddDataRow(row1);
     27      AddDataRow(row2);
     28      AddDataRow(row3);
     29     
     30      for (int i = 0; i < 10; i++){
     31
     32        // TODO Test AddDataRow mit bereits befüllter Row
     33
     34        row1.AddValue(rand.NextDouble() * 100);
     35        row2.AddValues(new double[] { rand.NextDouble() * 100, 
     36          rand.NextDouble() * 100 });
     37        row3.AddValue(11.0);
     38        // TODO after implemention of modifyValue: row1.ModifyValue(row1.getval[i]+100, i);
     39      }
    2140    }
    2241  }
Note: See TracChangeset for help on using the changeset viewer.