Changeset 1287 for trunk/sources/HeuristicLab.DataAnalysis
- Timestamp:
- 03/08/09 12:48:18 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.DataAnalysis
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAnalysis/Dataset.cs
r534 r1287 52 52 public int Columns { 53 53 get { return columns; } 54 set { columns = value; } 54 set { 55 columns = value; 56 if (variableNames == null || variableNames.Length != columns) { 57 variableNames = new string[columns]; 58 } 59 } 55 60 } 56 61 … … 90 95 91 96 private string[] variableNames; 92 public string[] VariableNames {93 get { return variableNames; }94 set { variableNames = value; }95 }96 97 97 98 public Dataset() { 98 99 Name = "-"; 99 VariableNames = new string[] { "Var0" };100 variableNames = new string[] { "Var0" }; 100 101 Columns = 1; 101 102 Rows = 1; … … 114 115 } 115 116 } 117 118 public string GetVariableName(int variableIndex) { 119 return variableNames[variableIndex]; 120 } 121 122 public void SetVariableName(int variableIndex, string name) { 123 variableNames[variableIndex] = name; 124 } 125 116 126 117 127 public override IView CreateView() { … … 128 138 clone.Samples = cloneSamples; 129 139 clone.Name = Name; 130 clone. VariableNames = new string[VariableNames.Length];131 Array.Copy( VariableNames, clone.VariableNames, VariableNames.Length);140 clone.variableNames = new string[variableNames.Length]; 141 Array.Copy(variableNames, clone.variableNames, variableNames.Length); 132 142 Array.Copy(scalingFactor, clone.scalingFactor, columns); 133 143 Array.Copy(scalingOffset, clone.scalingOffset, columns); … … 165 175 columns = int.Parse(node.Attributes["Dimension2"].Value, CultureInfo.InvariantCulture.NumberFormat); 166 176 167 VariableNames = ParseVariableNamesString(node.Attributes["VariableNames"].Value);177 variableNames = ParseVariableNamesString(node.Attributes["VariableNames"].Value); 168 178 if(node.Attributes["ScalingFactors"] != null) 169 179 scalingFactor = ParseDoubleString(node.Attributes["ScalingFactors"].Value); -
trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs
r473 r1287 135 135 136 136 private string GetColumnName(int index) { 137 if(Dataset. VariableNames.Length== dataGridView.Columns.Count) {138 return Dataset. VariableNames[index];137 if(Dataset.Columns == dataGridView.Columns.Count) { 138 return Dataset.GetVariableName(index); 139 139 } else { 140 140 return "Var " + index; -
trunk/sources/HeuristicLab.DataAnalysis/HeuristicLab.DataAnalysis.csproj
r894 r1287 71 71 <Compile Include="Dataset.cs" /> 72 72 <Compile Include="DatasetParser.cs" /> 73 <Compile Include="DatasetShuffler.cs" /> 73 74 <Compile Include="DatasetView.cs"> 74 75 <SubType>UserControl</SubType> … … 97 98 <Name>HeuristicLab.Data</Name> 98 99 </ProjectReference> 100 <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj"> 101 <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project> 102 <Name>HeuristicLab.Operators</Name> 103 </ProjectReference> 99 104 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> 100 105 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 101 106 <Name>HeuristicLab.PluginInfrastructure</Name> 107 </ProjectReference> 108 <ProjectReference Include="..\HeuristicLab.Random\HeuristicLab.Random.csproj"> 109 <Project>{47019A74-F7F7-482E-83AA-D3F4F777E879}</Project> 110 <Name>HeuristicLab.Random</Name> 102 111 </ProjectReference> 103 112 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.