예제 #1
0
파일: GeneralRule.cs 프로젝트: marlonnn/VPI
 /// <summary>
 /// 过滤VPS板卡消息,当错误码大于零是报错
 /// </summary>
 /// <param name="cr"></param>
 public void ProcessFilter(VPSErrorInfoResponse cr)
 {
     if (cr.ErrorCode > 0)
     {
         FiltedVPSErrorInfoResponse fr = FiltedVPSErrorInfoResponse.CreateNew(cr);
         rxMsgQueue.Push(fr);
     }
 }
예제 #2
0
 /// <summary>
 /// [EquipId(BOARD)(5)+errorCode(1)]
 /// </summary>
 /// <param name="bp"></param>
 /// <param name="obytes"></param>
 /// <returns></returns>
 public override List<BaseResponse> Decode(BasePackage bp, OriginalBytes obytes)
 {
     Cabinet cabinet = SpringHelper.GetObject<Cabinet>("cabinet");
     if (bp.AppData.Length >= 6)
     {
         VPSErrorInfoResponse tr = new VPSErrorInfoResponse();
         tr.CommunicatinBoard = cabinet.GetCommunicationBoard(bp.RemoteIpEndPoint);
         tr.DtTime = DateTime.Now;
         tr.OriginalBytes = obytes;
         byte[] eqid = new byte[] { bp.AppData[0], bp.AppData[1], bp.AppData[2], bp.AppData[3], bp.AppData[4] };
         tr.ErrorBoard = cabinet.FindEq(eqid) as Board;
         tr.ErrorCode = bp.AppData[5];
         return CreateOneList(tr);
     }
     return null;
 }
예제 #3
0
 public static FiltedVPSErrorInfoResponse CreateNew(VPSErrorInfoResponse vpsRes)
 {
     FiltedVPSErrorInfoResponse fr = new FiltedVPSErrorInfoResponse();
     fr.CommunicatinBoard = vpsRes.CommunicatinBoard;
     fr.DtTime = vpsRes.DtTime;
     fr.ErrorBoard = vpsRes.ErrorBoard;
     fr.ErrorCode = vpsRes.ErrorCode;
     fr.OriginalBytes = vpsRes.OriginalBytes;
     return fr;
 }