VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fixedWingMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 
13 #pragma once
14 
16 
17 class DtString;
19 
20 class DtConstrainedAnalogPort;
21 class boolPort;
22 class DtRouteState;
23 class DtSimMessage;
24 class DtVectorOutputPort;
25 
28 #define DT_LANDING_BUFFER 5.0
29 
49 {
50 
51 public:
52 
56  DtLocalObject* owner,
57  DtSimulationServices* simManager,
58  DtComponentDescriptor* desc = 0,
59  DtReaderWriterRegistry* parentRegistry = 0);
60 
62  virtual ~DtFixedWingMoveAlongController() override;
63 
65  virtual bool init() override;
66 
72  virtual void preFirstTickInit() override;
73 
78  virtual void tick() override;
79 
82  virtual const char* type() const override;
83 
86  virtual void doFinishing();
87 
95  virtual void doFinishingForFlying();
96 
100  virtual void doFinishingForTaxiing();
101 
104  virtual void doMoving();
105 
111  virtual void doFlying();
112 
117  virtual void doTaxiing();
118 
123  virtual void doTakeOff();
124 
131  virtual void doLanding();
132 
141  virtual double findDesiredSpeed();
142 
152  virtual bool nearGoal();
153 
159  virtual bool atGoal();
160 
164  virtual bool passedGoal();
165 
171  static void setAltitudeCallback(DtSimMessage * msg, void * usrData);
172  static void setOrderedAltitudeCallback(DtSimMessage * msg, void * usrData);
173  static void setLocationCallback(DtSimMessage * msg, void * usrData);
174  static void setRestoreCallback(DtSimMessage * msg, void * usrData);
175  static void modifyVrfObjectCallback(DtSimMessage * msg, void * usr);
176 
177  virtual bool processFlyAlongTask(DtSimTask* msg, DtSimTaskStatePtr taskStatePtr);
178 
179  virtual bool processMoveAlongTask(DtSimTask* msg, DtSimTaskStatePtr taskStatePtr);
183  virtual void processRouteChanged();
184 
188  virtual void processSetAltitude(DtSimMessage * msg);
189  virtual void processSetOrderedAltitude(DtSimMessage * msg);
190  virtual void processSetLocation(DtSimMessage * msg);
191  virtual void processSetRestore(DtSimMessage * msg);
196  virtual void processModifyVrfObject(DtSimMessage * msg);
197 
198  virtual bool setupRoute();
199 
202  virtual void registerTaskMsgCallbacks() override;
203 
204  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
205 
207  static DtReaderWriter* provideNextRoutePointIndex(void* c);
208 
211 
212  virtual DtSimTaskStatePtr currentTaskState() const override;
213 
217  static DtSimComponent * creator(const DtString& name,
218  DtLocalObject* owner,
219  DtSimulationServices* simManager,
220  DtComponentDescriptor* desc = 0,
221  DtReaderWriterRegistry* parentRegistry = 0);
222 
223 protected:
224  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
225 
228 
231  const DtFixedWingMoveAlongController& orig);
232 
235  const DtFixedWingMoveAlongController& orig);
236 
238  void clearStoredRoute();
239 
243  void updateTakeOffDir();
244  void updateLandingDir();
245 
253  void processEntityLocationChange();
254 
277  virtual bool setMovementStatusFromRoute();
278 
280  virtual void resetValues();
281 
283  virtual void clearTask() override;
284 
285  virtual void updateTaskVisualizations() override;
286 
287  virtual void processEstimatedTotCalculation() override;
288 
289  virtual bool createPorts() override;
290 
291 protected:
292 
296 
299 
306  bool myChangedLocation = false;
307 };
308 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtFixedWingFlightPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: fixedWingPilotController.h:507
DtSimObjectReference myRoute
This is looked up once per tick - assumed unchanging while we have control.
Definition: fixedWingMoveAlongController.h:295
virtual void registerTaskMsgCallbacks()
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
bool myRouteHasChanged
Definition: fixedWingMoveAlongController.h:297
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: fixedWingMoveAlongController.h:305
Definition: readerWriter.h:85
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtFixedWingPilotController is a controller that models the capabilities of a fixed-wing pilot...
Definition: fixedWingPilotController.h:47
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual void tick() override
Only gets actuator values the first time it&#39;s called. Call lookupAndCacheProcessSR(), to look up myProcessState, if it hasn&#39;t already been found.
const DtFixedWingPilotController & operator=(const DtFixedWingPilotController &orig)
assignment operator; not implemented
virtual void updateTaskVisualizations() override
update visualizations
class DtFixedWingFlightPSR:
Definition: fixedWingFlightPSR.h:41
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
File: simMsg.h.
Definition: simMessage.h:35
virtual bool init() override
Initializes myFixedWingEntityState.
virtual DtSimTaskStatePtr currentTaskState() const
virtual bool createPorts() override
Overridden to create the fixed wing ports.
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
virtual void clearTask() override
Overridden to deactivate the port group when this controller completes a task.
DtFixedWingMoveAlongController is a controller that models the movement of a fixed wing entity along ...
Definition: fixedWingMoveAlongController.h:47
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
virtual DtFixedWingFlightPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: fixedWingMoveAlongController.h:210
virtual void processEstimatedTotCalculation()
calculate estimated tot
bool myWarnedForMovementStatus
Definition: fixedWingMoveAlongController.h:298
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)