lixiaojun
2024-12-19 1dd158434a41627a6684cd630b2696fb83b1e3d6
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
@@ -18,14 +18,18 @@
            this.simulationFunctionMgrCtrl1.ShowProjectSiteInfoEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent;
            this.simulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent;
            this.simulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingAppendEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent;
            this.simulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += SimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeAppendEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeUpdateEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeRemoveEvent;
        }
        private XhsProjectVmo _project = null;//项目
        private object _locker = new object();//锁定对象
        private object _locker = new();//锁定对象
        /// <summary>
        /// 初始化数据源
@@ -118,15 +122,28 @@
                    page.PageTitle.HeaderSvgImage = svgImage;
                    page.AppendWorkingEvent += (working) =>
                    {
                        //增加工况事件
                        this.simulationFunctionMgrCtrl1.AppendWorking(scheme, working);
                    };
                    page.SaveModelEvent += (rhs) =>
                    {
                        //保存模型事件
                        return this.simulationFunctionMgrCtrl1.SaveModel(scheme, rhs);
                    };
                    page.RefreshModelEvent += () =>
                    {
                        //刷新模型事件
                        return this.simulationFunctionMgrCtrl1.RefreshModel(scheme);
                    };
                    page.UpdateSchemeEvent += (rhs) =>
                    {
                        //更新方案事件
                        this.simulationFunctionMgrCtrl1.UpdateScheme(rhs);
                    };
                    page.RemoveSchemeEvent += (rhs) =>
                    {
                        //移除方案事件
                        this.simulationFunctionMgrCtrl1.RemoveScheme(rhs);
                    };
                    page.SetBindingData(project, projectSite, scheme, hydroInfo, allWorkingCheckedListDict);
                    CreatePage(page, guid);
@@ -172,6 +189,20 @@
            }
        }
        /// <summary>
        /// 项目站工况增加事件
        /// </summary>
        private void SimulationFunctionMgrCtrl1_ProjectSiteWorkingAppendEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                XhsSchemeVmo scheme,
                HydroWorkingVmo working
            )
        {
            //目前增加工况都是通过模拟界面增加的,功能管理控件属于被通知的,其他地方暂时不关心工况增加
        }
        //项目站工况更新事件
        private void SimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent
            (
@@ -186,7 +217,7 @@
                Modular = this.PageGuid.Modular,
                MoudingType = eMoudingType.Tab,
                Function = SimulationFunctionHelper.Simulation,
                TagName = projectSite.ID.ToString()
                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
            };
            var page = FindPage(guid);
            if (page == null)
@@ -269,17 +300,60 @@
                SvgImage svgImage
            )
        {
            //WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载模型,请稍侯...");
            //var dlg = new AddXhsSchemeDlg();
            //dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); };
            //dlg.ReloadDataEvent += (rhs) =>
            //{
            //    this.simulationFunctionMgrCtrl1.AppendScheme(rhs);
            //};
            //dlg.SetBindingData(project, projectSite, hydroInfo);
            //dlg.ShowDialog();
            WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载模型,请稍侯...");
            var dlg = new AddXhsSchemeDlg();
            var dlg = new CreateXhsSchemeDlg();
            dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); };
            dlg.SetBindingData(project, projectSite, hydroInfo);
            dlg.ReloadDataEvent += (rhs) =>
            {
                this.simulationFunctionMgrCtrl1.AppendScheme(rhs);
            };
            dlg.SetBindingData(project, projectSite, hydroInfo);
            dlg.ShowDialog();
        }
        //项目站方案增加事件
        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeAppendEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                XhsSchemeVmo scheme
            )
        {
            //被动
        }
        //项目站方案更新事件
        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeUpdateEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                XhsSchemeVmo scheme
            )
        {
            //被动
        }
        //项目站方案移除事件
        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeRemoveEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                XhsSchemeVmo scheme
            )
        {
            //被动
        }
        #endregion
        #region TabbedView 相关事件处理程序