1 |
/* |
2 |
* AbsTimeCut.cpp |
3 |
* |
4 |
* Created on: 22-mag-2009 |
5 |
* Author: Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file AbsTimeCut.cpp The AbsTimeCut class implementation file */ |
9 |
|
10 |
#include "AbsTimeCut.h" |
11 |
|
12 |
int AbsTimeCut::Check(PamLevel2 *event) { |
13 |
|
14 |
_time.Set(event->GetOrbitalInfo()->absTime, kFALSE, 0, kFALSE); |
15 |
// TTimestamp::GetDate() returns date in format YYYYMMDD so to compare it |
16 |
// with 6-digits dates we must subtract 20000000 |
17 |
unsigned int date = _time.GetDate(kFALSE) - 20000000; |
18 |
unsigned int time = _time.GetTime(kFALSE); |
19 |
|
20 |
if (date < _initDate) |
21 |
return ABSTIMECUT_TOOEARLY; |
22 |
if (date == _initDate && time < _initTime) |
23 |
return ABSTIMECUT_TOOEARLY; |
24 |
|
25 |
if (date > _endDate) |
26 |
return ABSTIMECUT_TOOLATE; |
27 |
if (date == _endDate && time > _endTime) |
28 |
return ABSTIMECUT_TOOLATE; |
29 |
|
30 |
return CUTOK; |
31 |
} |