Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/09/08 19:21:25 (16 years ago)
Author:
cbahner
Message:

#320 changed collections to generics; first persistence mechanism tests

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

Legend:

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

    r697 r726  
    11using System;
    22using System.Collections.Generic;
     3using System.IO;
    34using System.Linq;
     5using System.Runtime.Serialization;
    46using System.Text;
    5 using System.Collections.Specialized;
     7//using System.Collections.Specialized;
     8using System.Xml;
     9using System.Xml.Serialization;
     10using HeuristicLab.Core;
     11using HeuristicLab.Data;
    612
    713
     
    915  public class ChartDataRowsModel : ChartDataModelBase, IChartDataRowsModel {
    1016
    11     private readonly ListDictionary dataRows;
     17    private IntData test = new IntData(1);
    1218   
    1319    public ChartDataRowsModel(){
    1420
    15       dataRows = new ListDictionary();
     21      columns = new List<ChartDataRowsModelColumn>();
     22
     23
    1624    }
    1725
    1826    public void AddDataRow(int id){
    19       List<double> row = new List<double>();
    2027
    21       dataRows.Add(id, row);
     28      double[] vals = new double[]{};
     29
     30      ChartDataRowsModelColumn col = new ChartDataRowsModelColumn(id, vals);
     31
     32      columns.Add(col);
    2233    }
    2334
    2435    public void PushData(int dataRowId, double value){
    25         ((List<double>)dataRows[dataRowId]).Add(value);
    2636
     37      columns[dataRowId].Values[columns[dataRowId].Values.Length+1] = value;
     38    }
     39
     40    public override IView CreateView() {
     41      return new IntDataView(test);
    2742    }
    2843
     
    3550    }
    3651
     52    private List<ChartDataRowsModelColumn> columns;
     53
    3754    public List<ChartDataRowsModelColumn> Columns {
    38       get { throw new NotImplementedException(); }
     55      get { return columns; }
    3956    }
     57
     58
     59   
     60    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
     61
     62      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     63
     64      foreach (ChartDataRowsModelColumn column in Columns){
     65        XmlNode child = document.CreateNode(XmlNodeType.Element, "column", null);
     66        child.InnerText = "xx";
     67        node.AppendChild(child);
     68      }
     69     
     70      //node.InnerText = "test1";
     71      //test.Data = 11;
     72      return node;
     73
     74    }
     75
     76
     77    /*
     78    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
     79      base.Populate(node, restoredObjects);
     80      //Data = bool.Parse(node.InnerText);
     81    }
     82   */
    4083  }
    4184}
  • trunk/sources/HeuristicLab.Visualization/ChartDataRowsModelColumn.cs

    r697 r726  
    11namespace HeuristicLab.Visualization {
    22  public class ChartDataRowsModelColumn {
    3     public readonly int ColumnId;
    4     public readonly double[] Values;
     3    public int ColumnId;
     4    public double[] Values;
    55
    66    public ChartDataRowsModelColumn(int columnId, double[] values) {
  • trunk/sources/HeuristicLab.Visualization/ChartDataRowsModelDummy.cs

    r685 r726  
    55
    66namespace HeuristicLab.Visualization {
    7   class ChartDataRowsModelDummy : ChartDataRowsModel {
     7  public class ChartDataRowsModelDummy : ChartDataRowsModel {
    88
     9     public ChartDataRowsModelDummy(){
     10
     11        // test rows
     12        AddDataRow(1);
     13        AddDataRow(2);
     14        AddDataRow(3);
     15
     16     }
    917   
    1018  }
  • trunk/sources/HeuristicLab.Visualization/HeuristicLab.Visualization.csproj

    r724 r726  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{E392A1E2-DC95-4E33-B82E-8ED690EDA1AB}</ProjectGuid>
     
    9595      <Name>HeuristicLab.Core</Name>
    9696    </ProjectReference>
     97    <ProjectReference Include="..\HeuristicLab.Data\HeuristicLab.Data.csproj">
     98      <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
     99      <Name>HeuristicLab.Data</Name>
     100    </ProjectReference>
    97101    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
    98102      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
Note: See TracChangeset for help on using the changeset viewer.