Ads_bEvent.h
Go to the documentation of this file.
1 #ifndef INC_AIRPLANEEVENT_H_
2 #define INC_AIRPLANEEVENT_H_
3 #include "Macros_Convenience.h"
4 
5 #include "utl/CoordinateSystem.h"
6 #include "utl/Point.h"
7 #include "utl/UTMPoint.h"
8 #include "utl/TimeStamp.h"
9 
10 #include "atm/ProfileResult.h"
11 
12 #include <sstream>
13 #include <vector>
14 
15 namespace RdAirplane {
16 class Flight;
17 class AirplaneOffset;
21 class Ads_bEvent {
22 
23  public:
24  enum AltitudeType {
29  };
31  static const unsigned int ADS_B_DATA_BIT_OFFSET = 8*4;
32  Ads_bEvent(const utl::TimeStamp& pCaptureTime, const utl::UTMPoint& pCoordinates, const std::string& pAds_bMessageAsHex, Flight* pFlight);
33  virtual ~Ads_bEvent();
34 
35  const Flight& getFlight() const {
36  return *_flight_;
37  }
38 
39  const utl::TimeStamp& getCaptureTime() const {
40  return _captureTime_;
41  }
42 
45  }
46 
47  bool operator<(const Ads_bEvent& pOther) const {
48  return getCaptureTime()<pOther.getCaptureTime();
49  }
50 
51  bool HasGPSAltitude() const;
52 
53  bool ShouldBeFilteredOut() const;
54 
55  const utl::UTMPoint& getCoordinates() const;
56 
57  const utl::UTMPoint& getCoordinates(AltitudeType pAltitudeType) const;
58 
59  double getAltitude(AltitudeType pAltitudeType) const;
60 
62  return _altitudeType_;
63  }
64 
65  private:
68 
73  double _gpsAltitude_;
74 
79 
80  std::vector<bool> _ads_bMessageBinary_;
81  int _tc_;
83 
85 
86  bool _decodeAds_bMessage();
87  bool _decodeTC();
88 
89  static double _getAltitudeFromPressure(const atm::ProfileResult& pProfileResult, double pPressure, double pLowerHeight, double pUpperHeight, double pPressureTreshold, unsigned int pRecursionDepth, unsigned int pMaxRecursionDepth);
90  static double _getAltitudeFromPressure(const atm::ProfileResult& pProfileResult, double pPressure);
91  static std::vector<bool> _binaryFromHexString(const std::string& pHexString);
92  static std::vector<bool> _binaryFromHexChar(const char& pHexChar);
93  static int _intFromBoolVector(const std::vector<bool>& pVector);
94 
95 };
96 
98  bool operator() (Ads_bEvent* pLHS, Ads_bEvent* pRHS) {
99  return *pLHS < *pRHS;
100  }
101 };
102 }
103 
104 #endif /* INC_AIRPLANEEVENT_H_ */
const utl::UTMPoint & getUTMCoordinatesFromADS_B() const
Definition: Ads_bEvent.h:43
AltitudeType _altitudeType_
Definition: Ads_bEvent.h:84
static std::vector< bool > _binaryFromHexString(const std::string &pHexString)
Definition: Ads_bEvent.cc:192
std::vector< bool > _ads_bMessageBinary_
Definition: Ads_bEvent.h:80
bool ShouldBeFilteredOut() const
Definition: Ads_bEvent.cc:202
Class to hold and convert a point in geodetic coordinates.
Definition: UTMPoint.h:40
bool HasGPSAltitude() const
Definition: Ads_bEvent.cc:229
static const unsigned int ADS_B_DATA_BIT_OFFSET
Definition: Ads_bEvent.h:31
double _manuallyCorrectedPressureAltitude_
Definition: Ads_bEvent.h:71
static int _intFromBoolVector(const std::vector< bool > &pVector)
Definition: Ads_bEvent.cc:211
bool operator()(Ads_bEvent *pLHS, Ads_bEvent *pRHS)
Definition: Ads_bEvent.h:98
Ads_bEvent(const utl::TimeStamp &pCaptureTime, const utl::UTMPoint &pCoordinates, const std::string &pAds_bMessageAsHex, Flight *pFlight)
Definition: Ads_bEvent.cc:28
utl::UTMPoint * _coordinatesGPSAltitude_
Definition: Ads_bEvent.h:78
utl::UTMPoint * _coordinatesManuallyCorrectedPressureAltitude_
Definition: Ads_bEvent.h:77
utl::UTMPoint * _coordinatesGDASCorrectedPressureAltitude_
Definition: Ads_bEvent.h:76
utl::TimeStamp _captureTime_
Definition: Ads_bEvent.h:67
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
const utl::UTMPoint & getCoordinates() const
Definition: Ads_bEvent.cc:83
double _GDAScorrectedPressureAltitude_
Definition: Ads_bEvent.h:72
AltitudeType getAltitudeType() const
Definition: Ads_bEvent.h:61
DISALLOW_COPY_AND_ASSIGN(Ads_bEvent)
static double _getAltitudeFromPressure(const atm::ProfileResult &pProfileResult, double pPressure, double pLowerHeight, double pUpperHeight, double pPressureTreshold, unsigned int pRecursionDepth, unsigned int pMaxRecursionDepth)
Definition: Ads_bEvent.cc:126
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
const utl::TimeStamp & getCaptureTime() const
Definition: Ads_bEvent.h:39
const Flight & getFlight() const
Definition: Ads_bEvent.h:35
double getAltitude(AltitudeType pAltitudeType) const
Definition: Ads_bEvent.cc:102
static utl::TimeInterval MAX_TIME_SPAN_BETWEEN_ADS_B_EVENT_AND_DETECTOR_TIME
Definition: Ads_bEvent.h:30
static std::vector< bool > _binaryFromHexChar(const char &pHexChar)
Definition: Ads_bEvent.cc:147
utl::UTMPoint * _coordinatesPressureAltitude_
Definition: Ads_bEvent.h:75
bool operator<(const Ads_bEvent &pOther) const
Definition: Ads_bEvent.h:47
utl::UTMPoint _coordinatesFromAds_b_
Definition: Ads_bEvent.h:69

, generated on Tue Sep 26 2023.