From 0b144a7be613efeae09d3de5ba10f6eac246e06b Mon Sep 17 00:00:00 2001
From: Shuxia Ning <NingShuxia0927@outlook.com>
Date: 星期一, 23 十二月 2024 17:10:41 +0800
Subject: [PATCH] pump chart 图片导入

---
 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/03-import/01-excel/PumpChartExcelImportCtrl.cs |   80 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/03-import/01-excel/PumpChartExcelImportCtrl.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/03-import/01-excel/PumpChartExcelImportCtrl.cs
index 53e0046..b95c205 100644
--- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/03-import/01-excel/PumpChartExcelImportCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/03-import/01-excel/PumpChartExcelImportCtrl.cs
@@ -1,19 +1,26 @@
-锘縩amespace HStation.WinFrmUI
+锘縰sing Yw.WinFrmUI.Phart;
+
+namespace HStation.WinFrmUI
 {
     public partial class PumpChartExcelImportCtrl : DevExpress.XtraEditors.XtraUserControl
     {
         public PumpChartExcelImportCtrl()
         {
             InitializeComponent();
-        }
-
+        } 
 
         /// <summary>
         /// 缁戝畾鏁版嵁
         /// </summary>  
         public void SetBindingData(string file_path)
         {
-
+            var err_msg = Yw.WinFrmUI.PhartExcelHelper.ParsePumpExcel(file_path, out List<Yw.Geometry.Point2d> qh, out List<Yw.Geometry.Point2d> qe, out List<Yw.Geometry.Point2d> qp);
+            if (!string.IsNullOrEmpty(err_msg))
+            {
+                XtraMessageBox.Show(err_msg);
+                return;
+            }
+            this.pumpChartExcelEditCtrl1.SetBindingData(qh, qe, qp);
         }
 
 
@@ -22,8 +29,71 @@
         /// </summary> 
         public Yw.Vmo.PhartDiagramExGraphListVmo Get()
         {
-            return new  ();
+            if (!this.pumpChartExcelEditCtrl1.Get
+                 (
+                   out List<Yw.Geometry.Point2d> def_qh_pt_list,
+                   out List<Yw.Geometry.Point2d> def_qe_pt_list,
+                   out List<Yw.Geometry.Point2d> def_qp_pt_list,
+                   out Yw.Ahart.eFeatType feat_type_qh,
+                   out Yw.Ahart.eFeatType feat_type_qe,
+                   out Yw.Ahart.eFeatType feat_type_qp
+                   )
+                 )
+            {
+                return default;
+            }
+
+            var vmo = new Yw.Vmo.PhartDiagramExGraphListVmo();
+            vmo.DiagramType = (int)HStation.PhartRelation.eDiagramType.Feat;
+            vmo.GraphList = new List<Yw.Vmo.PhartGraphVmo>()
+            {
+                new ()
+                {
+                      GraphType =(int)Yw.Ahart.eCurveType.QH,
+                      GraphParas= new HStation.Model.QHGraphParasModel()
+                      {
+                          Hz=50,
+                      }.ToJson(),
+                      GeometryParas= new HStation.Model.FeatCurveGeometryParasModel
+                        {
+                            DefinePoints = def_qh_pt_list
+                        }.ToJson(),
+                      GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                      GeometryInfo = def_qh_pt_list.ToDbString(Yw.Ahart.eCurveType.QH,feat_type_qh)
+                },
+                new ()
+                {
+                      GraphType =(int)Yw.Ahart.eCurveType.QE,
+                        GraphParas= new HStation.Model.QEGraphParasModel()
+                      {
+                          Hz=50,
+                      }.ToJson(),
+                      GeometryParas= new HStation.Model.FeatCurveGeometryParasModel
+                        {
+                            DefinePoints = def_qe_pt_list
+                        }.ToJson(),
+                      GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                      GeometryInfo = def_qe_pt_list.ToDbString(Yw.Ahart.eCurveType.QE,feat_type_qe)
+                },
+                new ()
+                {
+                      GraphType =(int)Yw.Ahart.eCurveType.QP,
+                          GraphParas= new HStation.Model.QPGraphParasModel()
+                      {
+                          Hz=50,
+                      }.ToJson(),
+                      GeometryParas= new HStation.Model.FeatCurveGeometryParasModel
+                        {
+                            DefinePoints = def_qp_pt_list
+                        }.ToJson(),
+                      GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                      GeometryInfo = def_qp_pt_list.ToDbString(Yw.Ahart.eCurveType.QP,feat_type_qp)
+                },
+            };
+
+            return vmo;
         }
 
+
     }
 }

--
Gitblit v1.9.3