From 7e5fcbee07c65bed3333eb295d0d5117df46b939 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期四, 05 十二月 2024 22:50:28 +0800 Subject: [PATCH] 修改阀门单独匹配 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs | 106 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 71 insertions(+), 35 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs index 93e9243..f9fd277 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs @@ -1,4 +1,6 @@ -锘縰sing DevExpress.XtraBars.Docking; +锘縰sing DevExpress.Drawing; +using DevExpress.Utils.Svg; +using DevExpress.XtraBars.Docking; using DevExpress.XtraBars.Docking2010.Views; using Yw.Vmo; using Yw.WinFrmUI.Page; @@ -17,6 +19,9 @@ this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent; this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent; this.xhsProjectSimulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += XhsProjectSimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent; + this.xhsProjectSimulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent; + this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSchemeEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeEvent; + this.xhsProjectSimulationFunctionMgrCtrl1.ShowProjectSiteSchemeWorkingEvent += XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeWorkingEvent; } private XhsProjectVmo _project = null;//椤圭洰 @@ -62,7 +67,7 @@ //鏄剧ず椤圭洰绔欐鍐典簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, SvgImage svgImage) { lock (_locker) { @@ -84,7 +89,7 @@ //鏄剧ず椤圭洰绔欐按鍔涙ā鎷熶簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> allWorkingCheckedListDict, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> allWorkingCheckedListDict, SvgImage svgImage) { lock (_locker) { @@ -111,7 +116,7 @@ //鏄剧ず椤圭洰绔欏伐鍐典簨浠� private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent - (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, DevExpress.Utils.Svg.SvgImage svgImage) + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, SvgImage svgImage) { lock (_locker) { @@ -125,6 +130,14 @@ if (!IsExistPage(guid, true)) { var page = new XhsProjectSimulationWorkingPage(); + page.UpdateWorkingEvent += (rhs) => + { + this.xhsProjectSimulationFunctionMgrCtrl1.UpdateWorking(rhs); + }; + page.RemoveWorkingEvent += (rhs) => + { + this.xhsProjectSimulationFunctionMgrCtrl1.RemoveWorking(rhs); + }; page.PageTitle.HeaderSvgImage = svgImage; page.SetBindingData(project, projectSite, hydroInfo, working); CreatePage(page, guid); @@ -156,44 +169,69 @@ ctrl.UpdateWorkingCheckedList(working, hasChecked); } - - - //鍒涘缓椤圭洰鏂规浜嬩欢 - private void XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSchemeEvent(DevExpress.Utils.Svg.SvgImage svgImage) + //椤圭洰绔欐柟妗堝垱寤轰簨浠� + private void XhsProjectSimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo, SvgImage svgImage) { - //if (_projectSite == null) - //{ - // return; - //} - //var dlg = new AddXhsProjectSimulationSchemeDlg(); - //await dlg.SetBindingData(_projectSite.ID); - //dlg.ReloadDataEvent += (scheme) => - //{ - // this.xhsProjectSimulationFunctionMgrCtrl1.AppendScheme(scheme); - //}; - //dlg.ShowDialog(); - + WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇妯″瀷锛岃绋嶄警..."); var dlg = new AddXhsSchemeDlg(); - // await dlg.SetBindingData(_project, _projectSite, _hydroInfo); + dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); }; + dlg.ReloadDataEvent += (rhs) => + { + this.xhsProjectSimulationFunctionMgrCtrl1.AppendScheme(rhs); + }; + dlg.SetBindingData(project, projectSite, hydroInfo); dlg.ShowDialog(); } - //鏄剧ず椤圭洰鏂规浜嬩欢 - private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSchemeEvent(XhsSchemeVmo arg1, DevExpress.Utils.Svg.SvgImage arg2) + //鏄剧ず椤圭洰绔欐柟妗堜簨浠� + private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeEvent + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, bool> dict, SvgImage svgImage) { - + lock (_locker) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Scheme, + TagName = scheme.ID.ToString() + }; + if (!IsExistPage(guid, true)) + { + var page = new XhsProjectSimulationSchemePage(); + page.PageTitle.HeaderSvgImage = svgImage; + page.AppendWorkingEvent += (working) => + { + this.xhsProjectSimulationFunctionMgrCtrl1.AppendSchemeWorking(scheme, working); + }; + page.SetBindingData(project, projectSite, scheme, hydroInfo, dict); + CreatePage(page, guid); + } + } } - //姣旇緝椤圭洰宸ュ喌浜嬩欢 - private void XhsProjectSimulationFunctionMgrCtrl1_CompareProjectWorkingEvent(DevExpress.Utils.Svg.SvgImage obj) + //鏄剧ず椤圭洰绔欐柟妗堝伐鍐典簨浠� + private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectSiteSchemeWorkingEvent + (XhsProjectVmo project, XhsProjectSiteVmo projectSite, XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo, HydroWorkingVmo working, SvgImage svgImage) { - - } - - //鏄剧ず椤圭洰宸ュ喌浜嬩欢 - private void XhsProjectSimulationFunctionMgrCtrl1_ShowProjectWorkingEvent(HydroWorkingVmo arg1, DevExpress.Utils.Svg.SvgImage arg2) - { - + lock (_locker) + { + var guid = new PageGuid() + { + Modular = this.PageGuid.Modular, + MoudingType = eMoudingType.Tab, + Function = SimulationFunctionHelper.Working, + TagName = working.ID.ToString() + }; + if (!IsExistPage(guid, true)) + { + var page = new XhsProjectSimulationWorkingPage(); + page.PageTitle.HeaderSvgImage = svgImage; + page.SetBindingData(project, projectSite, scheme, hydroInfo, working); + CreatePage(page, guid); + } + } } #endregion @@ -430,7 +468,6 @@ docPnl.Show(); } break; - case eMoudingType.Tab: { this.tabbedView1.BeginUpdate(); @@ -449,7 +486,6 @@ this.tabbedView1.Controller.Activate(doc); } break; - default: break; } page.InitialDataSource(); -- Gitblit v1.9.3