VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
laserGuidedLauncherController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 #pragma once
11 
14 #include "vrfobjcore/simObject.h"
17 
18 class DtLaserLauncherPSR;
19 class DtVectorOutputPort;
20 class DtSimMessage;
23 
24 namespace makVrf
25 {
26  class DtLaserDesignatorStateComponent;
27 }
28 
37 {
38 private:
45 
46 public:
47 
51  DtSimulationServices* simManager, DtComponentDescriptor* compDesc = 0,
52  DtReaderWriterRegistry* parentRegistry = 0);
53 
56 
59  virtual const char* type() const;
60 
63  virtual bool init();
64 
66  virtual void setComponentDescriptor(DtComponentDescriptor *compDesc);
67 
73  virtual bool createPSR();
74 
78  virtual void preFirstTickInit();
79 
81  virtual void tick();
82 
86  static DtSimComponent * creator(const DtString& name,
87  DtLocalObject* owner,
88  DtSimulationServices* simManager,
89  DtComponentDescriptor* desc = 0,
90  DtReaderWriterRegistry* parentRegistry = 0);
91 
92 protected:
93 
95  virtual void addRangeItems();
96 
97  virtual bool createPorts();
98 
101  virtual bool missileResourceAvailable() const;
102 
104  virtual void consumeMissileResource();
105 
107  virtual bool fireMunition(const makVrf::DtLaserDesignatorStateComponent& target);
108 
112  virtual DtCreateObjectHandle createMissileObject(const makVrf::DtLaserDesignatorStateComponent& target,
113  const DtString& eventId, const std::map<DtString, DtString>& extendedData = std::map<DtString, DtString>());
114 
117  virtual void createAndSendFireInteraction(DtCreateObjectHandle missile,
118  const makVrf::DtLaserDesignatorStateComponent& targetDesignator,
119  const DtString& eventId);
120 
128  virtual const makVrf::DtLaserDesignatorStateComponent* chooseTarget(bool& targetInFireCone, DtVector& targetLocalPosition) const;
129 
136  virtual bool targetDesginatorValid(const makVrf::DtLaserDesignatorStateComponent& target,
137  DtVector& targetLocalPosition) const;
138 
140  virtual bool targetDesginatorInFireCone(const makVrf::DtLaserDesignatorStateComponent& target) const;
141 
144  virtual bool munitionLoaded() const;
145 
148  virtual DtVector launcherGeocentricPosition() const;
149 
152  virtual DtVector launcherLocalPosition() const;
153 
155  virtual bool missileInFlight();
156 
158  virtual int defaultLaserCode() const;
159 
161  virtual bool permissionToFire(const DtVector& localSpotPosition) const;
162 
164  virtual bool canFireAtBasedOnTargetPriorityListRoe(DtSimObjectReference) const;
165 
167 
168  static void setLaserCodeRequestCallback(DtSimMessage* msg, void* usrData);
169  virtual void processSetLaserCodeRequestMessage(DtSimMessage* msg);
171 
174 
175  static void setSyncLaserCodeCallback(DtSimMessage* msg, void* usr);
176  virtual void processSetSyncLaserCode(DtSimMessage* msg);
178 
182  virtual void registerAttributeFunctions();
183 
187  static DtReaderWriter* provideLastMissileName(void* controller);
188  virtual DtReaderWriter* processProvideLastMissileName();
189 
191 
192 protected:
195 
199 
201 
202  DtVectorOutputPort* myTargetLocationOutputPort;
210 
216 
219 
221 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
Handle returned from Create Object Service calls.
Definition: createObjectHandle.h:12
This repository holds all information that is common to all the forms of missile entities within the ...
Definition: missileStateRepository.h:33
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
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
virtual bool init()
Calls setRadio()
DtMovementLocalObjectFacade myMovementLocalObjectFacade
Definition: laserGuidedLauncherController.h:220
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: laserDesignatorStateComponent.h:56
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
DtLaserLauncherPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: laserGuidedLauncherController.h:198
virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor)
The component descriptor specified in the order of battle file or parameter file that was used to cre...
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
File: laserLauncherPSR.h.
Definition: laserLauncherPSR.h:33
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
virtual void registerAttributeFunctions()
Called to register functions that provide system attribute values. Called by init(). Empty in this class. Overridden in different components to add attribute provider functions.
Definition: simComponent.h:112
End User Description: This is a missile launcher controller/actuator combination (does not need to be...
Definition: laserGuidedLauncherController.h:36
const DtIntegratedLaserGuidedLauncherDescriptor * myDescriptor
Pointer to my descriptor.
Definition: laserGuidedLauncherController.h:194
DtIntegratedLaserGuidedLauncherDescriptor, descriptor for the DtBallisticGunController component...
Definition: integratedLaserGuidedLauncherDescriptor.h:22
bool myTargetWasFoundLastTick
A state variable to remember that a target was found the tick before the current tick; used to delay ...
Definition: laserGuidedLauncherController.h:215
bool myWasTaskedToFireAtTarget
Will be set to true if permissionToFire was because of a fire at target task.
Definition: laserGuidedLauncherController.h:218
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)