Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/19 08:36:49 (6 years ago)
Author:
chaider
Message:

#2971

  • Disabled variable input field in IntervalConstraintView
  • Added update definition method in IntervalConstraintView
  • Added onChanged event for definition
Location:
branches/2971_named_intervals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs

    r16862 r16880  
    6767      definitionInput.ReadOnly = true;
    6868      expressionInput.ReadOnly = true;
     69      variableInput.ReadOnly = true;
    6970    }
    7071
     
    148149    }
    149150
     151    private static string UpdateDefintion(IntervalConstraint constraint) {
     152      var definition = "";
     153
     154      if (!constraint.IsDerivation) {
     155        return "Target " + constraint.Variable;
     156      }
     157
     158      definition = $"\u2202{GetDerivationString(constraint.numberOfDerivation)}Target/\u2202{constraint.Variable}{GetDerivationString(constraint.numberOfDerivation)}";
     159
     160      return definition;
     161    }
     162
    150163    private static string GetDerivationString(int derivation) {
    151164      switch (derivation) {
     
    247260
    248261      var exp = UpdateExpression(Content);
     262      var def = UpdateDefintion(Content);
    249263      Content.Name = exp;
    250264      Content.Expression = exp;
     265      Content.Definition = def;
    251266    }
    252267
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs

    r16830 r16880  
    3838      }
    3939    }
    40     public string Definition { get; set; }
     40
     41    private string definition;
     42
     43    public string Definition {
     44      get => definition;
     45      set {
     46        if (value != definition) {
     47          definition = value;
     48          OnChanged(EventArgs.Empty);
     49        }
     50      }
     51    }
    4152    public Interval Interval { get; set; }
    4253    private bool inclusiveLowerBound;
Note: See TracChangeset for help on using the changeset viewer.