- Timestamp:
- 04/17/19 14:37:55 (5 years ago)
- Location:
- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r16790 r16800 550 550 <DependentUpon>TimeSeriesPrognosisSolutionView.cs</DependentUpon> 551 551 </Compile> 552 <Compile Include="TextValueView.cs">553 <SubType>UserControl</SubType>554 </Compile>555 <Compile Include="TextValueView.designer.cs">556 <DependentUpon>TextValueView.cs</DependentUpon>557 </Compile>558 552 <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisResidualsLineChartView.cs"> 559 553 <SubType>UserControl</SubType> … … 630 624 <DependentUpon>NamedIntervalsView.cs</DependentUpon> 631 625 </EmbeddedResource> 632 <EmbeddedResource Include="TextValueView.resx">633 <DependentUpon>TextValueView.cs</DependentUpon>634 </EmbeddedResource>635 626 <EmbeddedResource Include="IntervalConstraintView.resx"> 636 627 <DependentUpon>IntervalConstraintView.cs</DependentUpon> -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs
r16787 r16800 29 29 definitionInput.ReadOnly = true; 30 30 derivationInput.Enabled = false; 31 derivationInput.Checked = Content?.IsDerivation ??false;31 derivationInput.Checked = false; 32 32 numberderivationInput.DataSource = items; 33 33 } … … 101 101 } 102 102 103 ischeckedCheckBox.Checked = Content. IsChecked;103 ischeckedCheckBox.Checked = Content.Enabled; 104 104 } 105 105 SetEnabledStateOfControls(); 106 106 } 107 107 108 private void UpdateExpression() {108 private static string UpdateExpression(IntervalConstraint constraint) { 109 109 var expression = ""; 110 110 111 if (! Content.IsDerivation) {112 expression = string.Format("{0} in {1}{2} .. {3}{4}", 113 Content.Variable,114 ( Content.InclusiveLowerBound) ? "[" : "]",115 Content.Interval.LowerBound,116 Content.Interval.UpperBound,117 ( Content.InclusiveUpperBound) ? "]" : "[");111 if (!constraint.IsDerivation) { 112 expression = string.Format("{0} in {1}{2} .. {3}{4}", 113 constraint.Variable, 114 (constraint.InclusiveLowerBound) ? "[" : "]", 115 constraint.Interval.LowerBound, 116 constraint.Interval.UpperBound, 117 (constraint.InclusiveUpperBound) ? "]" : "["); 118 118 } else { 119 119 expression = string.Format("\u2202{5}Target/\u2202{0}{6} in {1}{2} .. {3}{4}", 120 Content.Variable, 121 (Content.InclusiveLowerBound) ? "[" : "]", 122 Content.Interval.LowerBound, 123 Content.Interval.UpperBound, 124 (Content.InclusiveUpperBound) ? "]" : "[", 125 PrintNumberOfDerivation(Content.numberOfDerivation), 126 PrintNumberOfDerivation(Content.numberOfDerivation)); 127 } 128 129 Content.Expression = expression; 130 Content.Name = expression; 131 UpdateControls(); 132 } 133 134 private string PrintNumberOfDerivation(int derivation) { 120 constraint.Variable, 121 (constraint.InclusiveLowerBound) ? "[" : "]", 122 constraint.Interval.LowerBound, 123 constraint.Interval.UpperBound, 124 (constraint.InclusiveUpperBound) ? "]" : "[", 125 PrintNumberOfDerivation(constraint.numberOfDerivation), 126 PrintNumberOfDerivation(constraint.numberOfDerivation)); 127 } 128 129 return expression; 130 } 131 132 private static string PrintNumberOfDerivation(int derivation) { 135 133 switch (derivation) { 136 134 case 1: … … 150 148 private void lowerboundInput_Validating(object sender, CancelEventArgs e) { 151 149 var value = ParseDoubleValue(lowerboundInput.Text, lowerboundInput); 152 if (!double.IsNaN(value)) { 153 if (value <= Content.Interval.UpperBound) { 154 errorProvider.SetError(lowerboundInput, string.Empty); 155 e.Cancel = false; 156 } else { 157 errorProvider.SetError(lowerboundInput, "Invalid Input: Lowerbound must be smaller than Upperbound!"); 158 e.Cancel = true; 159 } 160 } else { 161 e.Cancel = true; 162 } 150 if (double.IsNaN(value)) { 151 errorProvider.SetError(lowerboundInput, "Invalid Input: Lowerbound must be a double value!"); 152 e.Cancel = true; 153 return; 154 } 155 156 if (value > Content.Interval.UpperBound) { 157 errorProvider.SetError(lowerboundInput, "Invalid Input: Lowerbound must be smaller than Upperbound!"); 158 e.Cancel = true; 159 return; 160 } 161 162 errorProvider.SetError(lowerboundInput, string.Empty); 163 e.Cancel = false; 163 164 } 164 165 … … 167 168 if (!double.IsNaN(value)) { 168 169 Content.Interval = new Interval(value, Content.Interval.UpperBound); 169 UpdateExpression(); 170 var exp = UpdateExpression(Content); 171 Content.Name = exp; 172 Content.Expression = exp; 170 173 } 171 174 } … … 173 176 private void upperboundInput_Validating(object sender, CancelEventArgs e) { 174 177 var value = ParseDoubleValue(upperboundInput.Text, upperboundInput); 175 if (!double.IsNaN(value)) { 176 if (value >= Content.Interval.LowerBound) { 177 errorProvider.SetError(upperboundInput, string.Empty); 178 e.Cancel = false; 179 } else { 180 errorProvider.SetError(lowerboundInput, "Invalid Input: Upperbound must be bigger than Lowerbound!"); 181 e.Cancel = true; 182 } 183 } else { 184 e.Cancel = true; 185 } 178 if (double.IsNaN(value)) { 179 errorProvider.SetError(upperboundInput, "Invalid Input: Upperbound must be a double value!"); 180 e.Cancel = true; 181 return; 182 } 183 184 if (value < Content.Interval.LowerBound) { 185 errorProvider.SetError(upperboundInput, "Invalid Input: Upperbound must be bigger than Lowerbound!"); 186 e.Cancel = true; 187 return; 188 } 189 190 errorProvider.SetError(upperboundInput, string.Empty); 191 e.Cancel = false; 186 192 } 187 193 … … 190 196 if (!double.IsNaN(value)) { 191 197 Content.Interval = new Interval(Content.Interval.LowerBound, value); 192 UpdateExpression(); 198 var exp = UpdateExpression(Content); 199 Content.Name = exp; 200 Content.Expression = exp; 193 201 } 194 202 } … … 197 205 if (Content.InclusiveLowerBound != incllowerboundInput.Checked) { 198 206 Content.InclusiveLowerBound = incllowerboundInput.Checked; 199 UpdateExpression(); 207 var exp = UpdateExpression(Content); 208 Content.Name = exp; 209 Content.Expression = exp; 200 210 } 201 211 … … 206 216 if (Content.InclusiveUpperBound != inclupperboundInput.Checked) { 207 217 Content.InclusiveUpperBound = inclupperboundInput.Checked; 208 UpdateExpression(); 218 var exp = UpdateExpression(Content); 219 Content.Name = exp; 220 Content.Expression = exp; 209 221 } 210 222 } 211 223 212 224 private void ischeckedCheckBox_CheckedChanged(object sender, EventArgs e) { 213 if (Content. IsChecked != ischeckedCheckBox.Checked) {214 Content. IsChecked = ischeckedCheckBox.Checked;215 UpdateControls();225 if (Content.Enabled != ischeckedCheckBox.Checked) { 226 Content.Enabled = ischeckedCheckBox.Checked; 227 //UpdateControls(); 216 228 } 217 229 } … … 225 237 Content.numberOfDerivation = 3; 226 238 227 UpdateExpression(); 239 var exp = UpdateExpression(Content); 240 Content.Name = exp; 241 Content.Expression = exp; 228 242 } 229 243 -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs
r16787 r16800 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 using System; 2 22 using System.Collections.Generic; 3 23 using HeuristicLab.Collections; … … 39 59 foreach (var constraint in parsedConstraints) { 40 60 constraint.Changed += constraint_Changed; 41 intervalConstraints.Add(constraint, constraint. IsChecked);61 intervalConstraints.Add(constraint, constraint.Enabled); 42 62 } 43 63 constraintsOutput.Content = intervalConstraints; … … 59 79 foreach (var constraint in Content.Constraints) { 60 80 constraint.Changed += constraint_Changed; 61 intervalConstraints.Add(constraint, constraint. IsChecked);81 intervalConstraints.Add(constraint, constraint.Enabled); 62 82 } 63 83 … … 69 89 private void constraint_Changed(object sender, EventArgs e) { 70 90 var constraint = (IntervalConstraint) sender; 71 intervalConstraints.SetItemCheckedState(constraint, constraint. IsChecked);91 intervalConstraints.SetItemCheckedState(constraint, constraint.Enabled); 72 92 } 73 93 … … 76 96 ICheckedItemList<IntervalConstraint> checkedItemList = (ICheckedItemList<IntervalConstraint>) sender; 77 97 foreach (var indexedItem in e.Items) { 78 indexedItem.Value. IsChecked = checkedItemList.ItemChecked(indexedItem.Value);98 indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value); 79 99 } 80 100 }
Note: See TracChangeset
for help on using the changeset viewer.