15 #include <vlpi/entityType.h>
18 #include <tbb/spin_mutex.h>
19 #include <tbb/spin_rw_mutex.h>
20 #include <tbb/task_arena.h>
28 class DtAdsbDataManagerJob;
30 namespace MAKVRinTerra
32 class DtFeatureGeometry;
54 class DtAdsbManagerTrackHandle;
55 class DtAdsbManagerPointHandle;
62 virtual double simTime();
65 static void tickCallback(
void* usr);
78 bool unownedOnly =
true)
override;
82 double startSimTime,
double endSimTime,
bool unownedOnly)
override;
97 const DtIcaoAddrSet& trackIds,
const double lastSimTime)
override;
154 virtual void loadAdsbData(
const double startSimTime,
const double endSimTime);
159 virtual bool timeToStop();
163 friend class DtAdsbDataManagerJob;
167 virtual void performDataReset();
171 virtual void getDataFileName(
const int dayOfWeek,
const int hourOfDay,
178 virtual void getNextFileDayAndHour(
int& day,
int& hour);
183 virtual void getPreviousFileDayAndHour(
int& day,
int& hour);
186 virtual bool secondTimeGreaterThanFirst(
const int day1,
const int hour1,
187 const int day2,
const int hour2);
209 virtual DtIntervalResult getDayHourForFileContainingTime(
const double simTime,
int& day,
int& hour);
222 virtual bool readInfoFile();
225 virtual void startAdsbDataLoad(
const double startTime,
const double endTime);
229 virtual void calculateTrackTimeOffset();
233 virtual bool readOneDataFile(
const int day,
const int hour);
std::list< DtAdsbDataJob::Ptr > JobQueue
Definition: adsbDataManager.h:258
int myLastDataFileHourOfDay
Definition: adsbDataManager.h:279
tbb::spin_rw_mutex myAdsbDataMutex
Definition: adsbDataManager.h:256
JobQueue myNewDataJobs
These jobs are new, and haven't been checked to see if they can execute immediately or not...
Definition: adsbDataManager.h:261
DtAdsbDataServiceInterface & operator=(const DtAdsbDataServiceInterface &)
Assignment operator not implemented.
virtual void resetData()=0
Marks ADSB data to be reset. This is called in the cgf module when a scenario is rewound, rolled back, or closed. Since as a scenario plays, ADSB data is incrementally deleted from memory, a scenario rewind in general requires that data files be re-read. Therefore this function clears and resets everything in the ADSB data manager so that it reads all files again.
virtual int trackToDebug() const
Definition: adsbDataManager.h:156
tbb::spin_mutex QueryQueueMutex
Definition: adsbDataManager.h:253
DtTime myFirstDataAdsbTime
This is the dateTime at the beginning of the hour of the first ADSB time.
Definition: adsbDataManager.h:292
virtual DtPointHandlePtr firstPointAfterTime(const DtTrackHandlePtr track, double simTime) const =0
Find the first point in the track's path that occurs after (or at) the specified sim time...
Definition: adsbDataManager.h:196
virtual double finalDataSimTime() const =0
Returns the sim time for the last point of ADSB data available.
virtual DtAdsbDataJob::Ptr requestOwnershipOfTracks(const DtIcaoAddrSet &trackIds, const double lastSimTime)=0
Request ownership of the specified given tracks.
The DtAdsbDataManager loads and manages Automatic Dependent Surveillance - Broadcast (ADS-B) data...
Definition: adsbDataManager.h:41
std::map< double, DtAdsb::DtPathPoint >::const_iterator DtPathPointIter
Definition: adsbDataManager.h:35
int myDataFileTimeInterval
Definition: adsbDataManager.h:275
std::unordered_map< DtIcaoAddress, DtAdsbTrack * > DtAdsbTrackMap
Definition: adsbDataManager.h:44
virtual double adsbTimeFromSimTime(double simTime) const =0
Converts a sim time to ADSB data time. Needed to understand how sim time relates to the timestamps in...
DtIntervalResult
Definition: adsbDataManager.h:193
std::atomic< bool > myLoadError
Definition: adsbDataManager.h:307
JobQueue myJobsReadyToExecute
These jobs can be executed without loading more data.
Definition: adsbDataManager.h:265
std::map< int, DtEntityType > DtTrackTypeMap
Definition: adsbDataManager.h:36
virtual DtAdsbDataJob::Ptr findTracksInAreaDuringTime(const DtVertexList &areaVertices, double startSimTime, double endSimTime, bool unownedOnly)=0
Starts a query for all tracks in the specified area. A track must cross the area between the given si...
JobQueue myJobsWaitingForLoad
These jobs are waiting for more data to be loaded.
Definition: adsbDataManager.h:263
Abstract interface class to the ADSB data service. This service provides access to Automatic Dependen...
Definition: adsbDataServiceInterface.h:121
DtIcaoAddrSet myTracksInUse
List of the subset of tracks that are in use.
Definition: adsbDataManager.h:251
virtual DtAdsbDataJob::Ptr releaseOwnershipOfTracks(const DtIcaoAddrSet &trackIds)=0
Release ownership of the specified tracks.
int myFirstDataFileHourOfDay
Definition: adsbDataManager.h:274
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
bool myInfoFileWasRead
Even if the data is reset and reused, the info file doesn't have to be re-read. This flag also indica...
Definition: adsbDataManager.h:283
virtual DtAdsbDataJob::Ptr findTracksInArea(const DtVertexList &areaVertices, bool unownedOnly=true)=0
Starts a query for all tracks in the specified area. The last point in a track before the current sim...
DtTime myFirstDataDayStartTime
Definition: adsbDataManager.h:276
std::atomic< bool > myLoadInProgress
Definition: adsbDataManager.h:306
std::shared_ptr< DtAdsbTrackHandle > DtTrackHandlePtr
Shared_ptr so that copy constructor will work on the pointer without destroying the rhs...
Definition: adsbDataServiceInterface.h:60
class DtVertexList:
Definition: vertexList.h:22
int myFirstDataFileDayOfWeek
Information read from the info text file that is accompanies the flight track files. The DoW and HoD, when combined with the baseName, indicate the name of the first and last flight track files. The interval (in hours), determines the name of succeeding files. Note that the firstDataFileDayOfWeek is in [0-6], but the lastDataFileDayOfWeek is >= 0 (should be >= myFirstDataFiledayOfWeek + 6).
Definition: adsbDataManager.h:273
virtual bool isDataLoading() const =0
Returns true if ADSB data is being loaded. Tracks should not be accessed when this is true...
DtTime myFirstDataSimTime
Computed from above.
Definition: adsbDataManager.h:294
DtTime myLatestRequestedTime
The latest end time of all data requests received (sim time).
Definition: adsbDataManager.h:301
Definition: adsbDataManager.h:195
DtSimulationServices * mySimulationServices
Definition: adsbDataManager.h:289
virtual bool isFileLoadError() const =0
Indicates that there was an error during the reading of data files, and the data manager cannot provi...
DtTime myAdsbTimeAtSimTime0
Definition: adsbDataManager.h:290
int myLastLoadedDayOfWeek
Indices for last file read.
Definition: adsbDataManager.h:286
DtTime myLatestLoadedTime
The latest time of all data loaded. (sim time)
Definition: adsbDataManager.h:303
QueryQueueMutex myQueryQueueMutex
Definition: adsbDataManager.h:254
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
std::set< DtIcaoAddress > DtIcaoAddrSet
Definition: adsbDataServiceInterface.h:127
virtual double simTimeFromAdsbTime(double adsbTime) const =0
Converts the ADSB data time to sim time. Needed to understand how sim time relates to the timestamps ...
DtIcaoAddrSet myUnusedTracks
List of the subset of tracks that are not in use. An unordered set of addresses.
Definition: adsbDataManager.h:248
virtual std::string stringForEpochTime(double t) const =0
Provides a string for the "adsb time" in a path point time stamp. This is useful in finding points in...
DtTime myFinalDataSimTime
Computed from above.
Definition: adsbDataManager.h:298
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
int myLastLoadedHourOfDay
Definition: adsbDataManager.h:287
std::shared_ptr< DtAdsbPathPointHandle > DtPointHandlePtr
Shared_ptr so that copy constructor will work on the pointer without destroying the rhs...
Definition: adsbDataServiceInterface.h:113
Class definition for one track created from ADSB messages, i.e. the identifying information and time-...
Definition: adsbTrack.h:97
virtual void updateSquawkChangedTimestamp(const int icaoAddress, const double &simTime)=0
Find the first point in the track's path that occurs after the specified sim time that contains a new...
std::string myBaseFileName
ADSB Epoch time of beginning of day for first data.
Definition: adsbDataManager.h:277
std::atomic< bool > myTimeToStop
Definition: adsbDataManager.h:308
tbb::task_arena myArena
Definition: adsbDataManager.h:313
std::atomic< bool > myResetData
Definition: adsbDataManager.h:305
virtual DtPointHandlePtr lastPointBeforeTime(const DtTrackHandlePtr track, double simTime) const =0
Find the last point in the track's path that occurs before (or at) the specified sim time...
virtual double barometricAltitudeAdjustment(const DtVector &localPosition, const double simTime) const =0
Returns barometric altitude adjustment. This is a distance in meters that is added to the pressure al...
DtAdsbTrackMap myTrackPtrsByIcaoAddress
Index into the track data by ICAO address.
Definition: adsbDataManager.h:244
DtTime myFinalDataAdsbTime
This is the dateTime of the end of the last ADSB data file.
Definition: adsbDataManager.h:296
virtual DtTrackHandlePtr trackHandleForAddress(DtIcaoAddress trackId) const =0
Returns information for the track with the specified address, or an empty pointer if it could not be ...
int myLastDataFileDayOfWeek
Definition: adsbDataManager.h:278
int myTrackToDebug
For debugging. Optionally read in from info file in data. An ICAO address.
Definition: adsbDataManager.h:311
virtual DtPointHandlePtr clonePoint(const DtPointHandlePtr p) const =0
Makes a new point handle that refers to the same path point as p. The original or new handle can late...