WSF
MTT_Track.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef MTT_TRACK_HPP
13#define MTT_TRACK_HPP
14
15#include <fstream>
16
17#include "WsfStringId.hpp"
18class InteractionKey; // Hopefully don't have to further define this
19#include "SupBlock.hpp"
20
22{
23public:
24 // Base class for track "data"
25 class Data
26 {
27 public:
28 virtual ~Data() = default;
29 virtual Data* Clone() const = 0;
30 virtual void ConvertFrom(const SupBlock& aBlock) {}
31 virtual void Log(std::fstream& aFS) {}
32 };
33
34public:
36 : mUpdateTime(0.0)
37 , mTrackId(0)
38 , mDataPtr(nullptr)
39 , mAssignmentId(0)
40 , mOriginatorId(nullptr)
41 , mSensorId(nullptr)
44 {
45 }
46
58
59 MTT_Track& operator=(const MTT_Track&) = delete;
60
61 virtual ~MTT_Track() { delete mDataPtr; }
62
63 int GetId() const { return mTrackId; }
64 // Suppressor offset ID
65 double mUpdateTime; // 01
66 int mTrackId; // 02
67 Data* mDataPtr; // 03
68 int mAssignmentId; // 04
69 // InteractionKey* mCommanderPtr; // 05 Commander that sent this assignment
71 WsfStringId mSensorId; // (wsf only)
74
75 void ConvertFrom(const SupBlock& aBlock)
76 {
77 mUpdateTime = aBlock.mFloatBlock[1];
78 mTrackId = aBlock.mIntBlock[2];
79 mAssignmentId = aBlock.mIntBlock[4];
80 mVerticalChannelActive = (aBlock.mIntBlock[6] != 0);
82 }
83
84 virtual void Log(std::fstream& aFS)
85 {
86 aFS << mUpdateTime << std::endl;
87 aFS << mTrackId << std::endl;
88 aFS << mAssignmentId << std::endl;
89 aFS << mVerticalChannelActive << std::endl;
90 aFS << mVerticalChannelUpdateTime << std::endl;
91 mDataPtr->Log(aFS);
92 }
93};
94
95#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition MTT_Track.hpp:26
virtual void Log(std::fstream &aFS)
Definition MTT_Track.hpp:31
virtual Data * Clone() const =0
virtual void ConvertFrom(const SupBlock &aBlock)
Definition MTT_Track.hpp:30
virtual ~Data()=default
int mTrackId
Definition MTT_Track.hpp:66
int mAssignmentId
Definition MTT_Track.hpp:68
int GetId() const
Definition MTT_Track.hpp:63
MTT_Track()
Definition MTT_Track.hpp:35
WsfStringId mSensorId
Definition MTT_Track.hpp:71
double mUpdateTime
Definition MTT_Track.hpp:65
double mVerticalChannelUpdateTime
Definition MTT_Track.hpp:73
MTT_Track(const MTT_Track &aSrc)
Definition MTT_Track.hpp:47
MTT_Track & operator=(const MTT_Track &)=delete
virtual void Log(std::fstream &aFS)
Definition MTT_Track.hpp:84
Data * mDataPtr
Definition MTT_Track.hpp:67
bool mVerticalChannelActive
Definition MTT_Track.hpp:72
virtual ~MTT_Track()
Definition MTT_Track.hpp:61
void ConvertFrom(const SupBlock &aBlock)
Definition MTT_Track.hpp:75
WsfStringId mOriginatorId
Definition MTT_Track.hpp:70
Definition SupBlock.hpp:21
float * mFloatBlock
Definition SupBlock.hpp:45
long * mIntBlock
Definition SupBlock.hpp:44
Copyrights Multiple, All Rights Reserved