VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
adsbTrack.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 
12 
13 #include <vlutil/vlTime.h>
14 #include "list"
15 #include <map>
16 #include "vrfutil/vrfutilDefines.h"
17 #include <string>
18 #include "fixedPointAngle.h"
19 
20 namespace DtAdsb
21 {
22  class DtPathPoint;
23 }
24 
25 namespace DtBufferSerialize
26 {
27  DT_DLL_vrfutil const int getSize(const DtAdsb::DtPathPoint& val);
28  DT_DLL_vrfutil char* encode(const DtAdsb::DtPathPoint& val, char* buffer);
29  DT_DLL_vrfutil const char* decode(DtAdsb::DtPathPoint& val, const char* buffer);
30 }
31 
32 namespace DtAdsb
33 {
37  {
38  public:
39  DtPathPoint();
40  ~DtPathPoint();
41 
48  float mySpeed;
50  float myHeading;
51 
52 
55  std::string myCallSign;
56  std::string myFlightNumber;
59 
61  bool hasSpeed() const { return getBit(0); }
62  void setHasSpeed(bool v) { setBit(0, v); }
63 
64  bool hasVerticalSpeed() const { return getBit(1); }
65  void setHasVerticalSpeed(bool v) { setBit(1, v); }
66 
67  bool hasHeading() const { return getBit(2); }
68  void setHasHeading(bool v) { setBit(2, v); }
69 
70  bool hasAltitude() const { return getBit(3); }
71  void setHasAltitude(bool v) { setBit(3, v); }
72 
73  bool isOnGround() const { return getBit(4); }
74  void setIsOnGround(bool v) { setBit(4, v); }
75 
76  protected:
77  void setBit(int position, bool value);
78  bool getBit(int position) const;
79 
82  DtU8 myBitfield;
83 
84  friend const int DtBufferSerialize::getSize(const DtAdsb::DtPathPoint& point);
85  friend char* DtBufferSerialize::encode(const DtAdsb::DtPathPoint& val, char* buffer);
86  friend const char* DtBufferSerialize::decode(DtAdsb::DtPathPoint& val, const char* buffer);
87  };
88 }
89 
91 typedef std::map<double, DtAdsb::DtPathPoint> DtAdsbPathPointMap;
92 
98 {
99 public:
100  DtAdsbTrack();
101  ~DtAdsbTrack();
102 
110  //wc virtual bool computePathBoundingBox(bool debug = false);
111 
113 
116  virtual int netRepSize() const;
117 
120  virtual bool setFromNet(const char* contentBuffer,
121  unsigned contentSize = 0);
122 
126  virtual bool setToNet(char* contentBuffer);
127 
129  void setIcaoAddress(const int icaoAddr);
130  int icaoAddress() const;
131 
133  void setAircraftType(const std::string);
134  std::string aircraftType() const;
135 
136  void setTailNumber(const std::string);
137  std::string tailNumber() const;
138 
140  void setMaxSpeedFlown(const double s);
141  double maxSpeedFlown() const;
143  void checkAndSetMaxSpeed(const double s);
144 
146  void setMaxAltitudeFlown(const double a);
147  double maxAltitudeFlown()const;
149  void checkAndSetMaxAltitude(const double a);
150 
152  void setMaxFlightDistance(const double d);
153  double maxFlightDistance() const;
155  void checkAndsetMaxFlightDistance(const double d);
156 
157 
160  DtAdsbPathPointMap::iterator addPathPoint(const DtAdsb::DtPathPoint& point);
161 
163  const DtAdsbPathPointMap& path() const;
164  DtAdsbPathPointMap& path();
165 
167  void setSquawkChangedTimestamp(const double t);
168  double squawkChangedTimestamp() const;
169 
171  bool isSquawkChanged(const double t) const;
172 
173 protected:
182 
185 
187  std::string myAircraftType;
188  std::string myTailNumber;
189 
192 
193 #if 0
194 
198  float myMaxNorth;
199  float myMaxSouth;
200  float myMaxEast;
201  float myMaxWest;
202  bool myCrosses180Line;
203  DtTime myStartTime;
204  DtTime myEndTime;
206 #endif
207 };
208 
double mySquawkChangedTimestamp
The timestamp when mySquawkCode changes in a future path point.
Definition: adsbTrack.h:191
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
DtFixedPointAngle32 myLongitude
radians
Definition: adsbTrack.h:46
DtTime myTimeStamp
Definition: adsbTrack.h:42
float myAltitudeBarometric
radians
Definition: adsbTrack.h:47
void setHasVerticalSpeed(bool v)
Definition: adsbTrack.h:65
DtAdsbPathPointMap myPath
The key is the timestamp.
Definition: adsbTrack.h:184
DtInt16 mySquawkCode
This IFF code could change during a flight.
Definition: adsbTrack.h:58
double myMaxSpeedFlown
The maximum speed this aircraft flew in the processed data.
Definition: adsbTrack.h:177
std::string myCallSign
radians, 0 - 2pi. Ignore if &lt; 0.
Definition: adsbTrack.h:55
void setHasSpeed(bool v)
Definition: adsbTrack.h:62
float myHeading
mps
Definition: adsbTrack.h:50
int myIcaoAddress
Integer representation of 6-hex-digit value in file.
Definition: adsbTrack.h:175
bool hasVerticalSpeed() const
Definition: adsbTrack.h:64
Class definition for one dynamic point of a track.
Definition: adsbTrack.h:36
float mySpeed
meters
Definition: adsbTrack.h:48
DtFixedPointAngle32 myLatitude
The representation of lat-lon in the ADSB data is 10e-4 minutes, or about 27-28 bits. Float is too low precision for this data.
Definition: adsbTrack.h:45
std::string myTailNumber
Definition: adsbTrack.h:188
std::string myAircraftType
ICAO type.
Definition: adsbTrack.h:187
bool hasHeading() const
Definition: adsbTrack.h:67
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
short DtInt16
Definition: vrvControlStructTypes.h:29
void setIsOnGround(bool v)
Definition: adsbTrack.h:74
void setHasHeading(bool v)
Definition: adsbTrack.h:68
bool hasAltitude() const
Definition: adsbTrack.h:70
void setHasAltitude(bool v)
Definition: adsbTrack.h:71
bool hasSpeed() const
Indicator for whether the above data has been specified in the data.
Definition: adsbTrack.h:61
double myMaxAltitudeFlown
The maximum altitude this aircraft flew in the processed data.
Definition: adsbTrack.h:179
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
Class definition for one track created from ADSB messages, i.e. the identifying information and time-...
Definition: adsbTrack.h:97
bool isOnGround() const
Definition: adsbTrack.h:73
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
std::string myFlightNumber
Definition: adsbTrack.h:56
DtU8 myBitfield
Data storage for bits set by above accessors. Use this instead of a series of bools to compact the da...
Definition: adsbTrack.h:82
double myMaxFlightDistance
The maximum distance this aircraft flew in the processed data.
Definition: adsbTrack.h:181
std::map< double, DtAdsb::DtPathPoint > DtAdsbPathPointMap
This will map a time stamp to a point (location)
Definition: adsbTrack.h:91
float myVerticalSpeed
mps
Definition: adsbTrack.h:49

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)