From 5dac45fe6402027f1a19f331045c811c9e96b729 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 23 十月 2024 10:16:02 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs |  142 ++++++++++++++++++++++++++++++++---------------
 1 files changed, 97 insertions(+), 45 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs
index 549507a..7ccf441 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs
@@ -105,34 +105,6 @@
             this.popupMenu1.ShowPopup(MousePosition);
         }
 
-        private void bbi瀵煎嚭瀹夎鍥綺ItemClick(object sender, ItemClickEventArgs e)
-        {
-        }
-
-        private void bbi瀵煎嚭鎬ц兘鏇茬嚎_ItemClick(object sender, ItemClickEventArgs e)
-        {
-        }
-
-        private void bbi涓嬭浇BIM鏂囦欢_ItemClick(object sender, ItemClickEventArgs e)
-        {
-        }
-
-        private void bbi瀵煎嚭灞炴�ц〃_ItemClick(object sender, ItemClickEventArgs e)
-        {
-        }
-
-        private void navBtn閫夊瀷鎶ュ憡_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
-        {
-        }
-
-        private void navBtn鎵嬫満椤甸潰_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
-        {
-        }
-
-        private void navBtn瀵垮懡鎴愭湰璁$畻_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
-        {
-        }
-
         #region 鏈�澶ф渶灏忔寜閽搷浣�
 
         private void tileNavPane1_MouseDown(object sender, MouseEventArgs e)
@@ -358,6 +330,53 @@
         //琛ㄦ牸缂栬緫
         private void BarButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
         {
+            var dlg = new Yw.WinFrmUI.Phart.ImportPumpPerform2dByExcelDlg();
+            dlg.ReloadDataEvent += async (other_name, qh, qe, qp) =>
+            {
+                var bol = await Import(other_name, qh, qe, qp);
+                return bol;
+            };
+            dlg.ShowDialog();
+        }
+
+        //娉靛瀷鍙峰睘鎬х紪杈�
+        private void BarBtnEditProp_ItemClick(object sender, ItemClickEventArgs e)
+        {
+            var dlg = new EditPumpPartPropDlg();
+            dlg.SetBindingData(PumpPropViewCtrl.GetPumpMainVmo());
+            dlg.ShowDialog();
+            this.pumpFullInfoCtrl1.RefreshPropData();
+        }
+
+        //娉靛瀷鍙烽噸鏂板尮閰�
+        private void BarBtnRefreshMatching_ItemClick(object sender, ItemClickEventArgs e)
+        {
+            var dlg = new PumpSingleMatchingDlg();
+            dlg.SetBindingData(_pumpMatchingView);
+            dlg.ReloadDataEvent += (matching) =>
+            {
+                _pumpMatchingView = matching;
+                ReloadDataEvent.Invoke(_pumpMatchingView);
+                this.SetBindindData(_pumpMatchingView);
+            };
+            dlg.ShowDialog();
+        }
+
+        //鍗曠偣缂栬緫
+        private void BarButtonItemOnePoint_ItemClick(object sender, ItemClickEventArgs e)
+        {
+            var dlg = new Yw.WinFrmUI.Phart.ImportPumpPerform2dByOnePointDlg();
+            dlg.ReloadDataEvent += async (other_name, qh, qe, qp) =>
+            {
+                var bol = await Import(other_name, qh, qe, qp);
+                return bol;
+            };
+            dlg.ShowDialog();
+        }
+
+        //鏇茬嚎缂栬緫
+        private void BarButtonItemEdit_ItemClick(object sender, ItemClickEventArgs e)
+        {
             if (_xhs_phart_diagram_ex_std_dto == null)
             {
                 return;
@@ -416,38 +435,71 @@
                     graph_qe,
                     graph_qp,
                 };
+                Yw.Geometry.Point2d point2D = new Yw.Geometry.Point2d();
                 var bol = await _bll_ex.Update(_xhs_phart_diagram_ex_std_dto);
                 if (bol)
                 {
-                    // var pump_main = await new BLL.AssetsPumpMain().GetByID(_PumpId);
-                    //    this.pumpFullInfoCtrl1.InitChart(_pump_main, _xhs_phart_diagram_ex_std_dto);
                 }
                 return bol;
             };
             dlg.ShowDialog();
         }
 
-        //娉靛瀷鍙峰睘鎬х紪杈�
-        private void BarBtnEditProp_ItemClick(object sender, ItemClickEventArgs e)
+        //鍥剧墖缂栬緫
+        private void BarButtonItemPicture_ItemClick(object sender, ItemClickEventArgs e)
         {
-            var dlg = new EditPumpPartPropDlg();
-            dlg.SetBindingData(PumpPropViewCtrl.GetPumpMainVmo());
-            dlg.ShowDialog();
-            this.pumpFullInfoCtrl1.RefreshPropData();
         }
 
-        //娉靛瀷鍙烽噸鏂板尮閰�
-        private void BarBtnRefreshMatching_ItemClick(object sender, ItemClickEventArgs e)
+        // 瀵煎叆
+        private async Task<bool> Import(string other_name, Yw.Pump.CurveQH qh, Yw.Pump.CurveQE qe, Yw.Pump.CurveQP qp)
         {
-            var dlg = new PumpSingleMatchingDlg();
-            dlg.SetBindingData(_pumpMatchingView);
-            dlg.ReloadDataEvent += (matching) =>
+            if (_PumpId < 1)
             {
-                _pumpMatchingView = matching;
-                ReloadDataEvent.Invoke(_pumpMatchingView);
-                this.SetBindindData(_pumpMatchingView);
+                XtraMessageBox.Show("PumpMain is null!");
+                return false;
+            }
+
+            var input = new Vmo.XhsPumpMainPhartMappingExtensions();
+            input.PumpMainID = _PumpId;
+            input.Importance = 0;
+            input.OtherName = other_name;
+            input.Diagram = new Vmo.PhartDiagramExGraphList()
+            {
+                DiagramType = HStation.PhartRelation.eDiagramType.Feat,
+                Name = other_name,
+                GraphList = new List<Vmo.PhartGraph>()
+                {
+                    new ()
+                    {
+                        Name = other_name+"-QH",
+                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                        GraphType= HStation.PhartRelation.eGraphType.PumpQH,
+                        GeometryInfo=qh.ToDbString()
+                    },
+                    new ()
+                    {
+                        Name = other_name+"-QE",
+                        GeometryStyle= HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                        GraphType= HStation.PhartRelation.eGraphType.PumpQE,
+                        GeometryInfo=qe.ToDbString()
+                    },
+                    new ()
+                    {
+                        Name = other_name+"-QP",
+                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
+                        GraphType= HStation.PhartRelation.eGraphType.PumpQP,
+                        GeometryInfo=qp.ToDbString()
+                    },
+                }
             };
-            dlg.ShowDialog();
+
+            var mapping_id = await _bll_ex.Insert(input);
+            if (mapping_id < 1)
+            {
+                return false;
+            }
+            var xhs_phart_diagram_ex_std_dto = await _bll_ex.GetByID(mapping_id);
+            return true;
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3