public static void UpdateThreshold(Threshold existThreshold, PnReg pnReg, decimal totalThreshold, decimal intervalThreshold, decimal deltaIntervalThreshold, decimal average3Threshold, decimal average7Threshold) { if (existThreshold == null) return; existThreshold.SetPnReg(pnReg); existThreshold.TotalThreshold = totalThreshold; existThreshold.IntervalThreshold = intervalThreshold; existThreshold.DeltaIntervalThreshold = deltaIntervalThreshold; existThreshold.Average3Threshold = average3Threshold; existThreshold.Average7Threshold = average7Threshold; }
/// <summary> /// 创建阀值 /// </summary> /// <param name="pnReg"></param> /// <param name="totalThreshold">总滑油消耗率阀值</param> /// <param name="intervalThreshold">区间滑油消耗率阀值</param> /// <param name="deltaIntervalThreshold">区间滑油消耗率变化量阀值</param> /// <param name="average3Threshold">3天移动平均阀值</param> /// <param name="average7Threshold">7天移动平均阀值</param> /// <returns></returns> public static Threshold CreateThreshold(PnReg pnReg, decimal totalThreshold, decimal intervalThreshold, decimal deltaIntervalThreshold, decimal average3Threshold, decimal average7Threshold) { var threshold = new Threshold { TotalThreshold = totalThreshold, IntervalThreshold = intervalThreshold, DeltaIntervalThreshold = deltaIntervalThreshold, Average3Threshold = average3Threshold, Average7Threshold = average7Threshold, }; threshold.GenerateNewIdentity(); threshold.SetPnReg(pnReg); return threshold; }