public ErrorMessage Specify(ProcessVarDouble pv, double aValue) { if (!pv.HasValueOf(aValue)) { pv.Value = aValue; pv.State = VarState.Specified; OnProcessVarValueCommitted(pv); } return(null); }
public ErrorMessage Specify(ProcessVarDouble pv, double aValue) { ErrorMessage retMsg = null; if (pv.HasValueOf(aValue)) { return(retMsg); } else if (aValue != Constants.NO_VALUE) { retMsg = CheckSpecifiedValueRange(pv, aValue); if (retMsg != null) { return(retMsg); } } //remember currently being specified variable value double oldValue = pv.Value; beingSpecifiedProcVar = pv; pv.Value = aValue; pv.State = VarState.Specified; try { unitOpSystem.OnCalculationStarted(); //must tell UI calculation has started already HasBeenModified(true); unitOpSystem.OnCalculationEnded(); //must tell UI calculation has ended already } catch (Exception e) { pv.Value = oldValue; retMsg = HandleException(e); //HasBeenModified(true); } OnProcessVarValueCommitted(pv); return(retMsg); }