| | |
| | | /// <returns></returns> |
| | | public static IStation.Calc.ErQuCalcBaseHelper Build(IStation.CalcModel.AnaRequest anaRequest) |
| | | { |
| | | if (anaRequest.MaxLimitWaterBoxLevel != null) |
| | | if (anaRequest.MaxReservoirLevel != null) |
| | | { |
| | | DateTime? limit_time = GetMaxLimitWaterBoxTime(anaRequest); |
| | | DateTime? limit_time = GetMaxReservoirLevelTime(anaRequest); |
| | | |
| | | if (limit_time == null) |
| | | { |
| | | var calc = new IStation.Calc.ErQuCalcHelper_2_閫掑綊_瀹氭按浣峗浠绘剰鏃堕棿(); |
| | | calc.SetMaxReservoirHeight(anaRequest.MaxLimitWaterBoxLevel.Value); |
| | | calc.SetMaxReservoirHeight(anaRequest.MaxReservoirLevel.Value); |
| | | |
| | | return calc; |
| | | } |
| | | else |
| | | { |
| | | var calc = new IStation.Calc.ErQuCalcHelper_2_閫掑綊_瀹氭按浣峗鎸囧畾鏃堕棿(); |
| | | calc.SetMaxReservoirHeight(anaRequest.MaxLimitWaterBoxLevel.Value, limit_time.Value); |
| | | calc.SetMaxReservoirHeight(anaRequest.MaxReservoirLevel.Value, limit_time.Value); |
| | | return calc; |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | private static DateTime? GetMaxLimitWaterBoxTime(IStation.CalcModel.AnaRequest anaRequest) |
| | | private static DateTime? GetMaxReservoirLevelTime(IStation.CalcModel.AnaRequest anaRequest) |
| | | { |
| | | if (string.IsNullOrEmpty(anaRequest.MaxLimitWaterBoxTime)) |
| | | if (string.IsNullOrEmpty(anaRequest.MaxReservoirLevelTime)) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | DateTime time; |
| | | if (DateTime.TryParse(anaRequest.MaxLimitWaterBoxTime, out time)) |
| | | if (DateTime.TryParse(anaRequest.MaxReservoirLevelTime, out time)) |
| | | { |
| | | return time; |
| | | } |
| | | |
| | | if (anaRequest.MaxLimitWaterBoxTime.Contains(":")) |
| | | if (anaRequest.MaxReservoirLevelTime.Contains(":")) |
| | | { |
| | | var sss = anaRequest.MaxLimitWaterBoxTime.Split(':'); |
| | | var sss = anaRequest.MaxReservoirLevelTime.Split(':'); |
| | | if (sss.Count() == 2) |
| | | { |
| | | int hour = 0; |
| | |
| | | else |
| | | { |
| | | int hour = 0; |
| | | if (int.TryParse(anaRequest.MaxLimitWaterBoxTime, out hour)) |
| | | if (int.TryParse(anaRequest.MaxReservoirLevelTime, out hour)) |
| | | { |
| | | if (hour < anaRequest.StartTime.Hour) |
| | | return new DateTime(anaRequest.EndTime.Year, anaRequest.EndTime.Month, anaRequest.EndTime.Day, hour, 0, 0); |
| | |
| | | /// <param name="anaRequest"></param> |
| | | public void SetAnaRequest(IStation.CalcModel.AnaRequest anaRequest) |
| | | { |
| | | this._start_level姘村簱姘翠綅 = anaRequest.CurrentWaterBoxLevel; |
| | | this._start_level姘村簱姘翠綅 = anaRequest.StartReservoirLevel; |
| | | this._clacOptType = anaRequest.CalcOptType; |
| | | |
| | | if(anaRequest.IsKnownStartOpenPump) |