- Timestamp:
- 07/23/17 11:17:18 (8 years ago)
- Location:
- branches/Async
- Files:
-
- 2 deleted
- 32 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs
r12509 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r12817 r15281 121 121 <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon> 122 122 </Compile> 123 <Compile Include=" MathSymbolicDataAnalysisModelView.cs">124 <SubType>UserControl</SubType> 125 </Compile> 126 <Compile Include=" MathSymbolicDataAnalysisModelView.designer.cs">127 <DependentUpon> MathSymbolicDataAnalysisModelView.cs</DependentUpon>123 <Compile Include="SymbolicDataAnalysisModelMathView.cs"> 124 <SubType>UserControl</SubType> 125 </Compile> 126 <Compile Include="SymbolicDataAnalysisModelMathView.designer.cs"> 127 <DependentUpon>SymbolicDataAnalysisModelMathView.cs</DependentUpon> 128 128 </Compile> 129 129 <Compile Include="Plugin.cs" /> -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 187 187 this.treeChart.Name = "treeChart"; 188 188 this.treeChart.Size = new System.Drawing.Size(201, 348); 189 this.treeChart.Spacing = 5;190 189 this.treeChart.SuspendRepaint = false; 191 190 this.treeChart.TabIndex = 0; -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 112 112 treeChart.Tree = tree; 113 113 treeChart.Repaint(); 114 bool valid = !tree.IterateNodesPostfix().Any(node => node.SubtreeCount < GetMinArity(node.Symbol) || node.SubtreeCount > node.Symbol.MaximumArity); 114 // check if all nodes have a legal arity 115 var nodes = tree.IterateNodesPostfix().ToList(); 116 bool valid = !nodes.Any(node => node.SubtreeCount < GetMinArity(node.Symbol) || node.SubtreeCount > node.Symbol.MaximumArity); 117 118 if (valid) { 119 // check if all variables are contained in the dataset 120 var variables = new HashSet<string>(Content.ProblemData.Dataset.DoubleVariables); 121 valid = nodes.OfType<VariableTreeNode>().All(x => variables.Contains(x.VariableName)); 122 } 123 115 124 if (valid) { 116 125 btnOptimizeConstants.Enabled = true; … … 174 183 } 175 184 176 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree);177 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree);178 185 protected abstract Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree); 179 186 protected abstract void UpdateModel(ISymbolicExpressionTree tree); … … 259 266 260 267 private void btnSimplify_Click(object sender, EventArgs e) { 261 var simplifier = new SymbolicDataAnalysisExpressionTreeSimplifier(); 262 var simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree); 268 var simplifiedExpressionTree = TreeSimplifier.Simplify(Content.Model.SymbolicExpressionTree); 263 269 UpdateModel(simplifiedExpressionTree); 264 270 } -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 102 102 if (dialog.DialogResult != DialogResult.OK) return; 103 103 104 var symbol = dialog.SelectedSymbol ();104 var symbol = dialog.SelectedSymbol; 105 105 var node = symbol.CreateTreeNode(); 106 106 if (node is ConstantTreeNode) { … … 110 110 var variable = node as VariableTreeNode; 111 111 variable.Weight = double.Parse(dialog.variableWeightTextBox.Text); 112 variable.VariableName = dialog. variableNamesCombo.Text;112 variable.VariableName = dialog.SelectedVariableName; 113 113 } else if (node.Symbol.MinimumArity <= parent.SubtreeCount && node.Symbol.MaximumArity >= parent.SubtreeCount) { 114 114 for (int i = parent.SubtreeCount - 1; i >= 0; --i) { -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4. 9.$WCREV$")]28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.10.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginFile("displayModelFrame.html", PluginFileType.Data)] -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [assembly: AssemblyCompany("")] 32 32 [assembly: AssemblyProduct("HeuristicLab")] 33 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]33 [assembly: AssemblyCopyright("(c) 2002-2016 HEAL")] 34 34 [assembly: AssemblyTrademark("")] 35 35 [assembly: AssemblyCulture("")] … … 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.4.0.0")] 55 [assembly: AssemblyFileVersion("3.4. 9.$WCREV$")]55 [assembly: AssemblyFileVersion("3.4.10.$WCREV$")] -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs
r12817 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 63 63 // weightInitializationMuTextBox 64 64 // 65 this.weightInitializationMuTextBox.Size = new System.Drawing.Size(293, 20); 65 66 this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" + 66 67 "al weights."); … … 69 70 // 70 71 this.initializationGroupBox.Location = new System.Drawing.Point(6, 7); 71 this.initializationGroupBox.Size = new System.Drawing.Size(3 79, 73);72 this.initializationGroupBox.Size = new System.Drawing.Size(391, 73); 72 73 // 73 74 // weightSigmaLabel … … 77 78 // weightInitializationSigmaTextBox 78 79 // 80 this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(293, 20); 79 81 this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " + 80 82 "weights."); … … 83 85 // 84 86 this.mutationGroupBox.Location = new System.Drawing.Point(6, 86); 85 this.mutationGroupBox.Size = new System.Drawing.Size(3 79, 73);87 this.mutationGroupBox.Size = new System.Drawing.Size(391, 95); 86 88 // 87 89 // multiplicativeWeightChangeLabel 88 90 // 91 this.multiplicativeWeightChangeLabel.TabIndex = 4; 89 92 this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" + 90 93 " change in weight."); … … 92 95 // multiplicativeWeightChangeSigmaTextBox 93 96 // 97 this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5; 94 98 this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" + 95 99 "tive change in weight."); … … 97 101 // additiveWeightChangeLabel 98 102 // 103 this.additiveWeightChangeLabel.TabIndex = 2; 99 104 this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + 100 105 "change in weight."); … … 102 107 // additiveWeightChangeSigmaTextBox 103 108 // 109 this.additiveWeightChangeSigmaTextBox.TabIndex = 3; 104 110 this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + 105 111 "change in weight."); … … 111 117 // parametersTabPage 112 118 // 113 this.parametersTabPage.Size = new System.Drawing.Size(4 00, 149);119 this.parametersTabPage.Size = new System.Drawing.Size(412, 208); 114 120 // 115 121 // tabControl 116 122 // 117 123 this.tabControl.Location = new System.Drawing.Point(0, 179); 118 this.tabControl.Size = new System.Drawing.Size(408, 175); 119 this.tabControl.TabIndex = 9; 124 this.tabControl.Size = new System.Drawing.Size(420, 234); 125 this.tabControl.TabIndex = 13; 126 // 127 // varChangeProbTextBox 128 // 129 this.varChangeProbTextBox.TabIndex = 1; 130 this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + 131 "change in weight."); 132 // 133 // varChangeProbLabel 134 // 135 this.varChangeProbLabel.TabIndex = 0; 136 this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" + 137 "s are sampled uniformly."); 120 138 // 121 139 // initialFrequencyLabel 122 140 // 141 this.initialFrequencyLabel.TabIndex = 2; 123 142 this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees"); 124 143 // … … 126 145 // 127 146 this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 147 this.initialFrequencyTextBox.Size = new System.Drawing.Size(323, 20); 148 this.initialFrequencyTextBox.TabIndex = 3; 149 // 150 // enabledCheckBox 151 // 152 this.enabledCheckBox.TabIndex = 8; 153 // 154 // minimumArityLabel 155 // 156 this.minimumArityLabel.TabIndex = 4; 157 this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol"); 158 // 159 // maximumArityLabel 160 // 161 this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol"); 128 162 // 129 163 // minimumArityTextBox 130 164 // 131 165 this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 132 this.minimumArityTextBox.Size = new System.Drawing.Size(315, 20); 166 this.minimumArityTextBox.Size = new System.Drawing.Size(327, 20); 167 this.minimumArityTextBox.TabIndex = 5; 133 168 // 134 169 // maximumArityTextBox 135 170 // 136 171 this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 137 this.maximumArityTextBox.Size = new System.Drawing.Size(3 15, 20);172 this.maximumArityTextBox.Size = new System.Drawing.Size(327, 20); 138 173 // 139 174 // nameTextBox … … 141 176 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 142 177 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 178 this.nameTextBox.Size = new System.Drawing.Size(302, 20); 179 // 180 // infoLabel 181 // 182 this.infoLabel.Location = new System.Drawing.Point(401, 3); 143 183 // 144 184 // minTimeOffsetLabel … … 148 188 this.minTimeOffsetLabel.Name = "minTimeOffsetLabel"; 149 189 this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13); 150 this.minTimeOffsetLabel.TabIndex = 5;190 this.minTimeOffsetLabel.TabIndex = 9; 151 191 this.minTimeOffsetLabel.Text = "Min. time offset:"; 152 192 // … … 157 197 this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel"; 158 198 this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13); 159 this.maxTimeOffsetLabel.TabIndex = 7;199 this.maxTimeOffsetLabel.TabIndex = 11; 160 200 this.maxTimeOffsetLabel.Text = "Max. time offset:"; 161 201 // 162 202 // minTimeOffsetTextBox 163 203 // 164 this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 204 this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 165 205 | System.Windows.Forms.AnchorStyles.Right))); 166 206 this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127); 167 207 this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox"; 168 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(3 15, 20);169 this.minTimeOffsetTextBox.TabIndex = 6;208 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20); 209 this.minTimeOffsetTextBox.TabIndex = 10; 170 210 this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged); 171 211 // 172 212 // maxTimeOffsetTextBox 173 213 // 174 this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 214 this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 175 215 | System.Windows.Forms.AnchorStyles.Right))); 176 216 this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153); 177 217 this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox"; 178 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(3 15, 20);179 this.maxTimeOffsetTextBox.TabIndex = 8;218 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20); 219 this.maxTimeOffsetTextBox.TabIndex = 12; 180 220 this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged); 181 221 // 182 222 // LaggedVariableView 183 223 // 184 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);185 224 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 186 225 this.Controls.Add(this.minTimeOffsetTextBox); … … 189 228 this.Controls.Add(this.maxTimeOffsetTextBox); 190 229 this.Name = "LaggedVariableView"; 191 this.Size = new System.Drawing.Size(408, 352); 230 this.Size = new System.Drawing.Size(420, 411); 231 this.Controls.SetChildIndex(this.enabledCheckBox, 0); 192 232 this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0); 193 233 this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0); -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 51 51 this.weightInitializationSigmaTextBox = new System.Windows.Forms.TextBox(); 52 52 this.mutationGroupBox = new System.Windows.Forms.GroupBox(); 53 this.varChangeProbTextBox = new System.Windows.Forms.TextBox(); 54 this.varChangeProbLabel = new System.Windows.Forms.Label(); 53 55 this.multiplicativeWeightChangeLabel = new System.Windows.Forms.Label(); 54 56 this.multiplicativeWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox(); … … 67 69 // initialFrequencyLabel 68 70 // 71 this.initialFrequencyLabel.TabIndex = 2; 69 72 this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees"); 70 73 // … … 73 76 this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 74 77 this.initialFrequencyTextBox.Size = new System.Drawing.Size(311, 20); 78 this.initialFrequencyTextBox.TabIndex = 3; 79 // 80 // enabledCheckBox 81 // 82 this.enabledCheckBox.TabIndex = 8; 75 83 // 76 84 // minimumArityLabel 77 85 // 86 this.minimumArityLabel.TabIndex = 4; 78 87 this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol"); 79 88 // … … 86 95 this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 87 96 this.minimumArityTextBox.Size = new System.Drawing.Size(311, 20); 97 this.minimumArityTextBox.TabIndex = 5; 88 98 // 89 99 // maximumArityTextBox … … 165 175 this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 166 176 | System.Windows.Forms.AnchorStyles.Right))); 177 this.mutationGroupBox.Controls.Add(this.varChangeProbTextBox); 178 this.mutationGroupBox.Controls.Add(this.varChangeProbLabel); 167 179 this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeLabel); 168 180 this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeSigmaTextBox); … … 171 183 this.mutationGroupBox.Location = new System.Drawing.Point(6, 85); 172 184 this.mutationGroupBox.Name = "mutationGroupBox"; 173 this.mutationGroupBox.Size = new System.Drawing.Size(391, 73);185 this.mutationGroupBox.Size = new System.Drawing.Size(391, 97); 174 186 this.mutationGroupBox.TabIndex = 1; 175 187 this.mutationGroupBox.TabStop = false; 176 188 this.mutationGroupBox.Text = "Mutation"; 177 189 // 190 // varChangeProbTextBox 191 // 192 this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 193 | System.Windows.Forms.AnchorStyles.Right))); 194 this.varChangeProbTextBox.Location = new System.Drawing.Point(201, 13); 195 this.varChangeProbTextBox.Name = "varChangeProbTextBox"; 196 this.varChangeProbTextBox.Size = new System.Drawing.Size(184, 20); 197 this.varChangeProbTextBox.TabIndex = 1; 198 this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + 199 "change in weight."); 200 this.varChangeProbTextBox.TextChanged += new System.EventHandler(this.VarProbTextBox_TextChanged); 201 // 202 // varChangeProbLabel 203 // 204 this.varChangeProbLabel.AutoSize = true; 205 this.varChangeProbLabel.Location = new System.Drawing.Point(6, 16); 206 this.varChangeProbLabel.Name = "varChangeProbLabel"; 207 this.varChangeProbLabel.Size = new System.Drawing.Size(134, 13); 208 this.varChangeProbLabel.TabIndex = 0; 209 this.varChangeProbLabel.Text = "Variable change probability"; 210 this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" + 211 "s are sampled uniformly."); 212 // 178 213 // multiplicativeWeightChangeLabel 179 214 // 180 215 this.multiplicativeWeightChangeLabel.AutoSize = true; 181 this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 48);216 this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 68); 182 217 this.multiplicativeWeightChangeLabel.Name = "multiplicativeWeightChangeLabel"; 183 218 this.multiplicativeWeightChangeLabel.Size = new System.Drawing.Size(180, 13); 184 this.multiplicativeWeightChangeLabel.TabIndex = 2;219 this.multiplicativeWeightChangeLabel.TabIndex = 4; 185 220 this.multiplicativeWeightChangeLabel.Text = "Multiplicative weight change (sigma):"; 186 221 this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" + … … 191 226 this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 192 227 | System.Windows.Forms.AnchorStyles.Right))); 193 this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 45);228 this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 65); 194 229 this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox"; 195 230 this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20); 196 this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 3;231 this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5; 197 232 this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" + 198 233 "tive change in weight."); … … 202 237 // 203 238 this.additiveWeightChangeLabel.AutoSize = true; 204 this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 22);239 this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 42); 205 240 this.additiveWeightChangeLabel.Name = "additiveWeightChangeLabel"; 206 241 this.additiveWeightChangeLabel.Size = new System.Drawing.Size(157, 13); 207 this.additiveWeightChangeLabel.TabIndex = 0;242 this.additiveWeightChangeLabel.TabIndex = 2; 208 243 this.additiveWeightChangeLabel.Text = "Additive weight change (sigma):"; 209 244 this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + … … 214 249 this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 215 250 | System.Windows.Forms.AnchorStyles.Right))); 216 this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 19);251 this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 39); 217 252 this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox"; 218 253 this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20); 219 this.additiveWeightChangeSigmaTextBox.TabIndex = 1;254 this.additiveWeightChangeSigmaTextBox.TabIndex = 3; 220 255 this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + 221 256 "change in weight."); … … 232 267 this.tabControl.Name = "tabControl"; 233 268 this.tabControl.SelectedIndex = 0; 234 this.tabControl.Size = new System.Drawing.Size(408, 190);235 this.tabControl.TabIndex = 5;269 this.tabControl.Size = new System.Drawing.Size(408, 216); 270 this.tabControl.TabIndex = 9; 236 271 // 237 272 // variableNamesTabPage … … 240 275 this.variableNamesTabPage.Name = "variableNamesTabPage"; 241 276 this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3); 242 this.variableNamesTabPage.Size = new System.Drawing.Size(400, 1 64);277 this.variableNamesTabPage.Size = new System.Drawing.Size(400, 190); 243 278 this.variableNamesTabPage.TabIndex = 0; 244 279 this.variableNamesTabPage.Text = "Variable Names"; … … 252 287 this.parametersTabPage.Name = "parametersTabPage"; 253 288 this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3); 254 this.parametersTabPage.Size = new System.Drawing.Size(400, 1 64);289 this.parametersTabPage.Size = new System.Drawing.Size(400, 190); 255 290 this.parametersTabPage.TabIndex = 1; 256 291 this.parametersTabPage.Text = "Parameters"; … … 259 294 // VariableView 260 295 // 261 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);262 296 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 263 297 this.Controls.Add(this.tabControl); 264 298 this.Name = "VariableView"; 265 this.Size = new System.Drawing.Size(408, 317); 299 this.Size = new System.Drawing.Size(408, 346); 300 this.Controls.SetChildIndex(this.enabledCheckBox, 0); 266 301 this.Controls.SetChildIndex(this.maximumArityLabel, 0); 267 302 this.Controls.SetChildIndex(this.maximumArityTextBox, 0); … … 301 336 protected System.Windows.Forms.TabPage parametersTabPage; 302 337 protected System.Windows.Forms.TabControl tabControl; 338 protected System.Windows.Forms.TextBox varChangeProbTextBox; 339 protected System.Windows.Forms.Label varChangeProbLabel; 303 340 } 304 341 } -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 30 30 using HeuristicLab.MainForm; 31 using HeuristicLab.MainForm.WindowsForms;32 31 33 32 34 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 35 34 [View("Variable View")] 36 [Content(typeof(Variable ), true)]35 [Content(typeof(VariableBase), true)] 37 36 public partial class VariableView : SymbolView { 38 37 private CheckedItemCollectionView<StringValue> variableNamesView; 39 38 40 public new Variable Content {41 get { return (Variable )base.Content; }39 public new VariableBase Content { 40 get { return (VariableBase)base.Content; } 42 41 set { base.Content = value; } 43 42 } … … 101 100 multiplicativeWeightChangeSigmaTextBox.Enabled = Content != null; 102 101 multiplicativeWeightChangeSigmaTextBox.ReadOnly = ReadOnly; 102 varChangeProbTextBox.Enabled = Content != null; 103 varChangeProbTextBox.ReadOnly = ReadOnly; 103 104 } 104 105 … … 175 176 } 176 177 } 178 179 private void VarProbTextBox_TextChanged(object sender, EventArgs e) { 180 double prob; 181 if (double.TryParse(varChangeProbTextBox.Text, out prob) && prob >= 0.0 && prob <= 1.0) { 182 Content.VariableChangeProbability = prob; 183 errorProvider.SetError(varChangeProbTextBox, string.Empty); 184 } else { 185 errorProvider.SetError(varChangeProbTextBox, "Invalid value"); 186 } 187 } 177 188 #endregion 178 189 … … 184 195 additiveWeightChangeSigmaTextBox.Text = string.Empty; 185 196 multiplicativeWeightChangeSigmaTextBox.Text = string.Empty; 197 varChangeProbTextBox.Text = string.Empty; 186 198 // temporarily deregister to prevent circular calling of events 187 199 DeregisterVariableNamesViewContentEvents(); … … 201 213 additiveWeightChangeSigmaTextBox.Text = Content.WeightManipulatorSigma.ToString(); 202 214 multiplicativeWeightChangeSigmaTextBox.Text = Content.MultiplicativeWeightManipulatorSigma.ToString(); 215 varChangeProbTextBox.Text = Content.VariableChangeProbability.ToString(); 203 216 } 204 217 SetEnabledStateOfControls(); 205 218 } 206 219 #endregion 220 207 221 } 208 222 } -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 57 57 this.okButton = new System.Windows.Forms.Button(); 58 58 this.cancelButton = new System.Windows.Forms.Button(); 59 this.variableNameTextBox = new System.Windows.Forms.TextBox(); 59 60 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 60 61 this.SuspendLayout(); … … 168 169 this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 169 170 // 171 // variableNameTextBox 172 // 173 this.variableNameTextBox.Location = new System.Drawing.Point(101, 63); 174 this.variableNameTextBox.Name = "variableNameTextBox"; 175 this.variableNameTextBox.Size = new System.Drawing.Size(127, 20); 176 this.variableNameTextBox.TabIndex = 11; 177 this.variableNameTextBox.Visible = false; 178 // 170 179 // InsertNodeDialog 171 180 // … … 175 184 this.ClientSize = new System.Drawing.Size(241, 133); 176 185 this.ControlBox = false; 186 this.Controls.Add(this.variableNameTextBox); 177 187 this.Controls.Add(this.cancelButton); 178 188 this.Controls.Add(this.okButton); … … 208 218 private System.Windows.Forms.Button cancelButton; 209 219 private System.Windows.Forms.Button okButton; 220 private System.Windows.Forms.TextBox variableNameTextBox; 210 221 } 211 222 } -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.ComponentModel; 25 using System.Linq; 25 26 using System.Text; 26 27 using System.Windows.Forms; … … 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 31 32 public partial class InsertNodeDialog : Form { 33 public string SelectedVariableName { 34 get { 35 var variable = SelectedSymbol as Variable; 36 if (variable == null) 37 return string.Empty; 38 return variable.VariableNames.Any() ? variableNamesCombo.Text : variableNameTextBox.Text; 39 } 40 } 41 32 42 public InsertNodeDialog() { 33 43 InitializeComponent(); … … 40 50 } 41 51 42 public ISymbol SelectedSymbol (){43 return (ISymbol)allowedSymbolsCombo.SelectedItem;52 public ISymbol SelectedSymbol { 53 get { return (ISymbol)allowedSymbolsCombo.SelectedItem; } 44 54 } 45 55 … … 55 65 constantValueLabel.Visible = true; 56 66 constantValueTextBox.Visible = true; 57 } else if (symbol is Variable) { 58 var variable = (Variable)symbol; 59 foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name); 60 variableNamesCombo.SelectedIndex = 0; 67 } else if (symbol is VariableBase) { 68 var variableSymbol = (VariableBase)symbol; 69 if (variableSymbol.VariableNames.Any()) { 70 foreach (var name in variableSymbol.VariableNames) 71 variableNamesCombo.Items.Add(name); 72 variableNamesCombo.SelectedIndex = 0; 73 variableNamesCombo.Visible = true; 74 variableNameTextBox.Visible = false; 75 } else { 76 variableNamesCombo.Visible = false; 77 variableNameTextBox.Visible = true; 78 } 61 79 variableNameLabel.Visible = true; 62 variableNamesCombo.Visible = true;63 80 variableWeightLabel.Visible = true; 64 81 variableWeightTextBox.Visible = true; -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 55 55 this.okButton = new System.Windows.Forms.Button(); 56 56 this.cancelButton = new System.Windows.Forms.Button(); 57 this.variableNameTextBox = new System.Windows.Forms.TextBox(); 57 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 58 59 this.SuspendLayout(); … … 146 147 this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 147 148 // 149 // variableNameTextBox 150 // 151 this.variableNameTextBox.Location = new System.Drawing.Point(101, 12); 152 this.variableNameTextBox.Name = "variableNameTextBox"; 153 this.variableNameTextBox.Size = new System.Drawing.Size(131, 20); 154 this.variableNameTextBox.TabIndex = 12; 155 this.variableNameTextBox.Visible = false; 156 // 148 157 // VariableNodeEditDialog 149 158 // … … 154 163 this.ClientSize = new System.Drawing.Size(244, 134); 155 164 this.ControlBox = false; 165 this.Controls.Add(this.variableNameTextBox); 156 166 this.Controls.Add(this.cancelButton); 157 167 this.Controls.Add(this.okButton); … … 188 198 public System.Windows.Forms.TextBox newValueTextBox; 189 199 public System.Windows.Forms.ComboBox variableNamesCombo; 200 private System.Windows.Forms.TextBox variableNameTextBox; 190 201 } 191 202 } -
branches/Async/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.ComponentModel; 24 using System.Linq; 24 25 using System.Text; 25 26 using System.Windows.Forms; … … 33 34 get { return variableTreeNode; } 34 35 set { 35 if (InvokeRequired) 36 Invoke(new Action<SymbolicExpressionTreeNode>(x => variableTreeNode = (VariableTreeNode)x), value); 37 else 36 if (InvokeRequired) { 37 Invoke(new Action<SymbolicExpressionTreeNode>(x => 38 { 39 variableTreeNode = (VariableTreeNode) x; 40 variableNameTextBox.Text = variableTreeNode.VariableName; 41 }), value); 42 } else { 38 43 variableTreeNode = value; 44 variableNameTextBox.Text = variableTreeNode.VariableName; 45 } 39 46 } 47 } 48 49 public string SelectedVariableName { 50 get { return variableNamesCombo.Visible ? variableNamesCombo.Text : variableNameTextBox.Text; } 40 51 } 41 52 … … 43 54 InitializeComponent(); 44 55 oldValueTextBox.TabStop = false; // cannot receive focus using tab key 45 46 56 NewNode = (VariableTreeNode)node; // will throw an invalid cast exception if node is not of the correct type 47 57 InitializeFields(); … … 57 67 variableNameLabel.Visible = true; 58 68 variableNamesCombo.Visible = true; 59 foreach (var name in variableTreeNode.Symbol.VariableNames) variableNamesCombo.Items.Add(name); 60 variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName); 69 if (variableTreeNode.Symbol.VariableNames.Any()) { 70 foreach (var name in variableTreeNode.Symbol.VariableNames) 71 variableNamesCombo.Items.Add(name); 72 variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName); 73 variableNamesCombo.Visible = true; 74 variableNameTextBox.Visible = false; 75 } else { 76 variableNamesCombo.Visible = false; 77 variableNameTextBox.Visible = true; 78 } 61 79 } 62 80 } … … 93 111 #region combo box validation and events 94 112 private void variableNamesCombo_Validating(object sender, CancelEventArgs e) { 113 if (variableNamesCombo.Items.Count == 0) return; 95 114 if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return; 96 115 e.Cancel = true; … … 119 138 private void OnDialogValidated(object sender, EventArgs e) { 120 139 double weight = double.Parse(newValueTextBox.Text); 121 var variableName = (string)variableNamesCombo.SelectedItem;122 140 // we impose an extra validation condition: that the weight/value be different than the original ones 141 var variableName = SelectedVariableName; 123 142 if (variableTreeNode.Weight.Equals(weight) && variableTreeNode.VariableName.Equals(variableName)) return; 124 143 variableTreeNode.Weight = weight;
Note: See TracChangeset
for help on using the changeset viewer.