Commit 85ecf9c9 authored by 潘栩锋's avatar 潘栩锋 🚴

PlcErrNos 全部PLC类型的出错都修改为单一模式

parent 7e126e15
......@@ -112,11 +112,13 @@ namespace FLY.OBJComponents.Common
public string Descrption;
}
public static class PlcErrNos
public class PlcErrNos
{
public static PlcErrNos Instance { get; } = new PlcErrNos();
/// <summary>
/// PLC连接断开
/// </summary>
public static ERRNO ERRNO_PLC_DISCONNECTED = new ERRNO() { Code = 65535, Descrption = "PLC连接断开" };
public ERRNO ERRNO_PLC_DISCONNECTED = new ERRNO() { Code = 65535, Descrption = "PLC连接断开" };
}
}
......@@ -107,7 +107,7 @@ namespace FLY.OBJComponents.Server
bool b = !PLCos.PLCs[i].Client.IsConnected;
ERR_STATE state = b ? ERR_STATE.ON : ERR_STATE.OFF;
ERRNO errno = PlcErrNos.ERRNO_PLC_DISCONNECTED;
ERRNO errno = PlcErrNos.Instance.ERRNO_PLC_DISCONNECTED;
UInt16 errcode = (UInt16)(errno.Code - i);
string description;
if (PLCos.PLCs.Count() > 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment