WSF
BallisticLaunchComputerGenerator.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 BALLISTICLAUNCHCOMPUTERGENERATOR_HPP
13#define BALLISTICLAUNCHCOMPUTERGENERATOR_HPP
14
15#include <string>
16#include <vector>
17
18#include "WeaponToolsExport.hpp"
19
20class WsfPlatform;
21#include "Tool.hpp"
22#include "WsfWeaponFuse.hpp"
23
35
37{
38public:
42
44 Tool* Clone() const override;
45 bool Initialize(WsfSimulation& aSimulation) override;
46 bool ProcessInput(UtInput& aInput) override;
47 void Update(double aSimTime) override;
48
49 void PlatformAdded(double aSimTime, WsfPlatform* aPlatformPtr) override;
50
51protected:
52 void LARGenUpdate(double aSimTime);
53 bool FireNewWeapon(double aSimTime) override;
54 void ErrorBailout() override;
55 WsfWeaponFuse* GetFuse(WsfPlatform* aPlatformPtr) const;
56
57 void WriteOutputFile();
58
59private:
61 enum StateType
62 {
63 cLAR_GEN,
64 cDONE
65 };
66
67 double TgtCurrentAlt() const { return TgtAltitude(mTgtAltIndex); }
68 double MyCurrentSpeed() const { return MySpeed(mMySpdIndex); }
69 double MyCurrentAlt() const { return MyAltitude(mMyAltIndex); }
70 double MySpeed(int i) const { return mMyMinSpeed + mDeltaMySpeed * i; }
71 double MyAltitude(int i) const { return mMyMinAlt + mMyDeltaAlt * i; }
72 double TgtAltitude(int i) const { return mTgtMinAlt + mTgtDeltaAlt * i; }
73
74 void CopyDataFrom(double*** aTOFs, double*** aDownRanges, int aNumMyAlts, int aNumMySpeeds, int aNumTgtAlts);
75 void AllocAndZeroData();
76 void DeallocateData();
77
78 // -------- Attributes:
79
80 int mMyAltIndex;
81 int mMySpdIndex;
82 int mTgtAltIndex;
83
84 double mMyMinAlt;
85 double mMyDeltaAlt;
86 int mNumMyAlts;
87
88 double mMyMinSpeed;
89 double mDeltaMySpeed;
90 int mNumMySpeeds;
91
92 double mTgtMinAlt;
93 double mTgtDeltaAlt;
94 int mNumTgtAlts;
95
96 // --- Varying State Values
97 StateType mState;
98 bool mFirstPass;
99
100 double*** mTOFs;
101 double*** mDownRanges;
102 std::string mGenTime;
103};
104
105#endif
#define WT_EXPORT
Definition WeaponToolsExport.hpp:26
BallisticLaunchComputerGenerator(WsfScenario &aScenario)
Definition BallisticLaunchComputerGenerator.cpp:42
BallisticLaunchComputerGenerator & operator=(const BallisticLaunchComputerGenerator &)=delete
void WriteOutputFile()
Definition BallisticLaunchComputerGenerator.cpp:385
WsfWeaponFuse * GetFuse(WsfPlatform *aPlatformPtr) const
Obtain a WsfWeaponFuse pointer out of the specified platform.
Definition BallisticLaunchComputerGenerator.cpp:597
void LARGenUpdate(double aSimTime)
Definition BallisticLaunchComputerGenerator.cpp:262
virtual bool Initialize(WsfSimulation &aSimulation)
Definition Tool.cpp:206
bool ProcessInput(UtInput &aInput) override
Definition Tool.cpp:103
Tool(const Tool &aSrc)
Definition Tool.cpp:65
virtual void PlatformAdded(double aSimTime, WsfPlatform *aPlatformPtr)
Optional tool method called by WeaponObserver to pass on the PlatformAdded simulation observer event.
Definition Tool.cpp:356
virtual void Update(double aSimTime)
Definition Tool.cpp:336
virtual void ErrorBailout()
Definition Tool.hpp:84
Tool * Clone() const override=0
virtual bool FireNewWeapon(double aSimTime)=0
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
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfWeaponFuse.hpp:54
Copyrights Multiple, All Rights Reserved