From db33bc6d9a30db6be4b40e45097c9a87a67cc845 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 25 三月 2025 09:28:50 +0800
Subject: [PATCH] 直线圆弧

---
 WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_ExportImport.cs |  194 +++++++++++++++++++++++++++---------------------
 1 files changed, 108 insertions(+), 86 deletions(-)

diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_ExportImport.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_ExportImport.cs
index 549c0ff..dacf4ff 100644
--- a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_ExportImport.cs
+++ b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_ExportImport.cs
@@ -4,10 +4,7 @@
 using System.IO;
 using System.Text;
 using System.Drawing;
-using HydrEngineCSharp;
-using DPumpHydr.WinFrmUI.RLT.Native;
-using DPumpHydr.WinFrmUI.RLT.Docking.Crown;
-using DPumpHydr.WinFrmUI.Volute.TempCtrl; 
+using HydrEngineCSharp; 
 
 namespace DPumpHydr.WinFrmUI.Volute
 {
@@ -18,11 +15,49 @@
         /// </summary>
         public void ExportXmlFile()
         {
+            //if (_hdrBaseInfo == null)
+            //{
+            //    MessageBox.Show("鎮ㄨ繕娌℃湁瀹屾垚瀹氫箟鍙傛暟锛佽瀹氫箟瀹屾垚鍚庡湪杩涜瀵煎嚭锛侊紙鑷冲皯瀹屾垚绗笁姝ワ級");
+            //    return;
+            //}
+            var currentStepID = this._stepTreeDockPanel.CurrentStepID;
             if (_hdrBaseInfo == null)
             {
-                MessageBox.Show("鎮ㄨ繕娌℃湁瀹屾垚瀹氫箟鍙傛暟锛佽瀹氫箟瀹屾垚鍚庡湪杩涜瀵煎嚭锛侊紙鑷冲皯瀹屾垚绗笁姝ワ級");
-                return;
+                if (currentStepID == this._stepTreeDockPanel.Step_ID_Hdr_Base_Info)
+                {
+                    if (!SaveParaStep1())
+                    {
+                        MessageBox.Show("鎮ㄨ繕娌℃湁瀹屾垚瀹氫箟鍙傛暟锛佽璇ョ晫闈㈠叏閮ㄨ緭鍏ュ畬鎴愬悗鍦ㄨ繘琛屽鍑猴紒");
+                        return;
+                    }
+                    if (_sectionBundleInfo == null)
+                    {
+                        _sectionBundleInfo = new ViewModel.SectionBundleInfo();
+
+                        _sectionBundleInfo.BaseWidth = _geomBaseInfo.B3;
+                        _sectionBundleInfo.BaseCircleRadius = _geomBaseInfo.D3 / 2;
+
+                        _sectionBundleInfo.ResetAllParas(_hdrBaseInfo, _geomBaseInfo);
+                    }
+                }
             }
+            #region 鏆傛椂闇�瑕佸鍑虹洰鍓嶉〉闈㈢殑鍊硷紝骞舵病鏈夎繘琛屽垽鏂紝娴嬭瘯浣跨敤
+            if (currentStepID == this._stepTreeDockPanel.Step_ID_Hdr_Base_Info)
+            {
+                if (!SaveParaStep1())
+                    return ;
+            }
+            else if (currentStepID == this._stepTreeDockPanel.Step_ID_Section18_Full)
+            {
+                if (!SaveParaStep2())
+                    return ;
+            }
+            else if (currentStepID == this._stepTreeDockPanel.Step_ID_Outflow_Paras)
+            {
+                if (!SaveParaStep3())
+                    return ;
+            }
+            #endregion
             SaveFileDialog dlg = new SaveFileDialog();
             dlg.Title = "瀵煎嚭铚楀3淇℃伅";
             dlg.FileName = "铚楀3淇℃伅.xml";
@@ -33,8 +68,7 @@
                 dlg.FileName,
                 _hdrBaseInfo, 
                 _geomBaseInfo, 
-                _sectionBundleInfo,
-                _outflowType,
+                _sectionBundleInfo, 
                 _outflowParas,
                 this._bodyThickness); 
         }
@@ -54,111 +88,76 @@
                 dlg.FileName,
                 out  _hdrBaseInfo,
                 out _geomBaseInfo,
