1 |
/* |
2 |
* AbsTimeCut.cpp |
3 |
* |
4 |
* Created on: 22-mag-2009 |
5 |
* Author: Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file AbsTimeCut.h 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 |
cout << date << " " << time << endl; |
21 |
|
22 |
if (date < _initDate) |
23 |
return ABSTIMECUT_TOOEARLY; |
24 |
if (date == _initDate && time < _initTime) |
25 |
return ABSTIMECUT_TOOEARLY; |
26 |
|
27 |
if (date > _endDate) |
28 |
return ABSTIMECUT_TOOLATE; |
29 |
if (date == _endDate && time > _endTime) |
30 |
return ABSTIMECUT_TOOLATE; |
31 |
|
32 |
return CUTOK; |
33 |
} |