| | |
| | | internal class MonitorMsgHelper |
| | | { |
| | | /// <summary> |
| | | /// 是否是当前MSG |
| | | /// 是否是当前MSG,表示需要处理 |
| | | /// </summary> |
| | | /// <param name="byteMessage"></param> |
| | | /// <returns></returns> |
| | | public static bool IsCurrentMsg(byte[] byteMessage) |
| | | public static bool IsNeedHandle(byte[] byteMessage) |
| | | { |
| | | if (byteMessage[0] == 0x01 && byteMessage[1] == 0x03 && byteMessage[2] == 0x42) |
| | | { |
| | |
| | | return new byte[] { 0x01, 0x03, 0x00, 0x12, 0x00, 0x04, 0xE4, 0x0C }; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | SysId = 1575030435430404096, |
| | | RecordType = Model.eMonitorType.General, |
| | | SrcTime = now, |
| | | SrcValue = (ByteMsgHelper.GetInt2Byte(byteMessage, 3 + (29 - start) * 2, out msg) * 0.001).ToString() |
| | | SrcValue = ((ByteMsgHelper.GetInt2Byte(byteMessage, 3 + (29 - start) * 2, out msg) * 0.001) * -1).ToString() |
| | | }); |
| | | |
| | | //A相电压 |
| | |
| | | SysId = 1584475756476633088, |
| | | RecordType = Model.eMonitorType.General, |
| | | SrcTime = now, |
| | | SrcValue = Math.Round(ByteMsgHelper.GetDouble1(byteMessage, 3 + (56 - start) * 2, out msg), 2).ToString() |
| | | SrcValue = Math.Round((ByteMsgHelper.GetDouble1(byteMessage, 3 + (56 - start) * 2, out msg) * 0.001), 2).ToString() |
| | | }); |
| | | } |
| | | catch (Exception err) |