-                out _sectionBundleInfo,
-                out _outflowType,
+                out _sectionBundleInfo, 
                 out _outflowParas,
                 out this._bodyThickness);
             if(ret)
             {
+                this._occDesign2dCtrl.ClearAll();
+                this._occDesign3dCtrl.ClearAll();
+
                 #region  绗竴姝� 
-                if(_hdrBaseInfo != null) 
-                {
+                if (_hdrBaseInfo == null)
+                    return;
+                
                     if (_ctrlHdrBaseInfo == null)
                     {
                         _ctrlHdrBaseInfo = new ctrlHdrBaseInfo();
                         _ctrlHdrBaseInfo.Name = "ctrlHdrBaseInfo";
                     }
-                     
-                    _ctrlHdrBaseInfo.SetBindingData(_hdrBaseInfo); 
-                }
+                    _ctrlHdrBaseInfo.SetBindingData(_hdrBaseInfo);
+                    _ctrlHdrBaseInfo.SetBindingData(_geomBaseInfo);
+                    _ctrlHdrBaseInfo.SaveHistoryParas(_hdrBaseInfo, _geomBaseInfo);
+                _stepTreeDockPanel.SetFocusedNode(this._stepTreeDockPanel.Step_ID_Hdr_Base_Info);
                 #endregion
 
-                #region  绗簩姝�
-                if (_ctrlGeomBaseInfo != null)
-                {
-                    if (_ctrlGeomBaseInfo == null)
-                    {
-                        _ctrlGeomBaseInfo = new ctrlGeomBaseInfo();
-                        _ctrlGeomBaseInfo.Name = "ctrlGeomBaseInfo";
-                    }
-                    _ctrlGeomBaseInfo.SetBindingData(_geomBaseInfo); 
-                }
-                #endregion
 
-                #region  绗笁姝� 鏂潰鎬昏
-                if (_sectionBundleInfo != null)
+                #region  绗�2姝� 鏂潰鎬昏
+                if (_sectionBundleInfo == null)
+                    return;
+                CreateSectionStepCtrl();
+                DockStepParaCtrl(_ctrlSectionBundleInfo);
+                if(_ctrlSectionBundleInfo != null)
                 {
-                    if (_ctrlSectionBundleInfo == null)
-                    {
-                        _ctrlSectionBundleInfo = new ctrlSectionBundleInfo();
-                        _ctrlSectionBundleInfo.Name = "ctrlSectionBaseInfo";
-                        _ctrlSectionBundleInfo.OnRefreshShape += RefreshSectShapeWhole18;
-                    }
-           
-                    _ctrlSectionBundleInfo.InitialParas(_hdrBaseInfo, _geomBaseInfo);
                     _ctrlSectionBundleInfo.SetBindingData(_sectionBundleInfo);
-                    RefreshSectShapeWhole18(_sectionBundleInfo);
                 }
+                _ctrlSectionBundleInfo.ShowPage(_hdrBaseInfo, _geomBaseInfo,
+                        DPumpHydr.ViewModel.eWizardStepDiretion.鍓嶈繘, true);
+                _ctrlSectionBundleInfo.RefreshAllSectPara(_sectionBundleInfo);
+                RefreshSectShapeWhole18(_sectionBundleInfo);
+                _stepTreeDockPanel.SetFocusedNode(this._stepTreeDockPanel.Step_ID_Section18_Full);
                 #endregion
 
-        
-
-                #region  鍑烘按闈㈢被鍨嬮�夋嫨
-                if (_outflowType != ViewModel.eOutflowStyle.鏈煡)
-                {
-                    if (_ctrlSetOutflowType == null)
-                    {
-                        _ctrlSetOutflowType = new ctrlSetOutflowType();
-                        _ctrlSetOutflowType.Name = "ctrlSetOutflowDim";
-                    }
-                    this._ctrlSetOutflowType.SetBindingData(_outflowType);
-                } 
-                #endregion
 
                 #region  鍑烘按闈㈠弬鏁�
-                if (_outflowParas != null)
-                { 
-                    if (_ctrlSetOutflowStyle == null)
-                    {
-                        _ctrlSetOutflowStyle = new ctrlSetOutflowParas();
-                        _ctrlSetOutflowStyle.Name = "ctrlSetOutflowStyle";
-                        _ctrlSetOutflowStyle.OnRefreshShape2D += CreateWaterBody2D;
-                        _ctrlSetOutflowStyle.OnRefreshShape3D += CreateWaterBody3D;
-                        _ctrlSetOutflowStyle.InitialParas(_outflowType, _hdrBaseInfo, _geomBaseInfo, _sectionBundleInfo);
-                    }
-                    //CreateWaterBody2D(_outflowParas);
-                    CreateWaterBody3D(_outflowParas);
-                    
+                if (_outflowParas == null)
+                    return;
+                CreateOutflowStepCtrl();
 
-                    _ctrlSetOutflowStyle.SetBindingData(_outflowType,_outflowParas);
+                DockStepParaCtrl(_ctrlSetOutflowParas);
 
-                    #region  鍔犲帤
-                    if (_bodyThickness>0)
-                    {
-                        Rbtn鏁版嵁瀵煎嚭STP.Visible = true;
-                        Rbtn鏁版嵁瀵煎嚭IGS.Visible = true;
+                InitilOutflowStepCtrl(this._stepTreeDockPanel.Step_ID_Section18_Full);
 
-                        if (_ctrlThicknessParas == null)
-                        {
-                            _ctrlThicknessParas = new ctrlThicknessParas();
-                            _ctrlThicknessParas.Name = "ctrlThicknessParas";
-                            _ctrlThicknessParas.OnRefreshShape += (houdu) => {
-                                this._bodyThickness = houdu;
-                                this._occDesign3dCtrl.CreateOutletBody3d(houdu);
-                            };
-                             _ctrlThicknessParas.InitialParas(_bodyThickness);
-                            this._occDesign3dCtrl.CreateOutletBody3d(_bodyThickness);
-                        }
- 
-                    }
-                    #endregion
-                }
+                this._occDesign2dCtrl.SetAllSectionCurveVisible(false);
+                this._occDesign3dCtrl.SetAllSectionCurveVisible(false);
+
+                _stepTreeDockPanel.SetFocusedNode(this._stepTreeDockPanel.Step_ID_Outflow_Paras);
 
                 #endregion
 
 
+                #region  鍔犲帤
+                if (_bodyThickness < 1)
+                    return;
+                InitilThicknessStepCtrl(this._stepTreeDockPanel.Step_ID_Outflow_Paras);
+
+                DockStepParaCtrl(_ctrlThicknessParas);
+                _stepTreeDockPanel.SetFocusedNode(this._stepTreeDockPanel.Step_ID_Thickness);
+
+                #endregion
             }
         }
