Shuxia Ning
2024-12-23 a97513ccbb97b2c471e90b032fabdd2e709b7f32
WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/PhartExcelHelper.cs
@@ -130,10 +130,14 @@
            return "";
        }
        public static List<(double Q, double H, double P, double E)> ParsePumpExcel(string fileName)
        public static string ParsePumpExcel(string fileName, out List<Yw.Geometry.Point2d> qh, out List<Yw.Geometry.Point2d> qe, out List<Yw.Geometry.Point2d> qp)
        {
            qh = new List<Geometry.Point2d>();
            qe = new List<Geometry.Point2d>();
            qp = new List<Geometry.Point2d>();
            if (!File.Exists(fileName))
                return default;
                return "文件不存在";
            int line = 0;
            //初始化文件
@@ -149,7 +153,7 @@
            {
                sheet1 = theBook.GetSheetAt(0);
                if (sheet1 == null)
                    throw new Exception("无Sheet数据");
                   return ("无Sheet数据");
            }
            //标题行
@@ -166,7 +170,7 @@
            var row_title = sheet1.GetRow(title_line_index);
            if (row_title == null)
            {
                throw new Exception("第一行第一列不能空");
               return ("第一行第一列不能空");
            }
            //开始读取的行
@@ -174,7 +178,7 @@
            var cell_0 = row_title.GetCell(0);
            if (cell_0 == null)
            {
                throw new Exception("无法读取表头文件");
                return ("无法读取表头文件");
            }
            else if (cell_0.StringCellValue.Contains("序号"))
            {
@@ -250,11 +254,12 @@
                    throw new Exception("效率大于100%");
                }
                list.Add(new(flow, head, eff, power));
                qh.Add(new Geometry.Point2d(flow, head));
                qe.Add(new Geometry.Point2d(flow, eff));
                qp.Add(new Geometry.Point2d(flow, power));
            }
            return list;
            return "";
        }
        private static bool ParseCellValue(NPOI.SS.UserModel.ICell cell, out double cell_value)