WSF
WsfFuelingOperation.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 WSFFUELINGOPERATION_HPP
16#define WSFFUELINGOPERATION_HPP
17
18#include "wsf_export.h"
19
20#include <string>
21#include <vector>
22
23class WsfTankedFuel;
24
37{
38public:
44 static void SetAllowSimultWingAndCenterlineFueling(bool aValue);
45
51 static void SetAllowSimultBoomAndHoseFueling(bool aValue);
52
55 {
57 cBOOM = 1,
58 cHOSE = 2
59 };
60
68
77
78 // static unsigned int GetUInt(StationType aStation);
79
80 // Constructors/Destructor
82 WsfFuelingOperation(double aSimTime,
83 WsfTankedFuel* aSupplierPtr,
84 WsfTankedFuel* aReceiverPtr,
85 MethodType aMethod,
86 StationType aStation,
87 double aInitRate);
89 virtual ~WsfFuelingOperation();
90
91 virtual double Update(double aSimTime, bool& aDisconnected);
92
94 double GetTransferRate() const { return mXferRate; }
95
97 double FuelTransferred() const { return mCumFuelXfer; }
98
100 double FuelingTime() const { return mLastUpdate - mStartFuelTime; }
101
103 double LastUpdate() const { return mLastUpdate; }
104
106 WsfTankedFuel* SupplyTankPtr() const { return mSupplierPtr; }
107
109 WsfTankedFuel* ReceiveTankPtr() const { return mReceiverPtr; }
110
112 MethodType GetMethod() const { return mMethod; }
113
114 std::string GetMethodName() const;
115 std::string GetStationName() const;
116
118 {
119 SupplyPoint() = default;
120
121 SupplyPoint(MethodType& aMethod, StationType& aStation, double aRate = 0.0)
122 : mMethod(aMethod)
123 , mStation(aStation)
124 , mOpPtr(nullptr)
125 , mConstRate(aRate)
126 {
127 }
128
129 std::string GetMethodName() const;
130 std::string GetStationName() const;
131
135 double mConstRate{0.0};
136 };
137
138 using SupplyPoints = std::vector<SupplyPoint>;
139 using SupplyPointIter = std::vector<SupplyPoint>::iterator;
140 using SupplyPointConstIter = std::vector<SupplyPoint>::const_iterator;
141
142protected:
143 virtual double CalcInitXferRate(double aSimTime) { return mXferRate; }
144 virtual double CalcRunXferRate(double aSimTime) { return mXferRate; }
145
146private:
147 void DisconnectP(double aSimTime);
148
149 WsfTankedFuel* mSupplierPtr;
150 WsfTankedFuel* mReceiverPtr;
151 double mStartFuelTime;
152 double mLastUpdate; // Will also represent mLastFuelTime after termination.
153 double mXferRate;
154 double mCumFuelXfer;
155 bool mCmdDisconnect; // This flag allows for the Receiver to terminate early.
156 bool mInternalDisc;
157 MethodType mMethod;
158 StationType mStation;
159};
160
161#endif
aObjectPtr Update(simTime)
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfFuelingOperation.hpp:37
std::string GetMethodName() const
Supplies a string describing the fuel supply method (hose, boom, NONE).
Definition WsfFuelingOperation.cpp:97
std::string GetStationName() const
Supplies a string describing the fuel supply station (left, center, right, NONE).
Definition WsfFuelingOperation.cpp:114
double LastUpdate() const
Supplies the last Update time of the operation in progress.
Definition WsfFuelingOperation.hpp:103
double FuelingTime() const
Supplies the cumulative elapsed time of the operation in progress.
Definition WsfFuelingOperation.hpp:100
double FuelTransferred() const
Supplies the cumulative fuel transferred during the operation in progress.
Definition WsfFuelingOperation.hpp:97
static void SetAllowSimultWingAndCenterlineFueling(bool aValue)
Definition WsfFuelingOperation.cpp:35
WsfTankedFuel * SupplyTankPtr() const
Supplies a pointer to the fuel tank supplying the fuel.
Definition WsfFuelingOperation.hpp:106
virtual double CalcRunXferRate(double aSimTime)
Definition WsfFuelingOperation.hpp:144
MethodType GetMethod() const
Supplies the enumeration describing the fuel supply method (cHOSE, cBOOM).
Definition WsfFuelingOperation.hpp:112
WsfFuelingOperation(const WsfFuelingOperation &aSrc)=delete
WsfTankedFuel * ReceiveTankPtr() const
Supplies a pointer to the fuel tank receiving the fuel.
Definition WsfFuelingOperation.hpp:109
static bool AllowSimultWingAndCenterlineFueling()
Definition WsfFuelingOperation.cpp:29
std::vector< SupplyPoint >::const_iterator SupplyPointConstIter
Definition WsfFuelingOperation.hpp:140
virtual double CalcInitXferRate(double aSimTime)
Definition WsfFuelingOperation.hpp:143
std::vector< SupplyPoint > SupplyPoints
Definition WsfFuelingOperation.hpp:138
double GetTransferRate() const
Supplies the transfer rate of the operation in progress.
Definition WsfFuelingOperation.hpp:94
Preference
This enumeration describes the preferred location to supply fuel from (if and when ambiguous).
Definition WsfFuelingOperation.hpp:63
@ cNO_PREFERENCE
No station preference has been given.
Definition WsfFuelingOperation.hpp:64
@ cCHOOSE_CENTER
When there is a choice, fuel from the centerline.
Definition WsfFuelingOperation.hpp:65
@ cCHOOSE_WING
When there is a choice, fuel from the wing stations.
Definition WsfFuelingOperation.hpp:66
MethodType
This enumeration describes the permitted methods of supplying fuel.
Definition WsfFuelingOperation.hpp:55
@ cBOOM
An extensible, controllable boom.
Definition WsfFuelingOperation.hpp:57
@ cNO_METHOD
No fuel may be transferred.
Definition WsfFuelingOperation.hpp:56
@ cHOSE
A flexible trailing hose and drogue.
Definition WsfFuelingOperation.hpp:58
static void SetAllowSimultBoomAndHoseFueling(bool aValue)
Definition WsfFuelingOperation.cpp:47
static bool AllowSimultBoomAndHoseFueling()
Definition WsfFuelingOperation.cpp:41
StationType
This enumeration describes the permitted stations for supplying fuel.
Definition WsfFuelingOperation.hpp:71
@ cLEFT_WING
Left wing fuel supply station.
Definition WsfFuelingOperation.hpp:73
@ cRIGHT_WING
Right wing fueling station.
Definition WsfFuelingOperation.hpp:75
@ cNO_STATION
Does not indicate a valid fuel supply station.
Definition WsfFuelingOperation.hpp:72
@ cCENTERLINE
Centerline fueling station.
Definition WsfFuelingOperation.hpp:74
std::vector< SupplyPoint >::iterator SupplyPointIter
Definition WsfFuelingOperation.hpp:139
WsfFuelingOperation()
Definition WsfFuelingOperation.cpp:52
Definition WsfTankedFuel.hpp:32
WsfFuelingOperation * mOpPtr
Definition WsfFuelingOperation.hpp:134
double mConstRate
Definition WsfFuelingOperation.hpp:135
StationType mStation
Definition WsfFuelingOperation.hpp:133
SupplyPoint(MethodType &aMethod, StationType &aStation, double aRate=0.0)
Definition WsfFuelingOperation.hpp:121
MethodType mMethod
Definition WsfFuelingOperation.hpp:132
Copyrights Multiple, All Rights Reserved