+        
 
 
         /// <summary>
@@ -176,7 +175,19 @@
             dlg.FileName = "铚楀3.stp";
             dlg.Filter = "stp鏂囦欢 (*.stp)|*.stp";
             if (dlg.ShowDialog() == DialogResult.OK)
-                this._occDesign3dCtrl.ExportWaterBodyFile(dlg.FileName, FileType.ESTEPFILE); 
+            {
+                this._occDesign3dCtrl.ExportThicknessBody(dlg.FileName.Replace(".stp", "_body.stp"), FileType.ESTEPFILE);
+                this._occDesign3dCtrl.ExportWaterBodyFile(dlg.FileName.Replace(".stp","_water.stp"), FileType.ESTEPFILE);
+
+                new DPumpHydr.WinFrmUI.VoluteXmlParasTranHelper().Save(
+    dlg.FileName.Replace(".stp", ".xml"),
+    _hdrBaseInfo,
+    _geomBaseInfo,
+    _sectionBundleInfo, 
+    _outflowParas,
+    this._bodyThickness);
+            }
+                
         }
       
         
@@ -197,7 +208,18 @@
             dlg.FileName = "铚楀3.igs";
             dlg.Filter = "igs鏂囦欢 (*.igs)|*.igs";
             if (dlg.ShowDialog() == DialogResult.OK)
-                this._occDesign3dCtrl.ExportWaterBodyFile(dlg.FileName, FileType.EIGESFILE);
+            {
+                this._occDesign3dCtrl.ExportThicknessBody(dlg.FileName.Replace(".igs", "_body.igs"), FileType.EIGESFILE);
+                this._occDesign3dCtrl.ExportWaterBodyFile(dlg.FileName.Replace(".igs", "_water.igs"), FileType.EIGESFILE);
+
+                new DPumpHydr.WinFrmUI.VoluteXmlParasTranHelper().Save(
+    dlg.FileName.Replace(".stp", ".igs"),
+    _hdrBaseInfo,
+    _geomBaseInfo,
+    _sectionBundleInfo, 
+    _outflowParas,
+    this._bodyThickness);
+            } 
 
         }
     }

--
Gitblit v1.9.3