From ad494f13d2ddf31f142cf7fb908b3a6e90395a1a Mon Sep 17 00:00:00 2001 From: ningshuxia <ningshuxia0927@outlook.com> Date: 星期四, 01 十二月 2022 12:01:31 +0800 Subject: [PATCH] 苏州金庭10个泵站 对接程序写完 --- Calculation/IStation.Calculation.Eta/standard/logic/EtaStandardLogicDayHelper.cs | 44 ++++++++++++++++++++++---------------------- 1 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Calculation/IStation.Calculation.Eta/standard/logic/EtaStandardLogicDayHelper.cs b/Calculation/IStation.Calculation.Eta/standard/logic/EtaStandardLogicDayHelper.cs index 6c868ed..86318f5 100644 --- a/Calculation/IStation.Calculation.Eta/standard/logic/EtaStandardLogicDayHelper.cs +++ b/Calculation/IStation.Calculation.Eta/standard/logic/EtaStandardLogicDayHelper.cs @@ -51,34 +51,34 @@ record.LowerLimit = configure.LowerLimit; record.UpperLimit = configure.UpperLimit; - record.Qmin = normal_limit_list.Min(t => t.Qa.Value); - record.Qmax = normal_limit_list.Max(t => t.Qa.Value); - record.Qavg = normal_limit_list.Average(t => t.Qa.Value); + record.Qmin = normal_limit_list.Where(x => x.Qa.HasValue).Min(t => t.Qa.Value); + record.Qmax = normal_limit_list.Where(x => x.Qa.HasValue).Max(t => t.Qa.Value); + record.Qavg = normal_limit_list.Where(x => x.Qa.HasValue).Average(t => t.Qa.Value); - record.Emin = normal_limit_list.Min(t => t.Ea.Value); - record.Emax = normal_limit_list.Max(t => t.Ea.Value); - record.Eavg = normal_limit_list.Average(t => t.Ea.Value); + record.Emin = normal_limit_list.Where(x => x.Ea.HasValue).Min(t => t.Ea.Value); + record.Emax = normal_limit_list.Where(x => x.Ea.HasValue).Max(t => t.Ea.Value); + record.Eavg = normal_limit_list.Where(x => x.Ea.HasValue).Average(t => t.Ea.Value); - record.Hmin = normal_limit_list.Min(t => t.Ha.Value); - record.Hmax = normal_limit_list.Max(t => t.Ha.Value); - record.Havg = normal_limit_list.Average(t => t.Ha.Value); + record.Hmin = normal_limit_list.Where(x => x.Ha.HasValue).Min(t => t.Ha.Value); + record.Hmax = normal_limit_list.Where(x => x.Ha.HasValue).Max(t => t.Ha.Value); + record.Havg = normal_limit_list.Where(x => x.Ha.HasValue).Average(t => t.Ha.Value); - record.Pmin = normal_limit_list.Min(t => t.Pa.Value); - record.Pmax = normal_limit_list.Max(t => t.Pa.Value); - record.Pavg = normal_limit_list.Average(t => t.Pa.Value); + record.Pmin = normal_limit_list.Where(x=>x.Pa.HasValue).Min(t => t.Pa.Value); + record.Pmax = normal_limit_list.Where(x => x.Pa.HasValue).Max(t => t.Pa.Value); + record.Pavg = normal_limit_list.Where(x => x.Pa.HasValue).Average(t => t.Pa.Value); - record.WPmin = normal_limit_list.Min(t => t.WPa.Value); - record.WPmax = normal_limit_list.Max(t => t.WPa.Value); - record.WPavg = normal_limit_list.Average(t => t.WPa.Value); + record.WPmin = normal_limit_list.Where(x => x.WPa.HasValue).Min(t => t.WPa.Value); + record.WPmax = normal_limit_list.Where(x => x.WPa.HasValue).Max(t => t.WPa.Value); + record.WPavg = normal_limit_list.Where(x => x.WPa.HasValue).Average(t => t.WPa.Value); - record.UWPmin = normal_limit_list.Min(t => t.UWPa.Value); - record.UWPmax = normal_limit_list.Max(t => t.UWPa.Value); - record.UWPavg = normal_limit_list.Average(t => t.UWPa.Value); + record.UWPmin = normal_limit_list.Where(x => x.UWPa.HasValue).Min(t => t.UWPa.Value); + record.UWPmax = normal_limit_list.Where(x => x.UWPa.HasValue).Max(t => t.UWPa.Value); + record.UWPavg = normal_limit_list.Where(x => x.UWPa.HasValue).Average(t => t.UWPa.Value); - record.Qt = normal_limit_list.Sum(x => x.Qa.Value * x.Duration) / 3600f; - record.Qtt = normal_list.Sum(x => x.Qa.Value * x.Duration) / 3600f; - record.Dt = normal_limit_list.Sum(x => x.Pa.Value * x.Duration) / 3600f; - record.Dtt = normal_list.Sum(x => x.Pa.Value * x.Duration) / 3600f; + record.Qt = normal_limit_list.Where(x => x.Qa.HasValue).Sum(x => x.Qa.Value * x.Duration) / 3600f; + record.Qtt = normal_list.Where(x => x.Qa.HasValue).Sum(x => x.Qa.Value * x.Duration) / 3600f; + record.Dt = normal_limit_list.Where(x => x.Pa.HasValue).Sum(x => x.Pa.Value * x.Duration) / 3600f; + record.Dtt = normal_list.Where(x => x.Pa.HasValue).Sum(x => x.Pa.Value * x.Duration) / 3600f; record.PointCount = normal_limit_list.Count; record.TotalPointCount = normal_list.Count(); -- Gitblit v1.9.3