Shuxia Ning
2024-11-11 750b85dc4c5562b9c0dc9b8c463e5cc5f0ad2553
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
@@ -14,17 +14,26 @@
            this.PageTitle.HeaderSvgImage = this.svgImg32[0];
            this.PageTitle.SvgImageSize = new Size(24, 24);
            this.xhsProjectSimulationSchemeMgrCtrl1.ProjectSiteSelectedChangedEvent += XhsProjectSimulationSchemeMgrCtrl1_ProjectSiteSelectedChangedEvent;
            this.xhsProjectSimulationFunctionMgrCtrl1.ProjectSiteSelectedChangedEvent += xhsProjectSimulationFunctionMgrCtrl1_ProjectSiteSelectedChangedEvent;
            this.xhsProjectSimulationFunctionMgrCtrl1.ShowXhsProjectInfoEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowXhsProjectInfoEvent;
            this.xhsProjectSimulationFunctionMgrCtrl1.ShowXhsProjectSimulationEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowXhsProjectSimulationEvent;
            this.xhsProjectSimulationFunctionMgrCtrl1.CreateXhsProjectSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_CreateXhsProjectSchemeEvent;
            this.xhsProjectSimulationFunctionMgrCtrl1.CompareXhsProjectSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_CompareXhsProjectSchemeEvent;
            PumpFullInfoViewDlg.JumpPumpFullInfoCtrl += ShowPumpInfo;
        }
        private long _projectId;//项目id
        private XhsProjectVmo _project = null;//项目
        private XhsProjectSiteVmo _projectSite = null;//项目站
        private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
        /// <summary>
        /// 初始化数据源
        /// </summary>
        public override void InitialDataSource()
        {
            base.InitialDataSource();
        }
        /// <summary>
        /// 绑定数据
@@ -46,20 +55,14 @@
            }
            _project = project;
            _projectId = project.ID;
            this.PageTitle.Caption = $"{_project.Name}\r\n水力模拟";
            await this.xhsProjectSimulationSchemeMgrCtrl1.SetBindingData(_project);
            this.PageTitle.Caption = $"{_project.Name}\r\n项目模拟";
            await this.xhsProjectSimulationFunctionMgrCtrl1.SetBindingData(_project);
        }
        /// <summary>
        /// 初始化数据源
        /// </summary>
        public override void InitialDataSource()
        {
            base.InitialDataSource();
        }
        #region 功能面板
        //项目站选择改变事件
        private async void XhsProjectSimulationSchemeMgrCtrl1_ProjectSiteSelectedChangedEvent(XhsProjectSiteVmo obj)
        private async void xhsProjectSimulationFunctionMgrCtrl1_ProjectSiteSelectedChangedEvent(XhsProjectSiteVmo obj)
        {
            _projectSite = obj;
            if (_projectSite != null)
@@ -67,7 +70,7 @@
                var hydroRelation = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance
                   .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
                _hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroRelation.ModelID);
                this.xhsProjectSimulationFunctionMgrCtrl1.SetBindingData();
                this.xhsProjectSimulationFunctionMgrCtrl1.ResetBindingData();
            }
        }
@@ -86,7 +89,6 @@
                await page.SetBindingData(_project, _projectSite, _hydroInfo);
                CreatePage(page, guid);
            }
        }
        //显示水力模拟事件
@@ -113,20 +115,26 @@
            {
                return;
            }
            var dlg = new AddXhsProjectSimulationSchemeDlg();
            await dlg.SetBindingData(_projectSite.ID);
            dlg.ReloadDataEvent += (scheme) =>
            {
                this.xhsProjectSimulationSchemeMgrCtrl1.AppendScheme(scheme);
            };
            //var dlg = new AddXhsProjectSimulationSchemeDlg();
            //await dlg.SetBindingData(_projectSite.ID);
            //dlg.ReloadDataEvent += (scheme) =>
            //{
            //    this.xhsProjectSimulationFunctionMgrCtrl1.AppendScheme(scheme);
            //};
            //dlg.ShowDialog();
            var dlg = new AddXhsSchemeDlg();
            await dlg.SetBindingData(_project, _projectSite, _hydroInfo);
            dlg.ShowDialog();
        }
        //比较项目方案事件
        private void XhsProjectSimulationFunctionMgrCtrl1_CompareXhsProjectSchemeEvent(DevExpress.Utils.Svg.SvgImage obj)
        {
            TipFormHelper.ShowWarn("正在开发中,敬请期待...");
        }
        #endregion 功能面板
        #region TabbedView 相关事件处理程序
@@ -408,5 +416,19 @@
        }
        #endregion Page
        private void ShowPumpInfo(PumpFullInfoCtrl pumpFullInfoCtrl)
        {
            var guid = new PageGuid()
            {
                Modular = this.PageGuid.Modular,
                MoudingType = eMoudingType.Tab,
                Function = "xhs-project-pump-info",
            };
            if (!IsExistPage(guid, true))
            {
                CreatePage(pumpFullInfoCtrl, guid);
            }
        }
    }
}