From f45bba0b5ecf73df67af6cb60e57ea956d82a8ab Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 30 七月 2024 14:36:10 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/02-bimface/ViewXhsProjectBimfacePage.cs | 37 ++++++++++++++++++++++++++++++------- 1 files changed, 30 insertions(+), 7 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/02-bimface/ViewXhsProjectBimfacePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/02-bimface/ViewXhsProjectBimfacePage.cs index 6353c7a..e5f75d1 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/02-bimface/ViewXhsProjectBimfacePage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/02-bimface/ViewXhsProjectBimfacePage.cs @@ -5,21 +5,36 @@ public ViewXhsProjectBimfacePage() { InitializeComponent(); + this.PageTitle.Caption = "妯″瀷瑙嗗浘"; + this.PageTitle.HeaderSvgImage = this.svgImg32[0]; + this.PageTitle.SvgImageSize = new Size(24, 24); } - private HStation.Dto.XhsProjectStdDto _project = null; + private XhsProjectStdDto _project = null; /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - /// <param name="project"></param> + /// <param name="projectId">椤圭洰id</param> + public async Task SetBindingData(long projectId) + { + _project = await new BLL.XhsProjectStd().GetByID(projectId); + this.PageTitle.Caption = $"{_project?.Name}\n妯″瀷瑙嗗浘"; + } + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="project">椤圭洰</param> public void SetBindingData(HStation.Dto.XhsProjectStdDto project) { _project = project; - this.PageTitle.Caption = $"{project.Name}-妯″瀷瑙嗗浘"; - + this.PageTitle.Caption = $"{_project?.Name}\n妯″瀷瑙嗗浘"; } + /// <summary> + /// 鍒濆鍖栨暟鎹簮 + /// </summary> public override async void InitialDataSource() { base.InitialDataSource(); @@ -27,20 +42,24 @@ await this.bimfaceInterop3dContainer1.InitialContainer(); } + /// <summary> + /// 椤甸潰鍔犺浇瀹屾垚鍚庤Е鍙� + /// </summary> private async void BimfaceInterop3dContainer1_LoadCompletedEvent() { if (_project == null) { return; } - var allProjectSiteList = await new HStation.BLL.XhsProjectSiteStd().GetByProjectID(_project.ID); - var projectSite = allProjectSiteList?.FirstOrDefault(); + + var projectSite = await new BLL.XhsProjectSiteStd().GetDefaultByProjectID(_project.ID); if (projectSite == null) { return; } - var relation = await new Yw.BLL.BimfaceFileRelationStd().GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, projectSite.ID, Yw.Bimface.Purpose.Simulation); + var relation = await new Yw.BLL.BimfaceFileRelationStd() + .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, projectSite.ID, Yw.Bimface.Purpose.Simulation); if (relation == null) { return; @@ -53,6 +72,10 @@ } var viewToken = await BimfaceHelper.GetViewToken(bimfaceFile.BimfaceId); + if (string.IsNullOrEmpty(viewToken)) + { + return; + } await this.bimfaceInterop3dContainer1.LoadView(viewToken); } -- Gitblit v1.9.3