WSF
WsfTankedFuel.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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFTANKEDFUEL_HPP
16#define WSFTANKEDFUEL_HPP
17
18#include "wsf_export.h"
19
22
32{
33public:
35 static WsfStringId TypeId();
36
37 // Constructors/Destructor
38 WsfTankedFuel(WsfScenario& aScenario);
40 ~WsfTankedFuel() override;
41
42 WsfFuel* Clone() const override;
43
44 bool Initialize(double aSimTime) override;
45
46 bool ProcessInput(UtInput& aInput) override;
47
48 void Update(double aSimTime) override;
49
50 void PlatformDeleted(WsfPlatform* aPlatformPtr) override;
51
54 bool SupplyInProcess() const;
55
58 bool ReceiveInProcess() const { return mReceiveInProcess; }
59
61 double MaxReceiveRate() const { return mMaxReceiveRate; }
62
65 bool TerminateAll(double aSimTime);
66
68 bool DisconnectFuelingOps(double aSimTime);
69
71 bool DisconnectFromTanker(double aSimTime);
72
75 bool DisconnectFrom(double aSimTime, WsfPlatform* aPlatformPtr);
76
78 double CurrentSupplyRate() const { return mCurrentSupplyRate; }
79
81 double CurrentReceiveRate() const { return mCurrentReceiveRate; }
82
85 double GetOpBandMaximum() const { return mOperBandMaximum; }
86
88 bool IsSupplyCapable() const { return !mStations.empty(); }
89
91 bool IsReceiveCapable() const { return mReceiveMethod != WsfFuelingOperation::cNO_METHOD; }
92
95 bool IsReceiveReady() const { return IsReceiveCapable() && !ReceiveInProcess(); }
96
98 WsfFuelingOperation::MethodType ReceiveMethod() const { return mReceiveMethod; }
99
105 bool FindStationFor(WsfTankedFuel* aReceiverPtr, WsfFuelingOperation::SupplyPointIter& aStationIter);
106
112 bool BeginSupplyingFuelTo(double aSimTime, WsfTankedFuel* aReceiverPtr);
113
115 double GetSupplyRate() const override { return mCurrentSupplyRate; }
116
118 double GetReceiveRate() const override { return mCurrentReceiveRate; }
119
126 bool ConnectTanker(double aSimTime, size_t aTankerIndex, WsfTankedFuel* aSourcePtr, double aTransferRate);
127
132 virtual double IncrementQuantity(double aSimTime, double aDelta);
133
138 virtual double DecrementQuantity(double aSimTime, double aDelta);
139
142 void SetSupplyMethodPreference(WsfFuelingOperation::MethodType aSupplyMethod) { mSupplyMethPref = aSupplyMethod; }
143
146 void SetSupplyLocationPreference(WsfFuelingOperation::Preference aLocationPref) { mSupplyLocPref = aLocationPref; }
147
148protected:
149 WsfTankedFuel(const WsfTankedFuel& aSrc);
150
151 bool SetDefaultSupplyConfig();
152
153 virtual double UpdateFuelingOps(double aSimTime);
154
155private:
156 // A collection of possible tanker fueling supply locations:
158 WsfFuelingOperation::MethodType mReceiveMethod;
159 WsfFuelingOperation::MethodType mSupplyMethPref;
160 WsfFuelingOperation::Preference mSupplyLocPref;
161
162 bool mReceiveInProcess;
163 bool mTankInstantly; // ignore any specified transfer rates
164
165 bool mIsBelowTriggered;
166 bool mIsAboveTriggered;
167
168 size_t mSupplierIndex;
169 WsfTankedFuel* mSupplyTankPtr;
170
171 double mLastFoUpdate;
172 double mMaxReceiveRate;
173
174 double mCurrentReceiveRate;
175 double mCurrentSupplyRate;
176
177 double mOperBandMaximum; // Desired maximum quantity obtained if refueled externally (<= Maximum + Reserve)
178 double mOperBandMinimum; // Minimum "full" quantity if refueled externally (<= mOperBandMaximum)
179};
180
181#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfFuel(WsfScenario &aScenario)
Definition WsfFuel.cpp:30
void Update(double aSimTime) override
Definition WsfFuel.cpp:308
void DecrementQuantity(double aDelta)
Definition WsfFuel.cpp:711
void IncrementQuantity(double aDelta)
Definition WsfFuel.cpp:706
std::vector< SupplyPoint > SupplyPoints
Definition WsfFuelingOperation.hpp:138
Preference
This enumeration describes the preferred location to supply fuel from (if and when ambiguous).
Definition WsfFuelingOperation.hpp:63
MethodType
This enumeration describes the permitted methods of supplying fuel.
Definition WsfFuelingOperation.hpp:55
@ cNO_METHOD
No fuel may be transferred.
Definition WsfFuelingOperation.hpp:56
std::vector< SupplyPoint >::iterator SupplyPointIter
Definition WsfFuelingOperation.hpp:139
virtual void PlatformDeleted(WsfPlatform *aPlatformPtr)
Definition WsfPlatformPart.cpp:343
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
bool ProcessInput(UtInput &aInput) override
Definition WsfTabularRateFuel.cpp:122
WsfTabularRateFuel(WsfScenario &aScenario)
Definition WsfTabularRateFuel.cpp:27
WsfFuel * Clone() const override
Definition WsfTabularRateFuel.cpp:63
bool Initialize(double aSimTime) override
Definition WsfTabularRateFuel.cpp:79
Definition WsfTankedFuel.hpp:32
WsfFuelingOperation::MethodType ReceiveMethod() const
Returns an enumeration indicating how this tank may receive fuel.
Definition WsfTankedFuel.hpp:98
double MaxReceiveRate() const
Maximum mass flow rate for this tank while receiving fuel.
Definition WsfTankedFuel.hpp:61
double CurrentReceiveRate() const
Returns the current rate at which this tank is receiving fuel from another.
Definition WsfTankedFuel.hpp:81
void SetSupplyMethodPreference(WsfFuelingOperation::MethodType aSupplyMethod)
Definition WsfTankedFuel.hpp:142
static WsfStringId TypeId()
String ID of this type of software object.
Definition WsfTankedFuel.cpp:31
bool ReceiveInProcess() const
Definition WsfTankedFuel.hpp:58
bool IsReceiveReady() const
Definition WsfTankedFuel.hpp:95
WsfTankedFuel(WsfScenario &aScenario)
Definition WsfTankedFuel.cpp:36
double GetReceiveRate() const override
Returns the rate of a 'receive' fueling operation in progress (if any).
Definition WsfTankedFuel.hpp:118
double CurrentSupplyRate() const
Returns the current rate at which this tank is supplying fuel to another.
Definition WsfTankedFuel.hpp:78
void SetSupplyLocationPreference(WsfFuelingOperation::Preference aLocationPref)
Definition WsfTankedFuel.hpp:146
double GetOpBandMaximum() const
Definition WsfTankedFuel.hpp:85
bool IsSupplyCapable() const
Returns an indication that this tank is enabled to supply fuel to another.
Definition WsfTankedFuel.hpp:88
WsfTankedFuel & operator=(const WsfTankedFuel &)=delete
bool SupplyInProcess() const
Definition WsfTankedFuel.cpp:577
double GetSupplyRate() const override
Returns the sum of all 'supply' fueling operations in progress.
Definition WsfTankedFuel.hpp:115
bool IsReceiveCapable() const
Returns an indication that this tank is enabled to receive fuel from another.
Definition WsfTankedFuel.hpp:91
Copyrights Multiple, All Rights Reserved