Exemplo n.º 1
0
 public void SetValueFromInput(double input)
 {
     SetMin();
     SetMax();
     if (input < MinValue)
     {
         input = MinValue;
     }
     else if (input > MaxValue)
     {
         input = MaxValue;
     }
     Formula.ReplaceExpression(input.ToString()); //prevents it being reset to the default value on Evaluate;
     Formula.Evaluate();                          //force dependants to recalc.
 }
 public void SetValueFromInput(double input)
 {
     Debug.Assert(GuiHint != GuiHint.GuiTextDisplay || GuiHint != GuiHint.None, Name + " is not an editable value");
     SetMin();
     SetMax();
     if (input < MinValue)
     {
         input = MinValue;
     }
     else if (input > MaxValue)
     {
         input = MaxValue;
     }
     Formula.ReplaceExpression(input.ToString()); //prevents it being reset to the default value on Evaluate;
     Formula.Evaluate();                          //force dependants to recalc.
 }
Exemplo n.º 3
0
 public void SetValueFromInput(double input)
 {
     Debug.Assert(GuiHint != GuiHint.GuiTextDisplay || GuiHint != GuiHint.None, Name + " is not an editable value");
     SetMin();
     SetMax();
     if (input < MinValue)
     {
         input = MinValue;
     }
     else if (input > MaxValue)
     {
         input = MaxValue;
     }
     Formula.ReplaceExpression(input.ToString()); //prevents it being reset to the default value on Evaluate;
     Formula.Evaluate();                          //force dependants to recalc.
     ParentComponent.EvalAll();                   // this recalcs mass etc. which don't seem to be dependants? TODO: mass, volume etc etc should get the dependant handle if needed.
 }