WSF
WsfTowedMover.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 WSFTOWEDMOVER_HPP
13#define WSFTOWEDMOVER_HPP
14
15#include "wsf_mil_export.h"
16
17#include <deque>
18
19#include "WsfOffsetMover.hpp"
20
22class WSF_MIL_EXPORT WsfTowedMover : public WsfOffsetMover
23{
24public:
32
33 WsfTowedMover(WsfScenario& aScenario);
34 WsfTowedMover(const WsfTowedMover& aSrc) = default;
36 ~WsfTowedMover() override = default;
37
39
40 void OnPlatformUpdated(double aSimTime, WsfPlatform* aPlatformPtr) override;
42
44
45 WsfMover* Clone() const override;
46 bool Initialize(double aSimTime) override;
47 bool ProcessInput(UtInput& aInput) override;
48 void Update(double aSimTime) override;
49
50 const char* GetScriptClassName() const override;
52
54 struct LeadState
55 {
56 void LoadFromPlatform(double aSimTime, WsfPlatform& aPlatform);
57
58 // Needed to support std::lower_bound algorithm
59 bool operator<(double aTime) { return (mTimeUpdated < aTime); }
60
61 double mLocationWCS[3];
62 double mVelocityWCS[3];
64 double mOrientationNED[3];
66 };
67
68 double GetDistanceMeters() { return mCurrentRange; }
69
70 DeploymentState GetState() { return mState; }
71
83 void SetReelInTime(double aStartReelInTime) { mStartReelInTime = aStartReelInTime; }
84
88 void SetReelInTimeAfterDeployment(double aStartReelInTime) { mRelativeReelInTimeAfterDeployed = aStartReelInTime; }
89
91 double GetReelInTimeAbsolute() { return mStartReelInTime; }
92
94 double GetReelInTimeAfterDeployment() { return mRelativeReelInTimeAfterDeployed; }
95
103 void SetReelInRate(double aRate) { mReelInRate = aRate; }
104
107 void SetReelOutRate(double aReelOutRate) { mReelOutRate = aReelOutRate; }
108
110 double GetReelOutRate() { return mReelOutRate; }
111
113 double GetReelInRate() { return mReelInRate; }
114
117 void SetTowLength(double aLength) { mTowLength = aLength; }
118
119protected:
120 void OnPlatformDeleted(double aSimTime, WsfPlatform* aPlatformPtr) override;
121
123 void GetLeadStateHistory(double aTime, LeadState& aState);
124
125 // delete asset once it has been stowed after being in some type of deployed state (reeling out/in or deployed)
126 void CleanUpStowedAsset(double aSimTime);
127
128 void ComputeTowDistance(double aSimTime);
129
131 void UpdateVelocity();
132
133private:
136 double mReelOutRate;
137
140 double mReelInRate;
141
144 double mTowLength;
145
148 double mStartReelInTime;
149
152 double mRelativeReelInTimeAfterDeployed;
153
156 double mStartReelInDistance;
157
160 double mCurrentRange;
161
164 std::deque<LeadState> mLeadPlatformStateQueue;
165
168 DeploymentState mState;
169
173 bool mRestoreQuantity;
174
178 bool mFollowLeadTrajectory;
179
184 double mAzimuthRelativeToLead;
185
189 double mElevationRelativeToLead;
190};
191
192#endif
WsfMover()=delete
const char * GetScriptClassName() const override
Definition WsfMover.cpp:616
bool ProcessInput(UtInput &aInput) override
Definition WsfOffsetMover.cpp:181
bool Initialize(double aSimTime) override
Definition WsfOffsetMover.cpp:102
WsfMover * Clone() const override
Definition WsfOffsetMover.cpp:86
void OnPlatformUpdated(double aSimTime, WsfPlatform *aPlatformPtr) override
Definition WsfOffsetMover.cpp:292
void Update(double aSimTime) override
Definition WsfOffsetMover.cpp:303
WsfOffsetMover()=delete
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
virtual void OnPlatformDeleted(double aSimTime, WsfPlatform *aPlatformPtr)
Called just before the platform is removed from the simulation.
Definition WsfSinglePlatformObserver.hpp:38
A specialized mover that will cause an object to be towed behind a platform, for example a decoy.
Definition WsfTowedMover.hpp:23
DeploymentState
Definition WsfTowedMover.hpp:26
@ cSTOWED
Definition WsfTowedMover.hpp:27
@ cDEPLOYED
Definition WsfTowedMover.hpp:29
@ cREELING_IN
Definition WsfTowedMover.hpp:30
@ cREELING_OUT
Definition WsfTowedMover.hpp:28
void SetTowLength(double aLength)
Definition WsfTowedMover.hpp:117
void SetReelInRate(double aRate)
Definition WsfTowedMover.hpp:103
double GetReelInTimeAbsolute()
Retrieve the time a towed asset is to be reeled in, absolute simulation time.
Definition WsfTowedMover.hpp:91
~WsfTowedMover() override=default
double GetReelInRate()
Retrieve the rate at which to reel in the towed asset.
Definition WsfTowedMover.hpp:113
void SetReelOutRate(double aReelOutRate)
Definition WsfTowedMover.hpp:107
WsfTowedMover & operator=(const WsfTowedMover &)=delete
double GetReelInTimeAfterDeployment()
Retrieve the time after the towed asset is to be reeled in. Time is relative to time at initial deplo...
Definition WsfTowedMover.hpp:94
void SetReelInTimeAfterDeployment(double aStartReelInTime)
Definition WsfTowedMover.hpp:88
double GetDistanceMeters()
Definition WsfTowedMover.hpp:68
double GetReelOutRate()
Retrieve the rate at which to reel out the towed asset.
Definition WsfTowedMover.hpp:110
DeploymentState GetState()
Definition WsfTowedMover.hpp:70
void SetReelInTime(double aStartReelInTime)
Definition WsfTowedMover.hpp:83
WsfTowedMover(const WsfTowedMover &aSrc)=default
WsfTowedMover(WsfScenario &aScenario)
Definition WsfTowedMover.cpp:29
Stores the state of the lead platform with a timestamp.
Definition WsfTowedMover.hpp:55
double mLocationWCS[3]
Definition WsfTowedMover.hpp:61
bool operator<(double aTime)
Definition WsfTowedMover.hpp:59
double mAccelerationWCS[3]
Definition WsfTowedMover.hpp:63
double mTimeUpdated
Definition WsfTowedMover.hpp:65
double mOrientationNED[3]
Definition WsfTowedMover.hpp:64
double mVelocityWCS[3]
Definition WsfTowedMover.hpp:62
void LoadFromPlatform(double aSimTime, WsfPlatform &aPlatform)
Definition WsfTowedMover.cpp:257
Copyrights Multiple, All Rights Reserved