From a67da735b33be01b24845ce03ae7551cf55ddbbc Mon Sep 17 00:00:00 2001 From: ningshuxia <ningshuxia0927@outlook.com> Date: 星期三, 16 四月 2025 09:08:16 +0800 Subject: [PATCH] 代码修改i --- 01-api/Service/IStation.Service/07-helper/02-schedule/ScheduleHelper.cs | 45 ++++++++++++++++++++++++++------------------- 1 files changed, 26 insertions(+), 19 deletions(-) diff --git a/01-api/Service/IStation.Service/07-helper/02-schedule/ScheduleHelper.cs b/01-api/Service/IStation.Service/07-helper/02-schedule/ScheduleHelper.cs index 518304b..21c19de 100644 --- a/01-api/Service/IStation.Service/07-helper/02-schedule/ScheduleHelper.cs +++ b/01-api/Service/IStation.Service/07-helper/02-schedule/ScheduleHelper.cs @@ -1,6 +1,4 @@ -锘縰sing IStation.Application; - -namespace IStation.Service +锘縩amespace IStation.Service { /// <summary> /// 璋冨害鍒嗘瀽杈呭姪绫� @@ -18,7 +16,7 @@ this.Flag = flag; } public int Flag { get; set; } - } + } #endregion #region Private Variable @@ -32,7 +30,7 @@ private double _sel_opt_flow_excess = 1;//鍙�夋柟妗堢殑娴侀噺浣欓噺 private readonly double _sel_opt_pump_pressure_excess = 0;//鍙�夋柟妗堢殑鍗曟车鎵▼榛樿鎶崌浣欓噺 - private readonly double _sel_opt_flow_deviation_ratio = 0.05;//鍙�夋柟妗堢殑娴侀噺鍋忓樊姣� + private double _sel_opt_flow_deviation_ratio = 0.05;//鍙�夋柟妗堢殑娴侀噺鍋忓樊姣� private readonly double _sel_opt_reasonable_flow_deviation_ratio = 0.005;//鍚堢悊鐨勬柟妗堢殑娴侀噺鍋忓樊姣� private readonly Service.AnalysisParameter _service_analysis_parameter = new(); @@ -62,7 +60,6 @@ /// </summary> public void Initial(List<int> current_open_flag_list, Model.ScheduleConfig schedule_config, List<Model.AnalysisDeviation> analysis_deviation_list) { - _current_open_flag_list = current_open_flag_list; _min_open_count = 1; _max_open_count = 0; @@ -96,7 +93,7 @@ #region OptAnaCombine - + /// <summary> /// 鑾峰彇鏈�浼樼粍鍚� /// </summary> @@ -512,7 +509,7 @@ return default; //鍏堜慨姝g粍鍚堟洸绾垮拰妯″瀷鐨勫亸宸壃绋� - var combine_deviation_factor_dict = GetCombineDeviationFactorDict(target_flow, combine); + var combine_deviation_factor_dict = GetCombineDeviationFactorDict(target_flow, combine); var conclusion_ex_list_list = new List<List<AnalysisConclusionViewModel>>(); var conclusion_ex_list_dict = new Dictionary<int, List<AnalysisConclusionViewModel>>(); double max_supply_flow = 0; @@ -568,14 +565,24 @@ } if (conclusion_ex_list_list.Count != combine.Count()) - return default; + return default; if (max_supply_flow < target_flow * _sel_opt_flow_excess) { if (GlobalHelper.IsStation1(combine)) { - _sel_opt_flow_excess= 0.995; + _sel_opt_flow_excess = 0.995; } + else + { + //浜轰负淇 + if (combine.Count() < 3) + { + _sel_opt_flow_excess = 0.92; + _sel_opt_flow_deviation_ratio = 0.08; + } + } + var flow_excess = target_flow * _sel_opt_flow_excess; if (max_supply_flow < flow_excess) return default; @@ -700,7 +707,7 @@ ana_combine.TotalPower += opt_cl_ex.Power; var ana_fre_pump = new AnaFrePump(); - ana_fre_pump.Flag = flag; + ana_fre_pump.Flag = flag; ana_fre_pump.Flow = opt_cl_ex.Flow; ana_fre_pump.Head = opt_cl_ex.Head; ana_fre_pump.PressureDiff = opt_cl_ex.PressureDiff; @@ -945,7 +952,7 @@ Yw.LogHelper.Error($"[{Yw.Untity.IntListHelper.ToString(flags)}]缁勫悎涓嶅瓨鍦ㄥ亸宸郴鏁�!"); return deviation_factor_dict; } - + var a = flow; var flow_dev = flow; Model.AnalysisDeviation analysis_deviation = null; @@ -955,8 +962,8 @@ analysis_deviation = analysis_deviation_list.Where(x => x.MinFlow <= flow_dev && flow_dev <= x.MaxFlow).FirstOrDefault(); if (analysis_deviation != null) break; - } - + } + if (analysis_deviation == null) { Yw.LogHelper.Error($"[{Yw.Untity.IntListHelper.ToString(flags)}]缁勫悎涓嶅瓨鍦ㄥ亸宸郴鏁�!"); @@ -979,7 +986,7 @@ #endregion #region Expand - + /// <summary> /// 鑾峰彇鍙橀娉靛垪琛� 鏍规嵁宸ュ喌璁$畻 /// </summary> @@ -1050,7 +1057,7 @@ var fre_pump = new AnaFrePump(); - fre_pump.Flag = flag; + fre_pump.Flag = flag; fre_pump.Flow = flow; fre_pump.Head = head; fre_pump.Power = curveQP.GetFitPointY(flow); @@ -1116,7 +1123,7 @@ var CurveQH50 = pump.CurveQH; var CurveQP50 = pump.CurveQP; - + var curveQH = Curve.PumpCalculateHelper.CalculateSimilarQH(CurveQH50, pump.Nr, rpm); var curveQP = Curve.PumpCalculateHelper.CalculateSimilarQP(CurveQP50, pump.Nr, rpm); @@ -1150,7 +1157,7 @@ flag_curve_head_dic[flag] = curveQH.GetFitPointY(working_flow); var fre_pump = new AnaFrePump(); - fre_pump.Flag = flag; + fre_pump.Flag = flag; fre_pump.Flow = flow; fre_pump.Head = head; fre_pump.Power = curveQP.GetFitPointY(flow); @@ -1159,7 +1166,7 @@ fre_pump.Frequency = rpm / pump.Nr * 50; fre_pump.Speed = rpm; - ana_fre_pump_list.Add(fre_pump); + ana_fre_pump_list.Add(fre_pump); } -- Gitblit v1.9.3