From 56aa41202f1c2ed52c918e93fc0855fc3af07859 Mon Sep 17 00:00:00 2001 From: auvkk Date: Fri, 17 Nov 2023 14:11:32 +0800 Subject: [PATCH] =?UTF-8?q?[UI.Client]=20=E4=BF=AE=E6=AD=A3Recipe=E8=A7=A3?= =?UTF-8?q?=E6=9E=90C3H8=E5=92=8CC2H4=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E7=8E=B0=E5=9C=A8=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=88=B0C2H4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecipeEditorLib/RecipeModel/RecipeData.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs b/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs index 48302d5..415aa1a 100644 --- a/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs +++ b/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/RecipeData.cs @@ -826,10 +826,26 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel } else { - if (stepNode.Attributes[col.ControlName] != null && - stepNode.SelectSingleNode(col.ModuleName) != null && - stepNode.SelectSingleNode(col.ModuleName).Attributes[col.ControlName] != null) - value = stepNode.SelectSingleNode(col.ModuleName).Attributes[col.ControlName].Value; + // 因为6号机使用C3H8,但升级到8号机程序后,RecipeFormat.xml使用C2H4,导致8号机用C2H4.SetValue在6号机Recipe中的C3H8.SetValue项时找不到, + // 以下代码交换尝试C2H4和C3H8名称搜索Recipe中的项目,解决兼容性问题。 + // TODO C2H4或者C3H8在系统内部应该统一使用CxHy,RT中不再区分具体名称 + if (col.ControlName.Contains("C2H4") && stepNode.Attributes[col.ControlName.Replace("C2H4", "C3H8")].Value != null) + { + var tmpControlName = col.ControlName.Replace("C2H4", "C3H8"); + value = stepNode.Attributes[tmpControlName].Value; + } + else if (col.ControlName.Contains("C3H8") && stepNode.Attributes[col.ControlName.Replace("C3H8", "C2H4")].Value != null) + { + var tmpControlName = col.ControlName.Replace("C3H8", "C2H4"); + value = stepNode.Attributes[tmpControlName].Value; + } + else + { + if (stepNode.Attributes[col.ControlName] != null && + stepNode.SelectSingleNode(col.ModuleName) != null && + stepNode.SelectSingleNode(col.ModuleName).Attributes[col.ControlName] != null) + value = stepNode.SelectSingleNode(col.ModuleName).Attributes[col.ControlName].Value; + } } }