using IStation.Model; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.Calc.ErQu { public class GlobalParas { public GlobalParas() { } public static AnaSetting AnaSetting { get; set; } public static List RiverWaterLevelDrops { get; set; } public static List ReservoirParasList { get; set; } public static double CalcLevel(double start_level, double flow) { var _list = ReservoirParasList; if (start_level <= _list.First().Level) { double area水库面积 = _list.First().Area; if (area水库面积 < 1) { return start_level; } var height = flow / area水库面积 / 10000; return Math.Round(start_level + height, 4); } if (start_level >= _list.Last().Level) { double area水库面积 = _list.Last().Area; if (area水库面积 < 1) { return start_level; } var height = flow / area水库面积 / 10000; return Math.Round(start_level + height, 4); } for (int i = 0; i < _list.Count; i++) { if (start_level < _list[i].Level) { double area水库面积 = _list[i].Area; var height = flow / area水库面积 / 10000; return Math.Round(start_level + height, 4); } } { double area水库面积 = _list.Last().Area; if (area水库面积 < 1) { return start_level; } var height = flow / area水库面积 / 10000; return Math.Round(start_level + height, 4); } } } }