From a97513ccbb97b2c471e90b032fabdd2e709b7f32 Mon Sep 17 00:00:00 2001
From: Shuxia Ning <NingShuxia0927@outlook.com>
Date: 星期一, 23 十二月 2024 17:28:36 +0800
Subject: [PATCH] 曲线修改

---
 WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/PhartExcelHelper.cs |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/PhartExcelHelper.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/PhartExcelHelper.cs
index b0843be..338a8df 100644
--- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/00-core/PhartExcelHelper.cs
+++ b/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("鏃燬heet鏁版嵁");
+                   return ("鏃燬heet鏁版嵁");
             }
 
             //鏍囬琛�
@@ -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)

--
Gitblit v1.9.3