public void InitialParametersWithCalculation() { Rcyt1 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rcyt1, () => { return(N1 * R1 + P1 * Rv2); }); Rf1 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rf1, () => { return((N1 * R1 + P1 * Rv2) * deltaT); }); Rcyt2 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rcyt2, () => { return(N2 * R2); }); Rf2 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rf2, () => { return((N2 * R2) * deltaT); }); Rcyt3 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rcyt3, () => { return(N3 * R3); }); Rf3 = new ParameterWithCalculation(this, NameParameterWithCalculation.Rf3, () => { return((N3 * R3) * deltaT); }); Rcyt = new ParameterWithCalculation(this, NameParameterWithCalculation.Rcyt, () => { return((N1 * R1 + P1 * Rv2) + (N2 * R2) + (N3 * R3)); }); R = new ParameterWithCalculation(this, NameParameterWithCalculation.R, () => { return(((N1 * R1 + P1 * Rv2) + (N2 * R2) + (N3 * R3)) * deltaT); }); Wсyt1 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wсyt1, () => { return(N1 * W1 + Wv2 * P1); }); Wf1 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wf1, () => { return((N1 * W1 + Wv2 * P1) * deltaT); }); Wcyt2 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wcyt2, () => { return(N2 * W2); }); Wf2 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wf2, () => { return(N2 * W2 * deltaT); }); Wcyt3 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wcyt3, () => { return(N3 * W3); }); Wf3 = new ParameterWithCalculation(this, NameParameterWithCalculation.Wf3, () => { return(N3 * W3 * deltaT); }); Wcyt = new ParameterWithCalculation(this, NameParameterWithCalculation.Wcyt, () => { return(N1 * W1 + Wv2 * P1 + N2 * W2 + N3 * W3); }); W = new ParameterWithCalculation(this, NameParameterWithCalculation.W, () => { return((N1 * W1 + Wv2 * P1 + N2 * W2 + N3 * W3) * deltaT); }); Smin1 = new ParameterWithCalculation(this, NameParameterWithCalculation.Smin1, () => { return((N1 * W1 + Wv2 * P1) / (Lc * Tc)); }); Smin2 = new ParameterWithCalculation(this, NameParameterWithCalculation.Smin2, () => { return((N2 * W2) / (Lc * Tc)); }); Smin3 = new ParameterWithCalculation(this, NameParameterWithCalculation.Smin3, () => { return((N3 * W3) / (Lc * Tc)); }); SminC = new ParameterWithCalculation(this, NameParameterWithCalculation.SminC, () => { return(Smin1 + Smin2 + Smin3); }); Smin = new ParameterWithCalculation(this, NameParameterWithCalculation.Smin, () => { return((Smin1 + Smin2 + Smin3) * Lc); }); S1 = new ParameterWithCalculation(this, NameParameterWithCalculation.S1, () => { return(Smin1 + Sn1); }); S2 = new ParameterWithCalculation(this, NameParameterWithCalculation.S2, () => { return(Smin2 + Sn2); }); S3 = new ParameterWithCalculation(this, NameParameterWithCalculation.S3, () => { return(Smin3 + Sn3); }); Sс = new ParameterWithCalculation(this, NameParameterWithCalculation.Sс, () => { return(S1 + S2 + S3); }); S = new ParameterWithCalculation(this, NameParameterWithCalculation.S, () => { return(((Smin1 + Smin2 + Smin3) + (Sn1 + Sn2 + Sn3) * deltaT) * Lc); }); SN1 = new ParameterWithCalculation(this, NameParameterWithCalculation.SN1, () => { return((Smin1 + deltaT * Sn1) * Lc); }); SN2 = new ParameterWithCalculation(this, NameParameterWithCalculation.SN2, () => { return((Smin2 + deltaT * Sn2) * Lc); }); SN3 = new ParameterWithCalculation(this, NameParameterWithCalculation.SN3, () => { return((Smin3 + deltaT * Sn3) * Lc); }); }
public dynamic ToResponse() { if (!HelperEnum.IsDefault(ParameterWithEnter)) { return(ParameterWithEnter.ToRestriction(ConditionType, Value)); } else if (!HelperEnum.IsDefault(ParameterWithCalculation)) { return(ParameterWithCalculation.ToRestriction(ConditionType, Value)); } else { return(ParameterWithEnter.ToRestriction(ConditionType, Value)); } }
public bool AddedToRestriction() { if (!HelperEnum.IsDefault(ParameterWithEnter)) { return(ParameterWithEnter.AddedToRestrictions()); } else if (!HelperEnum.IsDefault(ParameterWithCalculation)) { return(ParameterWithCalculation.AddedToRestrictions()); } else if (!HelperEnum.IsDefault(ParameterWithCalculation)) { return(ParameterWithEnter.AddedToRestrictions()); } throw new ArgumentNullException(paramName: "AddedToRestriction", "Неизвестный параметр"); }
public string GetDesignation() { if (!HelperEnum.IsDefault(ParameterWithEnter)) { return(ParameterWithEnter.GetDesignation()); } if (!HelperEnum.IsDefault(ParameterWithCalculation)) { return(ParameterWithCalculation.GetDesignation()); } if (!HelperEnum.IsDefault(ParameterForAnalysis)) { return(ParameterForAnalysis.GetDesignation()); } return(""); }
public bool AddToRestriction() { if (!HelperEnum.IsDefault(ParameterWithEnter)) { ParameterWithEnter.AddToRestrictions(ConditionType, Value); } else if (!HelperEnum.IsDefault(ParameterWithCalculation)) { ParameterWithCalculation.AddToRestrictions(ConditionType, Value); } else if (!HelperEnum.IsDefault(ParameterWithCalculation)) { ParameterWithEnter.AddToRestrictions(ConditionType, Value); } else { return(false); } return(true); }