- Timestamp:
- 05/06/19 13:01:29 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs
r16885 r16895 124 124 } 125 125 126 private static string UpdateExpression(IntervalConstraint constraint) {127 var expression = "";128 129 if (!constraint.IsDerivation) {130 expression = string.Format("{0} in {1}{2} .. {3}{4}",131 constraint.Variable,132 (constraint.InclusiveLowerBound) ? "[" : "]",133 constraint.Interval.LowerBound,134 constraint.Interval.UpperBound,135 (constraint.InclusiveUpperBound) ? "]" : "[");136 } else {137 expression = string.Format("\u2202{5}Target/\u2202{0}{6} in {1}{2} .. {3}{4}",138 constraint.Variable,139 (constraint.InclusiveLowerBound) ? "[" : "]",140 constraint.Interval.LowerBound,141 constraint.Interval.UpperBound,142 (constraint.InclusiveUpperBound) ? "]" : "[",143 GetDerivationString(constraint.numberOfDerivation),144 GetDerivationString(constraint.numberOfDerivation));145 }146 147 return expression;148 }149 150 private static string UpdateDefintion(IntervalConstraint constraint) {151 var definition = "";152 153 if (!constraint.IsDerivation) {154 return "Target " + constraint.Variable;155 }156 157 definition = $"\u2202{GetDerivationString(constraint.numberOfDerivation)}Target/\u2202{constraint.Variable}{GetDerivationString(constraint.numberOfDerivation)}";158 159 return definition;160 }161 162 private static string GetDerivationString(int derivation) {163 switch (derivation) {164 case 1:165 return "";166 case 2:167 return "²";168 case 3:169 return "³";170 default:171 return "";172 }173 }174 175 126 #endregion 176 127 … … 198 149 if (!double.IsNaN(value)) { 199 150 Content.Interval = new Interval(value, Content.Interval.UpperBound); 200 var exp = UpdateExpression(Content);201 Content.Name = exp;202 Content.Expression = exp;203 151 } 204 152 } … … 226 174 if (!double.IsNaN(value)) { 227 175 Content.Interval = new Interval(Content.Interval.LowerBound, value); 228 var exp = UpdateExpression(Content);229 Content.Name = exp;230 Content.Expression = exp;231 176 } 232 177 } … … 234 179 private void incllowerboundInput_CheckedChanged(object sender, EventArgs e) { 235 180 Content.InclusiveLowerBound = incllowerboundInput.Checked; 236 var exp = UpdateExpression(Content);237 Content.Name = exp;238 Content.Expression = exp;239 181 } 240 182 241 183 private void inclupperboundInput_CheckedChanged(object sender, EventArgs e) { 242 184 Content.InclusiveUpperBound = inclupperboundInput.Checked; 243 var exp = UpdateExpression(Content);244 Content.Name = exp;245 Content.Expression = exp;246 185 } 247 186 … … 257 196 else if ((int)numberderivationInput.SelectedItem == 3) 258 197 Content.numberOfDerivation = 3; 259 260 var exp = UpdateExpression(Content);261 var def = UpdateDefintion(Content);262 Content.Name = exp;263 Content.Expression = exp;264 Content.Definition = def;265 198 } 266 199
Note: See TracChangeset
for help on using the changeset viewer.