Exemplo n.º 1
0
 public override List<BaseResponse> Decode(BasePackage bp, OriginalBytes obytes)
 {
     Cabinet cabinet = SpringHelper.GetObject<Cabinet>("cabinet");
     if (bp.AppData.Length == 48)//应用数据(48)
     {
         List<BaseResponse> list = new List<BaseResponse>();
         for (byte rackNo = 2; rackNo <= 5; rackNo++)//除系统机笼
         {
             for (byte slotNo = 3; slotNo <= 14; slotNo++)
             {
                 BoardStatusResponse boardStatusResponse = new BoardStatusResponse();
                 boardStatusResponse.CommunicatinBoard = cabinet.GetCommunicationBoard(bp.RemoteIpEndPoint);
                 boardStatusResponse.DtTime = DateTime.Now;
                 boardStatusResponse.OriginalBytes = obytes;
                 byte[] eqid = new byte[] { 0x05, rackNo, slotNo, 0xFF, 0xFF };
                 Board b = cabinet.FindEq(eqid) as Board;
                 if (b != null)
                 {
                     boardStatusResponse.Board = b;
                     boardStatusResponse.ErrorCode = bp.AppData[(rackNo - 2) * 12 + (slotNo - 3)];
                     list.Add(boardStatusResponse);
                 }
             }
         }
         return list;
     }
     return null;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 过滤板卡状态消息
 /// </summary>
 /// <param name="cr"></param>
 public void ProcessFilter(BoardStatusResponse br)
 {
     if (br.ErrorCode != 0x01 && br.ErrorCode != 0x02)
     {
         FiltedBoardStatusResponse fr = FiltedBoardStatusResponse.CreateNew(br);
         rxMsgQueue.Push(fr);
     }
 }
Exemplo n.º 3
0
 public static FiltedBoardStatusResponse CreateNew(BoardStatusResponse br)
 {
     FiltedBoardStatusResponse fr = new FiltedBoardStatusResponse();
     fr.Board = br.Board;
     fr.CommunicatinBoard = br.CommunicatinBoard;
     fr.DtTime = br.DtTime;
     fr.ErrorCode = br.ErrorCode;
     fr.OriginalBytes = br.OriginalBytes;
     return fr;
 }