WSF
WsfLocalTrackStatus.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
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 WSFLOCALTRACKSTATUS_HPP
13#define WSFLOCALTRACKSTATUS_HPP
14
15#include "wsf_export.h"
16
17#include <memory>
18#include <string>
19
20class UtScriptClass;
21class UtScriptTypes;
22class WsfLocalTrack;
23#include "WsfTrackId.hpp"
24class WsfSimulation;
25
28{
29public:
31 WsfLocalTrackStatus(double aSimTime, WsfSimulation& aSimulation, const WsfLocalTrack* aLocalTrackPtr);
32 virtual ~WsfLocalTrackStatus() = default;
33
34 static std::unique_ptr<UtScriptClass> CreateScriptClass(const std::string& aClassName, UtScriptTypes* aScriptTypesPtr);
35
37
38
40 const WsfTrackId& GetLocalTrackId() const { return mLocalTrackId; }
41
43
45
46
48 WsfStringId GetTargetName() const { return mTargetName; }
49
50 void UpdateTargetName(WsfSimulation& aSimulation, const WsfLocalTrack* aLocalTrackPtr);
51
53
55
56
58 int GetStateIndex() const { return mStateIndex; }
59
61 WsfStringId GetStateName() const { return mStateName; }
62
63 double GetLastStateChangeTime() const { return mLastStateChangeTime; }
64
69 void SetState(double aSimTime, int aStateIndex, WsfStringId aStateName)
70 {
71 if (aStateIndex != mStateIndex)
72 {
73 mLastStateChangeTime = aSimTime;
74 }
75 mStateIndex = aStateIndex;
76 mStateName = aStateName;
77 }
78
80 bool TransitionPending() const { return mTransitionPending; }
81
83 void SetTransitionPending(bool aTransitionPending) { mTransitionPending = aTransitionPending; }
84
86
88
89
90 unsigned int EvaluationEpoch() const { return mEvaluationEpoch; }
91 void UpdateEvaluationEpoch() { ++mEvaluationEpoch; }
92
94
95private:
97 WsfTrackId mLocalTrackId;
98
100 double mLastStateChangeTime;
101
103 int mStateIndex;
104
106 WsfStringId mStateName;
107
109 WsfStringId mTargetName;
110
112 unsigned int mEvaluationEpoch;
113
116 bool mTransitionPending;
117};
118
119#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
static std::unique_ptr< UtScriptClass > CreateScriptClass(const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
Definition WsfLocalTrackStatus.cpp:69
void SetState(double aSimTime, int aStateIndex, WsfStringId aStateName)
Definition WsfLocalTrackStatus.hpp:69
void SetTransitionPending(bool aTransitionPending)
Set or clear the 'transition pending' status.
Definition WsfLocalTrackStatus.hpp:83
WsfLocalTrackStatus()=default
unsigned int EvaluationEpoch() const
Periodic evaluation control.
Definition WsfLocalTrackStatus.hpp:90
int GetStateIndex() const
Get the state index within the state machine.
Definition WsfLocalTrackStatus.hpp:58
WsfStringId GetStateName() const
Get the state name that is associated with the above state index (diagnostic use only).
Definition WsfLocalTrackStatus.hpp:61
bool TransitionPending() const
Is a transition pending into the current state.
Definition WsfLocalTrackStatus.hpp:80
const WsfTrackId & GetLocalTrackId() const
the track ID of the local track with which this status is associated.
Definition WsfLocalTrackStatus.hpp:40
WsfStringId GetTargetName() const
Get the string ID of the target that is associated with the local track.
Definition WsfLocalTrackStatus.hpp:48
virtual ~WsfLocalTrackStatus()=default
double GetLastStateChangeTime() const
Definition WsfLocalTrackStatus.hpp:63
void UpdateEvaluationEpoch()
Definition WsfLocalTrackStatus.hpp:91
Definition WsfLocalTrack.hpp:32
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfTrackId.hpp:33
Copyrights Multiple, All Rights Reserved