[UI.Client]

修正Recipe解析C3H8和C2H4的兼容性问题,现在统一名称到C2H4.
This commit is contained in:
auvkk 2023-11-17 14:11:32 +08:00
parent ed25f362fe
commit 56aa41202f
1 changed files with 20 additions and 4 deletions

View File

@ -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在系统内部应该统一使用CxHyRT中不再区分具体名称
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;
}
}
}