This commit is contained in:
gongxh
2022-05-18 10:15:49 +08:00
parent 099335e6b3
commit 7240b17c1e
10 changed files with 72 additions and 58 deletions

View File

@@ -131,7 +131,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
@@ -147,7 +147,7 @@ namespace CleanMachineHMI.FrmUserControl
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
@@ -162,9 +162,9 @@ namespace CleanMachineHMI.FrmUserControl
}
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List.Values);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List.Values);
}
catch (Exception ex)
{

View File

@@ -127,7 +127,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
var IO = new IOBlock();
@@ -147,7 +147,7 @@ namespace CleanMachineHMI.FrmUserControl
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
var IO = new IOBlock();
@@ -168,9 +168,9 @@ namespace CleanMachineHMI.FrmUserControl
}
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List.Values);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List.Values);
}
catch (Exception ex)
{

View File

@@ -71,6 +71,8 @@ namespace CleanMachineHMI.FrmUserControl
private void btn_logout_Click(object sender, EventArgs e)
{
Global.LoginForm.Show();
Global.UserInfo = null;
Global.SysThIsRunFlag = false;
Global.MainFormNew.Hide();
}
}

View File

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