/// <summary> /// 创建APU滑油消耗数据 /// </summary> /// <param name="apuReg">APU</param> /// <param name="date">日期</param> /// <param name="tsn">TSN</param> /// <param name="tsr">TSR</param> /// <param name="totalRate">总消耗率</param> /// <param name="intervalRate">区间消耗率</param> /// <param name="deltaIntervalRate">区间消耗率增量</param> /// <param name="averageRate3">总消耗率3天移动平均</param> /// <param name="averageRate7">总消耗率7天移动平均</param> /// <returns>滑油消耗数据</returns> public static OilMonitor CreateAPUOil( APUReg apuReg, DateTime date, decimal tsn, decimal tsr, decimal totalRate, decimal intervalRate, decimal deltaIntervalRate, decimal averageRate3, decimal averageRate7) { var oilMonitor = new OilMonitor { Date = date, TSN = tsn, TSR = tsr, TotalRate = totalRate, IntervalRate = intervalRate, DeltaIntervalRate = deltaIntervalRate, AverageRate3 = averageRate3, AverageRate7 = averageRate7, }; oilMonitor.GenerateNewIdentity(); var user = oilMonitor.SetApuOil(apuReg); if (!user.NeedMonitor) user.NeedMonitor = true; return oilMonitor; }
/// <summary> /// 设置APU滑油用户 /// </summary> /// <param name="snReg">APU滑油用户</param> /// <returns>滑油用户</returns> public APUReg SetApuOil(APUReg snReg) { if (snReg == null || snReg.IsTransient()) { throw new ArgumentException("APU滑油用户参数为空!"); } SnRegID = snReg.Id; return snReg; }