tangxu
2024-12-27 9cc5bf68aaab46f33f2b00f8dcef0ab52ced0c41
WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage_StepInfo.cs
@@ -3,8 +3,7 @@
using System.Windows.Forms;
using System.IO;
using System.Text;
using System.Linq;
using DPumpHydr.WinFrmUI.Volute.ViewModel;
using System.Linq;
namespace DPumpHydr.WinFrmUI.Volute
{
@@ -13,19 +12,10 @@
        //步骤控件
        StepTreeDockPanel _stepTreeDockPanel = null;
        //参数控件
        ctrlHdrBaseInfo _ctrlHdrBaseInfo = null;
        ctrlGeomBaseInfo _ctrlGeomBaseInfo = null;
        ctrlSectionBundleInfo _ctrlSectionBundleInfo = null;
        ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null;
        ctrlSetOutflowStyle _ctrlSetOutflowStyle = null;
        ctrlSetOutflowDim _ctrlSetOutflowDim = null;
        //参数
        ViewModel.HdrBaseInfo _hdrBaseInfo = null;
        ViewModel.GeomBaseInfo _geomBaseInfo = null;
        ViewModel.SectionBundleInfo _sectionBundleInfo = null;
        /// <summary>
        /// 下一步
@@ -224,7 +214,8 @@
                _ctrlHdrBaseInfo.SetBindingData(_hdrBaseInfo);
                AddStepParaCtrl(_ctrlHdrBaseInfo);
                AddStepParaCtrl(_ctrlHdrBaseInfo);
                this._sectAreaDockPanel.Visible = false;
            }
            //第二步
