Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/19 14:37:55 (5 years ago)
Author:
chaider
Message:

#2971 Several chanages regarding review comments

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  
    550550      <DependentUpon>TimeSeriesPrognosisSolutionView.cs</DependentUpon>
    551551    </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>
    558552    <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisResidualsLineChartView.cs">
    559553      <SubType>UserControl</SubType>
     
    630624      <DependentUpon>NamedIntervalsView.cs</DependentUpon>
    631625    </EmbeddedResource>
    632     <EmbeddedResource Include="TextValueView.resx">
    633       <DependentUpon>TextValueView.cs</DependentUpon>
    634     </EmbeddedResource>
    635626    <EmbeddedResource Include="IntervalConstraintView.resx">
    636627      <DependentUpon>IntervalConstraintView.cs</DependentUpon>
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs

    r16787 r16800  
    2929      definitionInput.ReadOnly = true;
    3030      derivationInput.Enabled = false;
    31       derivationInput.Checked = Content?.IsDerivation ?? false;
     31      derivationInput.Checked = false;
    3232      numberderivationInput.DataSource = items;
    3333    }
     
    101101        }
    102102
    103         ischeckedCheckBox.Checked = Content.IsChecked;
     103        ischeckedCheckBox.Checked = Content.Enabled;
    104104      }
    105105      SetEnabledStateOfControls();
    106106    }
    107107
    108     private void UpdateExpression() {
     108    private static string UpdateExpression(IntervalConstraint constraint) {
    109109      var expression = "";
    110110
    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) ? "]" : "[");
    118118      } else {
    119119        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) {
    135133      switch (derivation) {
    136134        case 1:
     
    150148    private void lowerboundInput_Validating(object sender, CancelEventArgs e) {
    151149      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;
    163164    }
    164165
     
    167168      if (!double.IsNaN(value)) {
    168169        Content.Interval = new Interval(value, Content.Interval.UpperBound);
    169         UpdateExpression();
     170        var exp = UpdateExpression(Content);
     171        Content.Name = exp;
     172        Content.Expression = exp;
    170173      }
    171174    }
     
    173176    private void upperboundInput_Validating(object sender, CancelEventArgs e) {
    174177      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;
    186192    }
    187193
     
    190196      if (!double.IsNaN(value)) {
    191197        Content.Interval = new Interval(Content.Interval.LowerBound, value);
    192         UpdateExpression();
     198        var exp = UpdateExpression(Content);
     199        Content.Name = exp;
     200        Content.Expression = exp;
    193201      }
    194202    }
     
    197205      if (Content.InclusiveLowerBound != incllowerboundInput.Checked) {
    198206        Content.InclusiveLowerBound = incllowerboundInput.Checked;
    199         UpdateExpression();
     207        var exp = UpdateExpression(Content);
     208        Content.Name = exp;
     209        Content.Expression = exp;
    200210      }
    201211     
     
    206216      if (Content.InclusiveUpperBound != inclupperboundInput.Checked) {
    207217        Content.InclusiveUpperBound = inclupperboundInput.Checked;
    208         UpdateExpression();
     218        var exp = UpdateExpression(Content);
     219        Content.Name = exp;
     220        Content.Expression = exp;
    209221      }
    210222    }
    211223
    212224    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();
    216228      }
    217229    }
     
    225237        Content.numberOfDerivation = 3;
    226238
    227       UpdateExpression();
     239      var exp = UpdateExpression(Content);
     240      Content.Name = exp;
     241      Content.Expression = exp;
    228242    }
    229243
  • 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
     21using System;
    222using System.Collections.Generic;
    323using HeuristicLab.Collections;
     
    3959        foreach (var constraint in parsedConstraints) {
    4060          constraint.Changed += constraint_Changed;
    41           intervalConstraints.Add(constraint, constraint.IsChecked);
     61          intervalConstraints.Add(constraint, constraint.Enabled);
    4262        }
    4363        constraintsOutput.Content = intervalConstraints;
     
    5979        foreach (var constraint in Content.Constraints) {
    6080          constraint.Changed += constraint_Changed;
    61           intervalConstraints.Add(constraint, constraint.IsChecked);
     81          intervalConstraints.Add(constraint, constraint.Enabled);
    6282        }
    6383
     
    6989    private void constraint_Changed(object sender, EventArgs e) {
    7090      var constraint = (IntervalConstraint) sender;
    71       intervalConstraints.SetItemCheckedState(constraint, constraint.IsChecked);
     91      intervalConstraints.SetItemCheckedState(constraint, constraint.Enabled);
    7292    }
    7393
     
    7696      ICheckedItemList<IntervalConstraint> checkedItemList = (ICheckedItemList<IntervalConstraint>) sender;
    7797      foreach (var indexedItem in e.Items) {
    78         indexedItem.Value.IsChecked = checkedItemList.ItemChecked(indexedItem.Value);
     98        indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value);
    7999      }
    80100    }
Note: See TracChangeset for help on using the changeset viewer.