1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* PktQualCut.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 10-mar-2009 |
5 |
|
|
* Author: Sergio Riciarini, Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file PktQualCut.cpp The PktQualCut class implementation file */ |
9 |
|
|
|
10 |
|
|
#include "PktQualCut.h" |
11 |
|
|
|
12 |
|
|
int PktQualCut::Check(PamLevel2 *event) { |
13 |
|
|
|
14 |
|
|
// Check run |
15 |
|
|
if (event->GetRunInfo()->ID != _previousRun){ |
16 |
|
|
_previousRun = event->GetRunInfo()->ID; |
17 |
|
|
_previousPkt = event->GetOrbitalInfo()->pkt_num; |
18 |
|
|
// return PKT_NEWRUN; |
19 |
|
|
return CUTOK; |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
// Check packet number |
23 |
|
|
if (event->GetOrbitalInfo()->pkt_num <= _previousPkt){ |
24 |
|
|
return PKT_INVALID; |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
// The packet number is good |
28 |
|
|
_previousPkt = event->GetOrbitalInfo()->pkt_num; |
29 |
|
|
return CUTOK; |
30 |
|
|
|
31 |
|
|
} |