ningshuxia
2025-03-24 7b8ae93d47186c442ff890a1a83d108f115924c7
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
@@ -1,5 +1,4 @@
using DevExpress.Drawing;
using DevExpress.Utils.Svg;
using DevExpress.Utils.Svg;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraBars.Docking2010.Views;
using Yw.Vmo;
@@ -21,6 +20,7 @@
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingReloadEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingReloadEvent;
            this.simulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += SimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeAppendEvent;
            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeUpdateEvent;
@@ -119,21 +119,37 @@
                {
                    var page = new XhsProjectSimulationCorePage();
                    page.PageTitle.HeaderSvgImage = svgImage;
                    page.AppendWorkingEvent += (working) =>
                    page.GetModelEvent += (s) =>
                    {
                        //增加工况事件
                        this.simulationFunctionMgrCtrl1.AppendWorking(scheme, working);
                    };
                    page.SaveModelEvent += (rhs) =>
                    {
                        //保存模型事件
                        return this.simulationFunctionMgrCtrl1.SaveModel(scheme, rhs);
                        //获取模型事件
                        return this.simulationFunctionMgrCtrl1.GetModel(scheme);
                    };
                    page.RefreshModelEvent += () =>
                    {
                        //刷新模型事件
                        return this.simulationFunctionMgrCtrl1.RefreshModel(scheme);
                    };
                    page.AppendWorkingEvent += (working) =>
                    {
                        //增加工况事件
                        this.simulationFunctionMgrCtrl1.AppendWorking(scheme, working);
                    };
                    page.UpdateWorkingEvent += (working) =>
                    {
                        //更新工况事件
                        this.simulationFunctionMgrCtrl1.UpdateWorking(scheme, working);
                    };
                    page.RemoveWorkingEvent += (working) =>
                    {
                        //移除工况事件
                        this.simulationFunctionMgrCtrl1.RemoveWorking(scheme, working);
                    };
                    page.ReloadWorkingEvent += (dict) =>
                    {
                        //重载工况事件
                        this.simulationFunctionMgrCtrl1.ReloadWorking(scheme, dict);
                    };
                    page.UpdateSchemeEvent += (rhs) =>
                    {
                        //更新方案事件
@@ -207,7 +223,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)
@@ -237,7 +253,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)
@@ -252,29 +268,49 @@
            ctrl.UpdateWorkingCheckedList(working, hasChecked);
        }
        //项目站工况选择重载事件
        private void SimulationFunctionMgrCtrl1_ProjectSiteWorkingReloadEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                XhsSchemeVmo scheme,
                Dictionary<HydroWorkingVmo, bool> dict
            )
        {
            var guid = new PageGuid()
            {
                Modular = this.PageGuid.Modular,
                MoudingType = eMoudingType.Tab,
                Function = SimulationFunctionHelper.Simulation,
                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
            };
            var page = FindPage(guid);
            if (page == null)
            {
                return;
            }
            var ctrl = page as XhsProjectSimulationCorePage;
            if (ctrl == null)
            {
                return;
            }
            ctrl.ReloadWorkingCheckedList(dict);
        }
        //项目站方案创建事件
        private void SimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                Yw.Model.HydroModelInfo hydroInfo,
                List<XhsSchemeVmo> allSchemeList,
                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(), "正在加载模型,请稍侯...");
            WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载,请稍侯...");
            var dlg = new CreateXhsSchemeDlg();
            dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); };
            dlg.SetBindingData(project, projectSite, hydroInfo);
            dlg.SetBindingData(project, projectSite, hydroInfo, allSchemeList);
            dlg.ReloadDataEvent += (rhs) =>
            {
                this.simulationFunctionMgrCtrl1.AppendScheme(rhs);