Ejemplo n.º 1
0
 /// <summary>
 /// 是否超速报警,并取得报警附加信息
 /// </summary>
 /// <param name="AlarmStatus"></param>
 /// <param name="AdditionMsg"></param>
 /// <param name="type"></param>
 /// <param name="AddItem"></param>
 /// <returns></returns>
 public static bool GetAlarmMsg(UInt32 AlarmStatus, string AdditionMsg, AlarmType type, ref SpeedingAlarmAdditionItem AddItem)
 {
     bool bIsAlarm = IsAlarm(AlarmStatus, type);
     switch (type)
     {
         case AlarmType.SpeedingAlarm:
             List<AdditionMsgItem> addList = new List<AdditionMsgItem>();
             byte[] AdditionMsgByte = Encoding.ASCII.GetBytes(AdditionMsg);
             LocationReport LR = new LocationReport();
             LR.ParseAdditionMsg(AdditionMsgByte, 0, AdditionMsgByte.Length, ref addList);
             if (addList.Exists(o => o.MsgID == AdditionMsgIDType.SpeedingAlarmAddition))
             {
                 AdditionMsgItem item = addList.Find(o => o.MsgID == AdditionMsgIDType.SpeedingAlarmAddition);
                 item.ParseItem(ref AddItem);
             }
             break;
         default:
             break;
     }
     return bIsAlarm;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 解析位置附加信息项
 /// </summary>
 public void ParseItem(ref SpeedingAlarmAdditionItem SAItem)
 {
     //位置类型
     SAItem.LocationType = MsgValue[0];
     if (SAItem.LocationType != 0)
     {
         //区域或路段ID
         SAItem.AreaOrLineSectionIDByte = new byte[4];
         Array.Copy(MsgValue, 1, SAItem.AreaOrLineSectionIDByte, 0, 4);
         SAItem.AreaOrLineSectionID = BitConverter.ToUInt32(BuBiaoData.LocalByteToNetByteOrder(SAItem.AreaOrLineSectionIDByte), 0);
     }
 }