修改
This commit is contained in:
@@ -38,15 +38,15 @@ namespace CleanMachineHMI
|
||||
try
|
||||
{
|
||||
Task.Run(async delegate {
|
||||
GlobalHelper.eventLock = true;
|
||||
Global.eventLock = true;
|
||||
await Task.Delay(100);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
GlobalHelper.OnShowX_Y_Status -= Show_X_Y_Status;
|
||||
GlobalHelper.OnShowSensorStatus -= ShowSensorStatus;
|
||||
GlobalHelper.IoMonitor_2.SuspendLayout();
|
||||
GlobalHelper.IoMonitor_2.Hide();
|
||||
GlobalHelper.eventLock = false;
|
||||
Global.OnShowX_Y_Status -= Show_X_Y_Status;
|
||||
Global.OnShowSensorStatus -= ShowSensorStatus;
|
||||
Global.IoMonitor_2.SuspendLayout();
|
||||
Global.IoMonitor_2.Hide();
|
||||
Global.eventLock = false;
|
||||
}));
|
||||
});
|
||||
}
|
||||
@@ -58,8 +58,8 @@ namespace CleanMachineHMI
|
||||
private void frmIoMonitorNew_2_Load(object sender, EventArgs e)
|
||||
{
|
||||
initControl();
|
||||
GlobalHelper.OnShowX_Y_Status += Show_X_Y_Status;
|
||||
GlobalHelper.OnShowSensorStatus += ShowSensorStatus;
|
||||
Global.OnShowX_Y_Status += Show_X_Y_Status;
|
||||
Global.OnShowSensorStatus += ShowSensorStatus;
|
||||
}
|
||||
private void ShowSensorStatus(object sender, EventArgs e)
|
||||
{
|
||||
@@ -166,9 +166,9 @@ namespace CleanMachineHMI
|
||||
{
|
||||
try
|
||||
{
|
||||
if (GlobalHelper.PlcItemMd_X_List != null && GlobalHelper.PlcItemMd_X_List.Count > 0)
|
||||
if (Global.PlcItemMd_X_List != null && Global.PlcItemMd_X_List.Count > 0)
|
||||
{
|
||||
List<PlcItem> tempLst = GlobalHelper.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
||||
List<PlcItem> tempLst = Global.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
||||
foreach (PlcItem item in tempLst)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
@@ -183,9 +183,9 @@ namespace CleanMachineHMI
|
||||
}
|
||||
}
|
||||
|
||||
if (GlobalHelper.PlcItemMd_Y_List != null && GlobalHelper.PlcItemMd_Y_List.Count > 0)
|
||||
if (Global.PlcItemMd_Y_List != null && Global.PlcItemMd_Y_List.Count > 0)
|
||||
{
|
||||
List<PlcItem> tempLst = GlobalHelper.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
||||
List<PlcItem> tempLst = Global.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
||||
foreach (PlcItem item in tempLst)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
@@ -220,7 +220,7 @@ namespace CleanMachineHMI
|
||||
string plcItemNameAddress = pic.Name.Replace("picb_", "");
|
||||
if (plcItemNameAddress.StartsWith("M"))
|
||||
{
|
||||
PlcItem tmpPlc = GlobalHelper.PlcItemMd_M_List.First(x => x.PlcItemPriAddress == plcItemNameAddress.Replace("M", ""));
|
||||
PlcItem tmpPlc = Global.PlcItemMd_M_List.First(x => x.PlcItemPriAddress == plcItemNameAddress.Replace("M", ""));
|
||||
if (tmpPlc != null)
|
||||
{
|
||||
ttp.SetToolTip(pic, tmpPlc.PlcItemName);
|
||||
@@ -228,7 +228,7 @@ namespace CleanMachineHMI
|
||||
}
|
||||
else
|
||||
{
|
||||
PlcItem tmpPlc = GlobalHelper.PlcItemMd_X_List.First(x => x.PlcItemPriAddress == Convert.ToInt32(plcItemNameAddress.Replace("X", ""), 10).ToString());
|
||||
PlcItem tmpPlc = Global.PlcItemMd_X_List.First(x => x.PlcItemPriAddress == Convert.ToInt32(plcItemNameAddress.Replace("X", ""), 10).ToString());
|
||||
if (tmpPlc != null)
|
||||
{
|
||||
ttp.SetToolTip(pic, tmpPlc.PlcItemName);
|
||||
|
||||
Reference in New Issue
Block a user