From b5234c5ab1e9e6826b8d8fc1e95fa752aaa40b74 Mon Sep 17 00:00:00 2001 From: chr <chr@mailcom> Date: 星期六, 02 十一月 2024 10:56:50 +0800 Subject: [PATCH] 优化程序 --- PdmSwPlugin.Common/BomIniter/YwtBomIniter.cs | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PdmSwPlugin.Common/BomIniter/YwtBomIniter.cs b/PdmSwPlugin.Common/BomIniter/YwtBomIniter.cs index 5aae542..6b105f0 100644 --- a/PdmSwPlugin.Common/BomIniter/YwtBomIniter.cs +++ b/PdmSwPlugin.Common/BomIniter/YwtBomIniter.cs @@ -10,8 +10,6 @@ public class YwtBomIniter : BomIniter { public static PluginSetting setting = PluginSetting.Instance; - public string jgjNameRegx { get; private set; } = CustomerSetting.Instance["jgjNameRegx"]; - public string standardNameRegx { get; private set; } = CustomerSetting.Instance["standardNameRegx"]; public void InitBom(PdmBom bom) { @@ -27,16 +25,20 @@ bom.xc = false; bom.mn = false; + string jgjNameRegx = CustomerSetting.Instance["jgjNameRegx"]; + string standardNameRegx = CustomerSetting.Instance["standardNameRegx"]; + if (Regex.IsMatch(childName, jgjNameRegx)) { - if (bom._drawInfo != null) { + if (bom._drawInfo != null) + { bom._drawInfo.HistoryData = NameUtil.IsHistoryDoc(childName); } string docType = bom.properties.Get("鏂囦欢鏍煎紡"); if (string.IsNullOrEmpty(docType)) { - bom.produceWay = "鏍囧噯浠�"; + bom.produceWay = "鍔犲伐浠�"; } else { @@ -72,12 +74,14 @@ /// <returns></returns> public bool IsJgjPanel(ModelDoc2 doc) { + string jgjNameRegx = CustomerSetting.Instance["jgjNameRegx"]; string fileName = Path.GetFileNameWithoutExtension(doc.GetPathName()); return Regex.IsMatch(fileName, jgjNameRegx); } public bool IsJgj(ModelDoc2 doc) { + string jgjNameRegx = CustomerSetting.Instance["jgjNameRegx"]; string fileName = Path.GetFileNameWithoutExtension(doc.GetPathName()); return Regex.IsMatch(fileName, jgjNameRegx); } @@ -85,6 +89,8 @@ public bool IsStandard(ModelDoc2 doc) { string fileName = doc.GetPathName(); + string standardNameRegx = CustomerSetting.Instance["standardNameRegx"]; + fileName = Path.GetFileNameWithoutExtension(fileName); return Regex.IsMatch(fileName, standardNameRegx); } -- Gitblit v1.9.1