VR-Engage  2.2
Loading...
Searching...
No Matches
icVreTdlTrack.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file icVreTdlTrack.h
7//! \ingroup vreVrfMessages
8//! \brief Interface classes for Tactical Data Link (TDL) track information
9//!
10//! This file defines the classes for representing tactical data link track information
11//! within the VREngage simulation. It includes IcVreTdlTrackContents structure for
12//! storing track data and IcVreTdlTrack class for message-based communication.
13
14#pragma once
15
16// VR-Forces includes
17#include <vrfExtProtocol/simInterfaceContent.h>
18#include <vrfutil/rwUUID.h>
19
20// VR-Link includes
21#include <vlutil/vlString.h>
22
23// #include "TDLMessageTypes.h"
24
25namespace ctiTdl
26{
27
28//! \brief Structure containing TDL track information
29//!
30//! This structure contains all the data fields for a Tactical Data Link (TDL) track,
31//! including common parameters, PPLI-specific parameters, and surveillance parameters.
33{
34 // common parameters
35 DtString tn; // track number (STN for PPLI, TN for Surveillance tracks)
36 int type; // see ctiTdl::TrackType in VreTdlTrackTypes.h
37 int domain; // see ctiTdl::TrackDomain in VreTdlTrackTypes.h
38
39 double latitude; // deg
40 double longitude; // deg
41 float altitudeElevDepth; // ft
42 float course; // deg
43 float speed; // mph
44
46 DtString specPlatformType; // specific platform type when available (J13.2), otherwise platform
47 bool ageingOut; // true when track is ageing out - symbol should flash when true
48
49 bool deleteRequest; // true when track should be deleted (sent once following deletion)
50
51 // common PPLI parameters
52 bool c2Indicator; // true when a PPLI and a C2 platform
53 DtString vcs; // voice callsign
54
55 // air PPLI parameters
56 bool flightLeader; // true when an Air PPLI and a Flight Leader
57 bool missionCommander; // true when an Air PPLI and a Mission Commander
58 bool bailout; // true when an Air PPLI and the bailout indicator is set
59 bool isTanker; // indicates if this is a tanker and thus offload fuel should be presented (J13.2)
60 int numFox1; // only used if isTanker = false (J13.2)
61 int numFox2; // only used if isTanker = false (J13.2)
62 int numFox3; // only used if isTanker = false (J13.2)
63 int numOther; // only used if isTanker = false (J13.2)
64 float offloadFuel; // only used if isTanker = true, thousands of lbs (J13.2)
65 float burnableFuel; // thousands of lbs (J13.2)
66
67 // air PPLI / target report parameters
68 DtString wingmanId; // alpha-numeric [0 - 9] or [A - Z] or space ' '
69
70 // surveillance / target report parameters
71 int identity; // see ctiTdl::TrackIdentity in VreTdlTrackTypes.h
72
73 // surveillance parameters
74 int survTrackSubType; // see ctiTdl::SurvTrackSubType in VreTdlTrackTypes.h
76
78 : tn("")
79 , type(0)
80 , domain(0)
81 , latitude(0)
82 , longitude(0)
84 , course(0)
85 , speed(0)
86 , strength(0)
88 , ageingOut(0)
89 , deleteRequest(0)
90 , c2Indicator(0)
91 , vcs("")
92 , flightLeader(0)
94 , bailout(0)
95 , isTanker(0)
96 , numFox1(0)
97 , numFox2(0)
98 , numFox3(0)
99 , numOther(0)
100 , offloadFuel(0)
101 , burnableFuel(0)
102 , wingmanId("")
103 , identity(0)
106 {
107 }
108
110 : tn(orig.tn)
111 , type(orig.type)
112 , domain(orig.domain)
113 , latitude(orig.latitude)
114 , longitude(orig.longitude)
116 , course(orig.course)
117 , speed(orig.speed)
118 , strength(orig.strength)
120 , ageingOut(orig.ageingOut)
123 , vcs(orig.vcs)
126 , bailout(orig.bailout)
127 , isTanker(orig.isTanker)
128 , numFox1(orig.numFox1)
129 , numFox2(orig.numFox2)
130 , numFox3(orig.numFox3)
131 , numOther(orig.numOther)
134 , wingmanId(orig.wingmanId)
135 , identity(orig.identity)
138 {
139 }
140
142 {
143 // Guard against assignment to yourself.
144 if (this == &orig)
145 {
146 return *this;
147 }
148
149 tn = orig.tn;
150 type = orig.type;
151 domain = orig.domain;
152 latitude = orig.latitude;
153 longitude = orig.longitude;
155 course = orig.course;
156 speed = orig.speed;
157 strength = orig.strength;
159 ageingOut = orig.ageingOut;
162 vcs = orig.vcs;
165 bailout = orig.bailout;
166 isTanker = orig.isTanker;
167 numFox1 = orig.numFox1;
168 numFox2 = orig.numFox2;
169 numFox3 = orig.numFox3;
170 numOther = orig.numOther;
173 wingmanId = orig.wingmanId;
174 identity = orig.identity;
177
178 return *this;
179 }
180};
181
182//! \brief Interface message class for TDL track information
183//!
184//! This class provides a mechanism for transmitting Tactical Data Link track
185//! information between simulation components. It encapsulates track contents
186//! and provides methods for network serialization and deserialization.
187class IcVreTdlTrack : public DtSimInterfaceContent
188{
189public:
190 //! \brief Default constructor
191 //!
192 //! Initializes an empty TDL track message.
194
195 //! \brief Virtual destructor
196 virtual ~IcVreTdlTrack() override;
197
198 //! \brief Copy constructor
199 //! \param orig The TDL track to copy from
200 //!
201 //! Creates a new TDL track by copying an existing one.
203
204 //! \brief Assignment operator
205 //! \param orig The TDL track to copy from
206 //! \return Reference to this object after assignment
207 //!
208 //! Copies the contents of another TDL track into this one.
210
211 //! \brief Gets the interface message type
212 //! \return The message type identifier
213 virtual int type() const override;
214
215 //! \brief Creates a copy of this message
216 //! \return Pointer to the new copy
217 //!
218 //! Calls the copy constructor to create a dynamically allocated clone.
219 virtual DtSimInterfaceContent* clone() const override;
220
221 //! \brief Static creator function for factory registration
222 //! \return Pointer to a new instance of IcVreTdlTrack
223 //!
224 //! This static function is used for registration with DtInterfaceContentFactory.
225 static DtSimInterfaceContent* creator();
226
227 //! \brief Gets the network representation size
228 //! \return Size in bytes of the network representation
229 //!
230 //! Returns the size of the full network representation padded to an 8-byte boundary.
231 virtual int netRepSize() const override;
232
233 //! \brief Deserializes the message from a network buffer
234 //! \param contentBuffer Pointer to the network buffer
235 //! \param contentSize Size of the buffer in bytes
236 //! \return True if deserialization was successful
237 //!
238 //! Fills the message from the provided network buffer.
239 virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
240
241 //! \brief Serializes the message for network transmission
242 //! \return True if serialization was successful
243 //!
244 //! Fills in the network buffer with the message contents.
245 virtual bool setToNet() override;
246
247 //! \brief Formats the message data as a string
248 //! \param str String to store the formatted message data
249 //!
250 //! Appends a human-readable representation of the message to the provided string.
251 virtual void printDataToString(DtString& str) override;
252
253 //! \brief Sets the UUID for this track
254 //! \param uuid The UUID to set
255 virtual void setUUID(DtUUID uuid);
256
257 //! \brief Gets the UUID of this track
258 //! \return The track's UUID
259 virtual DtUUID getUUID();
260
261 //! \brief Sets the source track number
262 //! \param stn The source track number to set
263 virtual void setSourceTrackNumber(const DtString& stn);
264
265 //! \brief Gets the source track number
266 //! \return The source track number
267 virtual DtString getSourceTrackNumber();
268
269 //! \brief Sets the track contents
270 //! \param track The track contents to set
271 virtual void setTrack(const IcVreTdlTrackContents& track);
272
273 //! \brief Gets the track contents
274 //! \return The track contents
276
277protected:
278 //! \brief UUID of this track for unique identification
279 DtUUID myUUID;
280
281 //! \brief Source track number (used for correlation)
283
284 //! \brief Detailed track contents/parameters
286};
287
288} // namespace ctiTdl
virtual DtUUID getUUID()
Gets the UUID of this track.
IcVreTdlTrack()
Default constructor.
virtual DtSimInterfaceContent * clone() const override
Creates a copy of this message.
virtual bool setToNet() override
Serializes the message for network transmission.
virtual ~IcVreTdlTrack() override
Virtual destructor.
static DtSimInterfaceContent * creator()
Static creator function for factory registration.
virtual void setSourceTrackNumber(const DtString &stn)
Sets the source track number.
IcVreTdlTrack & operator=(const IcVreTdlTrack &orig)
Assignment operator.
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Deserializes the message from a network buffer.
IcVreTdlTrackContents trackContents
Detailed track contents/parameters.
Definition icVreTdlTrack.h:285
DtString sourceTrackNumber
Source track number (used for correlation)
Definition icVreTdlTrack.h:282
virtual IcVreTdlTrackContents getTrack()
Gets the track contents.
IcVreTdlTrack(const IcVreTdlTrack &orig)
Copy constructor.
virtual void setUUID(DtUUID uuid)
Sets the UUID for this track.
virtual int type() const override
Gets the interface message type.
virtual DtString getSourceTrackNumber()
Gets the source track number.
virtual int netRepSize() const override
Gets the network representation size.
virtual void setTrack(const IcVreTdlTrackContents &track)
Sets the track contents.
virtual void printDataToString(DtString &str) override
Formats the message data as a string.
DtUUID myUUID
UUID of this track for unique identification.
Definition icVreTdlTrack.h:279
Definition icVreTdlEngagementStatus.h:29
Structure containing TDL track information.
Definition icVreTdlTrack.h:33
DtString wingmanId
Definition icVreTdlTrack.h:68
DtString tn
Definition icVreTdlTrack.h:35
IcVreTdlTrackContents & operator=(const IcVreTdlTrackContents &orig)
Definition icVreTdlTrack.h:141
bool isTanker
Definition icVreTdlTrack.h:59
bool bailout
Definition icVreTdlTrack.h:58
double longitude
Definition icVreTdlTrack.h:40
DtString specPlatformType
Definition icVreTdlTrack.h:46
int domain
Definition icVreTdlTrack.h:37
float burnableFuel
Definition icVreTdlTrack.h:65
int identity
Definition icVreTdlTrack.h:71
int numFox3
Definition icVreTdlTrack.h:62
bool flightLeader
Definition icVreTdlTrack.h:56
int survTrackSubType
Definition icVreTdlTrack.h:74
IcVreTdlTrackContents(const IcVreTdlTrackContents &orig)
Definition icVreTdlTrack.h:109
int numFox2
Definition icVreTdlTrack.h:61
float course
Definition icVreTdlTrack.h:42
double latitude
Definition icVreTdlTrack.h:39
int type
Definition icVreTdlTrack.h:36
bool c2Indicator
Definition icVreTdlTrack.h:52
IcVreTdlTrackContents()
Definition icVreTdlTrack.h:77
bool ageingOut
Definition icVreTdlTrack.h:47
float speed
Definition icVreTdlTrack.h:43
bool deleteRequest
Definition icVreTdlTrack.h:49
int strength
Definition icVreTdlTrack.h:45
bool missionCommander
Definition icVreTdlTrack.h:57
int numOther
Definition icVreTdlTrack.h:63
float altitudeElevDepth
Definition icVreTdlTrack.h:41
DtString vcs
Definition icVreTdlTrack.h:53
bool threatWarningActive
Definition icVreTdlTrack.h:75
int numFox1
Definition icVreTdlTrack.h:60
float offloadFuel
Definition icVreTdlTrack.h:64