修改读取逻辑

This commit is contained in:
gongxh
2022-05-06 15:23:30 +08:00
parent 0e459f231a
commit 64238fee13
8 changed files with 199 additions and 121 deletions

View File

@@ -78,9 +78,9 @@ namespace CleanMachineHMI.FrmUserControl
{
try
{
if (Global.PlcItemMd_X_List != null && Global.PlcItemMd_X_List.Count > 0)
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{
List<PlcItem> tempLst = Global.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
BeginInvoke(new Action(() =>
@@ -95,9 +95,9 @@ namespace CleanMachineHMI.FrmUserControl
}
}
if (Global.PlcItemMd_Y_List != null && Global.PlcItemMd_Y_List.Count > 0)
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{
List<PlcItem> tempLst = Global.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
BeginInvoke(new Action(() =>

View File

@@ -149,11 +149,11 @@ namespace CleanMachineHMI.FrmUserControl
List<PlcItem> tmpMdList;
if (!string.IsNullOrEmpty(ktb_plcMsg.Text.Trim()))
{
tmpMdList = Global.PlcItemMdList.FindAll(x => x.PlcItemCode.Contains(ktb_plcMsg.Text.Trim()) || x.PlcItemName.Contains(ktb_plcMsg.Text.Trim()));
tmpMdList = PlcOperationHelper.Instance. PlcItemMdList.FindAll(x => x.PlcItemCode.Contains(ktb_plcMsg.Text.Trim()) || x.PlcItemName.Contains(ktb_plcMsg.Text.Trim()));
}
else
{
tmpMdList = Global.PlcItemMdList;
tmpMdList = PlcOperationHelper.Instance.PlcItemMdList;
}
if (tmpMdList != null && tmpMdList.Count > 0)
{