修改
This commit is contained in:
@@ -27,7 +27,9 @@ namespace CleanMachineHMI
|
|||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
//frmUtil.DB2Json();//语言字典从数据库转json
|
//frmUtil.DB2Json();//语言字典从数据库转json
|
||||||
GlobalHelper.LoadTheme();
|
GlobalHelper.LoadTheme();
|
||||||
|
#if DEBUG
|
||||||
GlobalHelper.LoadzhCN();
|
GlobalHelper.LoadzhCN();
|
||||||
|
#endif
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
GlobalHelper.LoadAllFormData();
|
GlobalHelper.LoadAllFormData();
|
||||||
Application.Run(GlobalHelper.LoginForm);
|
Application.Run(GlobalHelper.LoginForm);
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
//使用本地调式
|
//使用本地调式
|
||||||
#define USE_LOCAL_TCP_DEBUG
|
|
||||||
//启用心跳检查
|
|
||||||
// #define UseHeartbeat
|
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
|
||||||
|
#define USE_LOCAL_TCP_DEBUG
|
||||||
|
#endif
|
||||||
|
//启用心跳检查
|
||||||
|
|
||||||
|
#if RELEASE
|
||||||
|
#define UseHeartbeat
|
||||||
|
#endif
|
||||||
using CleanMachine.Model;
|
using CleanMachine.Model;
|
||||||
using LeadDataBaseUtility;
|
using LeadDataBaseUtility;
|
||||||
|
|
||||||
@@ -84,7 +90,7 @@ namespace CleanMachineHMI
|
|||||||
public bool PlcInit()
|
public bool PlcInit()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -122,7 +128,7 @@ namespace CleanMachineHMI
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -147,7 +153,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
public void RefreshPlcItem_M()
|
public void RefreshPlcItem_M()
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -184,7 +190,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -194,7 +200,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
public void RefreshPlcItem_D()
|
public void RefreshPlcItem_D()
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -249,7 +255,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
HandleWaringLog(tmpReadAlarmBytArr_D);
|
HandleWaringLog(tmpReadAlarmBytArr_D);
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -261,7 +267,7 @@ namespace CleanMachineHMI
|
|||||||
//报警信息记录
|
//报警信息记录
|
||||||
private void HandleWaringLog(ushort[] tmpReadAlarmBytArr_D)
|
private void HandleWaringLog(ushort[] tmpReadAlarmBytArr_D)
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -587,7 +593,7 @@ namespace CleanMachineHMI
|
|||||||
//frmMainNew.Show_ptb_Alarm(false);
|
//frmMainNew.Show_ptb_Alarm(false);
|
||||||
GlobalHelper.ShowMainFrmAlarmMsg(false, EventArgs.Empty);
|
GlobalHelper.ShowMainFrmAlarmMsg(false, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -598,7 +604,7 @@ namespace CleanMachineHMI
|
|||||||
|
|
||||||
public void RefreshPlcItem_X()
|
public void RefreshPlcItem_X()
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -626,7 +632,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -637,7 +643,7 @@ namespace CleanMachineHMI
|
|||||||
|
|
||||||
public void RefreshPlcItem_Y()
|
public void RefreshPlcItem_Y()
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -665,7 +671,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -677,7 +683,7 @@ namespace CleanMachineHMI
|
|||||||
|
|
||||||
public object ReadPlcItem(string plcItemCode, PlcItemTypeDesc itemType)
|
public object ReadPlcItem(string plcItemCode, PlcItemTypeDesc itemType)
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -750,7 +756,7 @@ namespace CleanMachineHMI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return retObj;
|
return retObj;
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -763,7 +769,7 @@ namespace CleanMachineHMI
|
|||||||
|
|
||||||
public bool WritePlcItem(string plcItemCode, string writeValue, PlcItemTypeDesc itemType)
|
public bool WritePlcItem(string plcItemCode, string writeValue, PlcItemTypeDesc itemType)
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -798,7 +804,7 @@ namespace CleanMachineHMI
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -809,13 +815,13 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
private int wcsToPlcHeartDataNew = 0;
|
private int wcsToPlcHeartDataNew = 0;
|
||||||
private DateTime HeartbeatTime = new DateTime();
|
private DateTime HeartbeatTime = new DateTime();
|
||||||
|
private int ReConnNum = 1;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 心跳处理
|
/// 心跳处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void HeartbeatDetection()
|
public void HeartbeatDetection()
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@@ -889,7 +895,7 @@ namespace CleanMachineHMI
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !DEBUG
|
#if RELEASE
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user