@@ -237,62 +228,89 @@
                }
                _ctrlGeomBaseInfo.SetBindingData(_geomBaseInfo);
                AddStepParaCtrl(_ctrlGeomBaseInfo);
                this._sectAreaDockPanel.Visible = false;
            }
            //第三步
            //第三步 断面总览
            if (step_id == this._stepTreeDockPanel.Step_ID_Section18_Full)
            {
                if (_ctrlSectionBundleInfo == null)
                {
                    _ctrlSectionBundleInfo = new ctrlSectionBundleInfo();
                    _ctrlSectionBundleInfo.Name = "ctrlSectionBaseInfo";
                    _ctrlSectionBundleInfo.OnRefreshShape += RefreshSectShape18;
                    _ctrlSectionBundleInfo.OnRefreshShape += RefreshSectShapeWhole18;
                }
                AddStepParaCtrl(_ctrlSectionBundleInfo);
                _ctrlSectionBundleInfo.InitialParas(_hdrBaseInfo, _geomBaseInfo);
                _ctrlSectionBundleInfo.SetBindingData(_sectionBundleInfo);
                RefreshSectShapeWhole18(_sectionBundleInfo);
                this._sectAreaDockPanel.RefreshControl();
                this._sectAreaDockPanel.Visible = true;
            }
            //第四步
            //第四步 1-8断面
            if (step_id > this._stepTreeDockPanel.Step_ID_Section18_Grp &&
                step_id <= this._stepTreeDockPanel.Step_ID_Section18_Grp + 8)
            {
                if (_sectionBundleInfo == null)
                    return;
                if (_ctrlSectionShapeInfo18 == null)
                {
                    _ctrlSectionShapeInfo18 = new ctrlSectionShapeInfo18();
                    _ctrlSectionShapeInfo18.Name = "ctrlSectionShapeInfo18";
                    //_ctrlSectionShapeInfo18.OnRefreshShape += RefreshSectShape18;
                    _ctrlSectionShapeInfo18.OnRefreshShape += RefreshSectShapeSingle18;
                }
                AddStepParaCtrl(_ctrlSectionShapeInfo18);
                var sect_index = 9 + this._stepTreeDockPanel.Step_ID_Section18_Grp- step_id ;
                var sect_index = 9 + this._stepTreeDockPanel.Step_ID_Section18_Grp - step_id;
                var shape_info = _sectionBundleInfo.ToSectionShapePara((int)sect_index);
                 _ctrlSectionShapeInfo18.SetBindingData(shape_info);
                RefreshSectShapeSingle18(shape_info);
                _ctrlSectionShapeInfo18.SetBindingData(shape_info);
                this._sectAreaDockPanel.RefreshControl();
                this._sectAreaDockPanel.Visible = true;
            }
            //出水面类型选择
            if (step_id == this._stepTreeDockPanel.Step_ID_Outflow_Type)
            {
                if (_ctrlSetOutflowType == null)
                {
                    _ctrlSetOutflowType = new ctrlSetOutflowType();
                    _ctrlSetOutflowType.Name = "ctrlSetOutflowDim";
                }
                this._sectAreaDockPanel.Visible = true;
                this._sectAreaDockPanel.RefreshControl();
                AddStepParaCtrl(_ctrlSetOutflowType);
            }
            //出水面参数
            if (step_id == this._stepTreeDockPanel.Step_ID_Outflow_Style)
            {
                _outflowType = _ctrlSetOutflowType.GetBindingData();
                if (_ctrlSetOutflowStyle == null)
                {
                    _ctrlSetOutflowStyle = new ctrlSetOutflowStyle();
                    _ctrlSetOutflowStyle = new ctrlSetOutflowParas();
                    _ctrlSetOutflowStyle.Name = "ctrlSetOutflowStyle";
                    _ctrlSetOutflowStyle.OnRefreshShape += CreateWaterBody;
                    _ctrlSetOutflowStyle.InitialParas(_outflowType, _hdrBaseInfo, _geomBaseInfo, _sectionBundleInfo);
                }
                _ctrlSetOutflowStyle.SetOutflowStyle(_outflowType);
                _ctrlSetOutflowStyle.ShowPage();
                this._sectAreaDockPanel.RefreshControl();
                this._sectAreaDockPanel.Visible = true;
                AddStepParaCtrl(_ctrlSetOutflowStyle);
                string error = "";
                _otuflowParas = _ctrlSetOutflowStyle.GetBindingData(out error);
            }
            if (step_id == this._stepTreeDockPanel.Step_ID_Outflow_Dim)
            if (step_id == this._stepTreeDockPanel.Step_ID_jiahout)
            {
                if (_ctrlSetOutflowDim == null)
                {
                    _ctrlSetOutflowDim = new ctrlSetOutflowDim();
                    _ctrlSetOutflowDim.Name = "ctrlSetOutflowDim";
                }
                AddStepParaCtrl(_ctrlSetOutflowDim);
                this._occDesign3dCtrl.CreateOutletBody3d();
            }
        }
        /// <summary>
@@ -302,8 +320,7 @@
        private DPumpHydr.WinFrmUI.Volute.ParasInfoBaseCtrl GetParasCtrl(long step_id)
        {
            if (step_id == this._stepTreeDockPanel.Step_ID_Hdr_Base_Info)
            {
            {
                return _ctrlHdrBaseInfo;
            }
            //第二步 
@@ -337,29 +354,6 @@
            this._parasDockPanel.Controls.Clear();
            ctrl.Dock = DockStyle.Fill;
            this._parasDockPanel.Controls.Add(ctrl); 
        }
        /// <summary>
        /// 蜗壳参数导出
        /// </summary>
        public void VoluteDeriveArgument()
        {
            //if (_sectionBaseInfo == null)
            //{
            //    MessageBox.Show("您还没有完成定义参数!请定义完成后在进行导出!(至少完成第三步)");
            //    return;
            //}
            //if (_currentStepID <= 21)
            //{
            //    DialogResult result = MessageBox.Show("确定不进行后续断面参数的调整,使用初始计算后的参数吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            //    if (result == DialogResult.Cancel)
            //    {
            //        return;
            //    }
            //}
            //ViewModel.SectionShapePara VoluteArgument = new ViewModel.SectionShapePara();
            //string json = VoluteArgument.DeriveArgument(_sectionBaseInfo);
            //string filePath = Path.Combine(@"C:\Users\THL\Desktop", $"蜗壳参数.json");
            //File.WriteAllText(filePath, json);
        }
        #region 初始化步骤列表