Changeset 3640 in Sophya for trunk/AddOn/TAcq/brpaqu.cc
- Timestamp:
- May 27, 2009, 5:15:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brpaqu.cc
r3639 r3640 1 #include <stdio.h>2 #include <stdlib.h>3 #include <string.h>4 1 #include "brpaqu.h" 5 2 … … 439 436 // -------------------------------------------------------------------------- 440 437 441 BRPaqChecker::BRPaqChecker() 442 { 438 BRPaqChecker::BRPaqChecker(bool cktrl, int maxprt) 439 { 440 cktrl_ = cktrl; 443 441 totnframes = 0; 444 442 nframeok = 0; 445 443 lostframes = 0; 446 444 frclst = 0; 445 cnt_saut = 0; 446 maxprt_ = maxprt; 447 447 DefineHDRTag(); 448 448 DefineTRLTag(); … … 466 466 467 467 468 static int cnt_pb = 0;469 468 bool BRPaqChecker::Check(BRPaquet& paq) 470 469 { 471 470 totnframes++; 472 471 if (paq.HDRMarker64() != HDRTag()) return false; 473 if ( paq.TRLMarker64() != TRLTag()) return false;472 if (cktrl_&&(paq.TRLMarker64() != TRLTag())) return false; 474 473 /* DBG 475 474 if (paq.TRLMarker64() != TRLTag()) { … … 486 485 lostframes += (unsigned long long)delfc - 1; 487 486 if (delfc != 1) { 488 cnt_ pb++;489 if (cnt_ pb < 5) {487 cnt_saut++; 488 if (cnt_saut < maxprt_) { 490 489 cout << "BRPaqChecker::Check([NumFrameOK=" << nframeok 491 490 << ")/Debug FrameCounter Cur=" << curfc … … 500 499 } 501 500 502 ostream& BRPaqChecker::Print(ostream& os) 501 ostream& BRPaqChecker::Print(ostream& os) const 503 502 { 504 503 // os << "BRPaqChecker: HDRTag=" << hex << HDRTag() << " TRLTag=" << TRLTag() << dec << "\n" 505 504 // << " ... Tot.Nb.Frames.Proc=" << totnframes << " NbFrame HDR/TRL OK=" << nframeok 506 os << "BRPaqChecker: Tot.Nb.Frames.Proc=" << totnframes << " NbFrame HDR/TRL OK=" << nframeok 507 << " LostFrames=" << lostframes 508 << " Loss=" << (double)lostframes*100./(double)totnframes << " %" << endl; 505 os << "BRPaqChecker: Tot.Nb.Frames.Proc=" << totnframes << " Nb.HDR/TRL OK=" << nframeok; 506 if (cktrl_) os << " (Check Header AND Trailer)" << endl; 507 else os << " (Header Check only)" << endl; 508 float meangap = (cnt_saut>0)?((float)lostframes/(float)cnt_saut):0.; 509 os << " ... LostFrames=" << lostframes 510 << " LossRate=" << (double)lostframes*100./(double)totnframes << " %" 511 << " NbGaps=" << cnt_saut << " MeanGap=" << meangap << endl; 509 512 return os; 510 513 }
Note:
See TracChangeset
for help on using the changeset viewer.