VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
airRefuelSupplierController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
21 
24 #include "matrix/vlVector.h"
25 
26 class DtString;
27 class DtSimManager;
28 class DtIntegerOutputPort;
29 class DtSimObjectBaseObjectStateRepository;
33 
35 {
39 };
40 
50  public DtBindableLuaComponent<DtAirRefuelSupplierController>
51 {
52 
53 public:
54 
58  DtLocalObject* owner,
59  DtSimulationServices* simManager,
60  DtComponentDescriptor* desc = 0,
61  DtReaderWriterRegistry* parentRegistry = 0);
62 
65 
66  virtual bool init();
67 
70  virtual const char* type() const;
71 
74  virtual void preFirstTickInit();
75 
77  virtual void tick();
78 
82  static DtSimComponent * creator(const DtString& name,
83  DtLocalObject* owner,
84  DtSimulationServices* simManager,
85  DtComponentDescriptor* desc = 0,
86  DtReaderWriterRegistry* parentRegistry = 0);
87 
89  static void internalTransferFuelTaskCallback(DtSimMessage* msg, void* usr);
90 
92  static void setRefuelPointEnabledCallback(DtSimMessage * msg, void * usr);
93  virtual void processSetRefuelPointEnabled(DtSimMessage* msg);
94 
96  virtual void setRefuelPointState(int point, DtRefuelPointState s);
97 
98  //returns the current state of the refuel point
99  virtual const int refuelPointState(int point) const;
100 
101  //updates the refuel point state
102  virtual void initRefuelPointList();
103 
104  //returns whether the refuel point is enabled or disabled
105  virtual const bool isRefuelPointEnabled(int point) const;
106 
107 
108 
110  virtual const DtRefuelPoint* lookupRefuelPoint(int artPart) const;
111 
114  virtual void bindLuaFunctions(lua_State* L);
115  virtual void bindLuaGlobals(lua_State* L);
116 
117 public:
122  virtual void enable(int artPart);
124  virtual bool isEnabled(int artPart) const;
125 
127  virtual void disable(int artPart);
129  virtual bool isDisabled(int artPart) const;
130 
132  virtual void setOccupied(int artPart);
134  virtual bool isOccupied(int artPart) const;
135 
137  virtual const std::string lookUpSupplyType(const char* type) const;
138 
140  virtual const DtVectorOffset3D lookupPointOffset(int artPart) const;
141 
144  virtual const int lookupRefuelPointState(int artPart) const;
145 
147  virtual bool isDrogue(int artPart) const;
148 
150  virtual bool isBoom(int artPart) const;
151 
153 
154 protected:
155 
161  virtual DtAirRefuelSupplierControllerPSR* createAirRefuelPSR();
162 
163 protected:
164  virtual void processInternalTransferFuelTask(DtSimMessage* msg);
165  virtual void processInternalTransferFuelTaskPSR();
166 
168  virtual void retrieveInternalTransferFuelTaskParams(const DtInternalTransferFuelTask* internalTransferFuelTask,
169  double & quantityRequestedTotal,
170  double & rate);
171 
173  virtual void retrieveInternalTransferFuelTaskParamsPSR(const DtInternalTransferFuelTask* internalTransferFuelTask,
174  double & supply,
175  double & rate);
176 
177  virtual bool verifyInternalTransferFuelTaskParams(double amount, double rate);
178 
179  virtual void internalTransferFuel();
180  virtual void processReceivingState();
181 
182  virtual void updateTaskedSupplies(double quantityRequestedTotal,
183  double rate);
184  virtual void updateReceivedSupplies(DtTime interval);
185 
186  virtual bool checkResourceFillUp();
187  virtual double resourceFillUp();
188  virtual bool checkResourceAvailable();
189  virtual double resourceAvailable();
190  virtual void updateResources(double quantity);
191  virtual void updatePSR();
192 
194  virtual double selfRefuelMaxRate();
195 
196 private:
204 
205 protected:
206 
207  //DtRwProperties myStateProperties;
208 
210 
214 
217 
218 protected:
221  const double theTotalReceivedAmountCompletePercentage = 0.999;
222 
224 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Definition: airRefuelSupplierControllerPSR.h:22
virtual void enable()
Overridden to call registerTaskMsgCallbacks().
DtRefuelPoint.
Definition: refuelPointsList.h:27
VR-Link includes.
Definition: internalTransferFuelTask.h:23
DtAirRefuelSupplierControllerDescriptor * myDescriptor
Definition: airRefuelSupplierController.h:209
DtAirRefuelSupplierControllerPSR * myProcessState
Container for state data associated with this component such as whether it is in the closed or opened...
Definition: airRefuelSupplierController.h:213
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual double resourceAvailable(const DtEntityType &type)
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
virtual void bindLuaFunctions(lua_State *)=0
Override to bind lua functions.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
const DtResupplySupplierController & operator=(const DtResupplySupplierController &orig)
assignment operator; not implemented
DtAirRefuelSupplierController is a simple actuator which controls the active state of an tanker&#39;s ref...
Definition: airRefuelSupplierController.h:49
Definition: readerWriterRegistry.h:39
Definition: bindableLuaComponent.h:53
DtRefuelPointState
Definition: airRefuelSupplierController.h:34
DtAirRefuelSupplierControllerDescriptor is the descriptor for DtAirRefuelSupplierController component...
Definition: airRefuelSupplierControllerDescriptor.h:24
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:424
File: simMsg.h.
Definition: simMessage.h:35
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: airRefuelSupplierController.h:223
Definition: airRefuelSupplierController.h:36
DtAirRefuelSupplierStateData myAirRefuelSupplierStateData
Controller state transition class.
Definition: airRefuelSupplierController.h:216
Definition: airRefuelSupplierStateData.h:78
virtual void disable()
Overridden to allow tasks controllers that can be disabled to call task complete. ...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
non-operational
Definition: airRefuelSupplierController.h:37
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
This class implements a controller, which gives the unit the capability to provide supplies...
Definition: resupplySupplierController.h:33
virtual const DtString lookUpSupplyType(const DtEntityType &type) const
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:121
virtual void tick()
tick()
virtual bool checkResourceAvailable(const DtEntityType &type)
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
operational
Definition: airRefuelSupplierController.h:38
virtual void bindLuaGlobals(lua_State *)=0
Override to bind lua globals.
virtual bool isEnabled()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)