222
tangxu
2025-01-13 1ecfbbf8b56f6c18f41cc1eead763c7fa93624ce
WinFrmUI/DPumpHydr.WinFrmUI.Volute/MainViewPage.cs
@@ -1,58 +1,167 @@


using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Text;
using System.Drawing;
using System.Drawing;
using HydrEngineCSharp;
using DPumpHydr.WinFrmUI.RLT.Native;
using DPumpHydr.WinFrmUI.RLT.Docking.Crown;
using DPumpHydr.WinFrmUI.Volute.TempCtrl;
//using static DPumpHydr.WinFrmUI.RLT.Helper.CrownHelper;
namespace DPumpHydr.WinFrmUI.Volute
{
    public partial class MainViewPage : System.Windows.Forms.UserControl
    {
        ParasInfoDockPanel _parasDockPanel = null;
        LogListDockPanel _logListDockPanel = null;
        LayersDockPanel _layersDockPanel = null;
        SectAreaDockPanel _sectAreaDockPanel = null;
        //参数控件
        ctrlHdrBaseInfo _ctrlHdrBaseInfo = null;
        ctrlSectionBundleInfo _ctrlSectionBundleInfo = null;
        ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null;
        ctrlSetOutflowParas _ctrlSetOutflowParas = null;
        ctrlSetOutflowType _ctrlSetOutflowType = null;
        ctrlThicknessParas _ctrlThicknessParas = null;
        //参数
        ViewModel.HdrBaseInfo _hdrBaseInfo = null;
        ViewModel.GeomBaseInfo _geomBaseInfo = null;
        ViewModel.SectionBundleInfo _sectionBundleInfo = null;
        ViewModel.OtuflowParas _outflowParas = null;
        ViewModel.eOutflowStyle _outflowType = ViewModel.eOutflowStyle.未知;
        private double _bodyThickness = 0;
        public MainViewPage()
        {
            InitializeComponent();
            //InitWindow();
            Application.AddMessageFilter(new ControlScrollFilter());
            InitialRibbonForm();
            // Add the dock content drag message filter to handle moving dock content around.
            Application.AddMessageFilter(MainDockPanel.DockContentDragFilter);
            // Add the dock panel message filter to filter through for dock panel splitter
            // input before letting events pass through to the rest of the application.
            Application.AddMessageFilter(MainDockPanel.DockResizeFilter);
            DPumpHydr.WinFrmUI.RLT.Helper.CrownHelper.ThemeProvider.Theme.Colors.HeaderBackground = Color.SteelBlue;
            DPumpHydr.WinFrmUI.RLT.Helper.CrownHelper.ThemeProvider.Theme.Colors.GreyBackground = Color.White;
            //ThemeProvider.Theme.Colors.DarkBackground = Color.White;
            MainDockPanel.RightDockWidth = 335;
            MainDockPanel.BottomDockHeight = 210;
        }
        ctrlHdrBaseInfo _ctrlHdrBaseInfo = null;
        ctrlGeomBaseInfo _ctrlGeomBaseInfo = null;
        ctrlSectionBaseInfo _ctrlSectionBaseInfo = null;
        ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null;
        ctrlSetOutflowStyle _ctrlSetOutflowStyle = null;
        ctrlSetOutflowDim _ctrlSetOutflowDim = null;
        public void InitWindow()
        {
            //InitialStepNodes();
            InitialRibbonForm();
            _logListDockPanel = new LogListDockPanel();
            _logListDockPanel.DefaultDockArea = DPumpHydr.WinFrmUI.RLT.Enum.Crown.DockArea.Bottom;
            _sectAreaDockPanel = new SectAreaDockPanel();
            _sectAreaDockPanel.DefaultDockArea = DPumpHydr.WinFrmUI.RLT.Enum.Crown.DockArea.Bottom;
            _sectAreaDockPanel.OnRefreshSingleSectArea  += (sect_index , sect_area) =>
            {
                this._ctrlSectionBundleInfo.RefreshSingleSectArea(sect_index, sect_area);
                //if(this._stepTreeDockPanel.CurrentStepID > this._stepTreeDockPanel.Step_ID_Section18_Full)
                //{
                //    this._ctrlSectionShapeInfo18.RefreshSectPara(bundle.ToSectionShapePara(selectedPointIndex));
                //}
            };
            _parasDockPanel = new ParasInfoDockPanel();
            _parasDockPanel.DefaultDockArea = DPumpHydr.WinFrmUI.RLT.Enum.Crown.DockArea.Right;
          //  SetParasCtrl(Step_ID_Hdr_Base_Info);
            _layersDockPanel = new LayersDockPanel();
            _layersDockPanel.InitialInfo();
            _layersDockPanel.DefaultDockArea = DPumpHydr.WinFrmUI.RLT.Enum.Crown.DockArea.Left;
          //  _currentStepID = Step_ID_Hdr_Base_Info;
            _stepTreeDockPanel = new StepTreeDockPanel();
            _stepTreeDockPanel.DefaultDockArea = DPumpHydr.WinFrmUI.RLT.Enum.Crown.DockArea.Left;
            this._stepTreeDockPanel.BeforeSelectedNodeChangedEvent += (arg1, arg2) =>
            {
                if (arg1 != null && SaveStepParas(arg1.ID) == false)
                {
                    return false;
                }
                return true;
            };
            this._stepTreeDockPanel.AfterSelectedNodeChangedEvent += (arg1, arg2) =>
            {
                //
                if (arg2 != null)
                {
                    if(arg1 == null || arg1.ID < arg2.ID)
                        this.SetParasCtrl(arg2.ID, DPumpHydr.ViewModel.eWizardStepDiretion.前进);
                    else
                        this.SetParasCtrl(arg2.ID, DPumpHydr.ViewModel.eWizardStepDiretion.后退);
                    //
                    this._stepTreeDockPanel.SetFocusedNode(arg2.ID);
                }
                CheckStepBtnStatus();
                return true;
            };
            MainDockPanel.AddContent(_logListDockPanel);
            MainDockPanel.AddContent(_sectAreaDockPanel);
            MainDockPanel.AddContent(_parasDockPanel);
            MainDockPanel.AddContent(_layersDockPanel);
            MainDockPanel.AddContent(_stepTreeDockPanel);
            MainDockPanel.AddContent(_stepTreeDockPanel, _layersDockPanel.DockGroup);
            MainDockPanel.AddContent(_sectAreaDockPanel, _logListDockPanel.DockGroup);
            RBtn后退.Enabled = false;
            Rbtn前进.Enabled = true;
            Rbtn下一步.Enabled = true;
            Rbtn上一步.Enabled = false;
            Rbtn完成.Enabled = false;
            InitialDesginPanel();
            InitialStepNodes();
        }
        #region 步骤操作
        //页面跳转前
        bool stepTreeListCtrl1_BeforeStepNodeChangedEvent(DPumpHydr.WinFrmUI.Volute.TreeStepNode CurrentStepNode, DPumpHydr.WinFrmUI.Volute.TreeStepNode NextStepNode)
        bool stepTreeListCtrl1_BeforeStepNodeChangedEvent(DPumpHydr.WinFrmUI.Base.StepTreeNodePara CurrentStepNode,
            DPumpHydr.WinFrmUI.Base.StepTreeNodePara NextStepNode)
        {
            return true;
        }
        //页面跳转后
        void stepTreeListCtrl1_SelectedStepNodeChangedEvent(DPumpHydr.WinFrmUI.Volute.TreeStepNode BeforeStepNode,
            DPumpHydr.WinFrmUI.Volute.TreeStepNode CurrentStepNode)
        void stepTreeListCtrl1_SelectedStepNodeChangedEvent(DPumpHydr.WinFrmUI.Base.StepTreeNodePara BeforeStepNode,
            DPumpHydr.WinFrmUI.Base.StepTreeNodePara CurrentStepNode)
        {
            //if (CurrentStepNode.Name == "StepHydParas")
            //{
@@ -74,13 +183,13 @@
        protected string GetTranslateString(string text)
        {
            return text;
        }
    }
}