From 0711485ecb4fe66fbe820478d92eb9f04b77c042 Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期四, 24 十月 2024 13:51:38 +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/01-import/00-core/ImportXhsProjectHelper.cs | 85 ++++++++++++++++++++++-------------------- 1 files changed, 45 insertions(+), 40 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs index 0f9ca13..20d4a85 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs @@ -1,5 +1,6 @@ 锘縰sing Castle.Core.Internal; using DevExpress.XtraEditors; +using HStation.Model; using HStation.Vmo; using static DevExpress.XtraEditors.XtraInputBox; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; @@ -157,59 +158,63 @@ return true; } var structOthersFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructOthersFileName); - - var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, structOthersFileInfo?.FullName, out msg); - if (structRevitModel == null) + var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile + (structFileInfo.FullName, structOthersFileInfo?.FullName, out bool structFileResult, out List<string> structFileMsgList); + //瑙f瀽缁撴灉鍒ゆ柇 + if (!structFileResult) { - feedBackMsg?.Invoke($"{msg}锛侊紒锛�", Color.Red); - feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); - feedBackProgress?.Invoke(100, 100); - return true; + structFileMsgList?.ForEach(x => feedBackMsg?.Invoke(x, Color.Red)); } - - //Revit 灞炴�ч敊璇鐞� - var hasRevitError = false; - var allRevitParterList = structRevitModel.GetAllParters(); - foreach (var revitParter in allRevitParterList) + //Revit灞炴�ч敊璇鐞� + var hasRevitPropError = false; + if (structRevitModel != null) { - if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0) + var allRevitParterList = structRevitModel.GetAllParters(); + foreach (var revitParter in allRevitParterList) { - foreach (var revitParterPropStatus in revitParter.PropStatusList) + if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0) { - if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error) + foreach (var revitParterPropStatus in revitParter.PropStatusList) { - hasRevitError = true; - } - switch (revitParterPropStatus.PropStatus) - { - case Revit.ePropStatus.Error: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red); - } - break; + if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error) + { + hasRevitPropError = true; + } + switch (revitParterPropStatus.PropStatus) + { + case Revit.ePropStatus.Error: + { + feedBackMsg?.Invoke($"鏋勪欢绫诲瀷锛歿revitParter.Catalog}锛屾瀯浠剁紪鐮侊細{revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red); + } + break; - case Revit.ePropStatus.Lack: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岀己鐪侊細{revitParterPropStatus.StatusInfo} ", Color.Gray); - } - break; + case Revit.ePropStatus.Lack: + { + //feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Id}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岀己鐪侊細{revitParterPropStatus.StatusInfo} ", Color.Gray); + } + break; - case Revit.ePropStatus.Abnormal: - { - feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛屽紓甯革細{revitParterPropStatus.StatusInfo} ", Color.Orange); - } - break; + case Revit.ePropStatus.Abnormal: + { + //feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Id}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛屽紓甯革細{revitParterPropStatus.StatusInfo} ", Color.Orange); + } + break; + + default: break; + } } } } } - if (hasRevitError) + if (hasRevitPropError || !structFileResult) { - feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢灞炴�ч敊璇紒锛侊紒", Color.Red); + feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢瑙f瀽閿欒锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; } + + vm.RevitModel = structRevitModel; var hydroInfo = HStation.Hydro.TransferHelper.FromRevit(structRevitModel, out msg); if (hydroInfo == null) @@ -231,12 +236,12 @@ feedBackMsg?.Invoke("姝e湪杩涜浜у搧鍖归厤...", Color.Black); hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroId); - var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo); + var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo, null); if (AssetsMatchingHelper.Matching(matchingParas, out string error)) { if (AssetsMatchingParasHelper.Apply(hydroInfo, matchingParas)) { - feedBackMsg?.Invoke("浜у搧鍖归厤鎴愬姛銆傘�傘��", Color.Green); + feedBackMsg?.Invoke("浜у搧鍖归厤瀹屾垚銆傘�傘��", Color.Green); } else { @@ -306,8 +311,8 @@ return true; } - // var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//涓婁紶 - var bimfaceId = 10000878572231; //娴嬭瘯鐢ㄤ緥 + //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//涓婁紶 + var bimfaceId = 10000884702464; //娴嬭瘯鐢ㄤ緥 10000878572231 10000882826621 10000884283372 10000884362886 10000884702464 if (bimfaceId < 1) { feedBackMsg?.Invoke("Revit妯″瀷鏂囦欢涓婁紶澶辫触锛侊紒锛�", Color.Red); -- Gitblit v1.9.3