VR-Forces 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 
15 #include "vrfobjcore/simObject.h"
18 
19 class DtLaserLauncherPSR;
20 class DtVectorOutputPort;
21 class DtSimMessage;
26 
27 namespace makVrf
28 {
29  class DtLaserDesignatorStateComponent;
30 }
31 
40 {
41 private:
48 
49 public:
50 
54  DtSimulationServices* simManager, DtComponentDescriptor* compDesc = nullptr,
55  DtReaderWriterRegistry* parentRegistry = nullptr);
56 
58  virtual ~DtLaserGuidedLauncherController() override;
59 
62  virtual const char* type() const override;
63 
66  virtual bool init() override;
67 
69  virtual void setComponentDescriptor(DtComponentDescriptor *compDesc) override;
70 
76  virtual bool createPSR();
77 
81  virtual void preFirstTickInit() override;
82 
84  virtual void tick() override;
85 
87 
88  virtual void clearTask() override;
89 
93  static DtSimComponent * creator(const DtString& name,
94  DtLocalObject* owner,
95  DtSimulationServices* simManager,
96  DtComponentDescriptor* desc = nullptr,
97  DtReaderWriterRegistry* parentRegistry = nullptr);
98 
99 protected:
100  virtual void registerTaskMsgCallbacks() override;
101  static void fireLaserGuidedMissileCallback(DtSimMessage* msg, void* usr);
102  virtual void processFireLaserGuidedMissileTask(DtSimMessage* msg);
103 
112  virtual bool bestMunitionForTargetNoSideEffects(
113  const DtRwLocationReference& targetLocation,
114  DtEntityType& munitionTypeOut,
116 
118  virtual bool fireWithoutDesignator();
119 
121  virtual void addRangeItems();
122 
123  virtual bool createPorts() override;
124 
127  virtual bool missileResourceAvailable() const;
128 
130  virtual void consumeMissileResource();
131 
134  virtual bool fireMunition(const makVrf::DtLaserDesignatorStateComponent* target);
135 
139  virtual DtCreateObjectHandle createMissileObject(int laserCode,
140  const DtString& eventId, const std::map<DtString, DtString>& extendedData = std::map<DtString, DtString>());
141 
144  virtual void createAndSendFireInteraction(DtCreateObjectHandle missile,
145  const makVrf::DtLaserDesignatorStateComponent* targetDesignator,
146  const DtString& eventId);
147 
155  virtual const makVrf::DtLaserDesignatorStateComponent* chooseTarget(bool& targetInFireCone, DtVector& targetLocalPosition) const;
156 
163  virtual bool targetDesginatorValid(const makVrf::DtLaserDesignatorStateComponent& target,
164  DtVector& targetLocalPosition) const;
165 
167  virtual bool targetDesginatorInFireCone(const makVrf::DtLaserDesignatorStateComponent& target) const;
168 
171  virtual bool munitionLoaded() const;
172 
175  virtual DtVector launcherGeocentricPosition() const;
176 
179  virtual DtVector launcherLocalPosition() const;
180 
182  virtual bool missileInFlight();
183 
185  virtual int defaultLaserCode() const;
186 
188  virtual bool canFireAtBasedOnTargetPriorityListRoe(DtSimObjectReference) const;
189 
191 
192  static void setLaserCodeRequestCallback(DtSimMessage* msg, void* usrData);
193  virtual void processSetLaserCodeRequestMessage(DtSimMessage* msg);
195 
198 
199  static void setSyncLaserCodeCallback(DtSimMessage* msg, void* usr);
200  virtual void processSetSyncLaserCode(DtSimMessage* msg);
202 
206  virtual void registerAttributeFunctions() override;
207 
211  static DtReaderWriter* provideLastMissileName(void* controller);
212  virtual DtReaderWriter* processProvideLastMissileName();
214 
215 protected:
218 
222 
224 
225  DtVectorOutputPort* myTargetLocationOutputPort;
233 
239 
242 
245 
247 
249 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Handle returned from Create Object Service calls.
Definition: createObjectHandle.h:12
DtGenericWeaponInfo * myWeaponInfo
Definition: laserGuidedLauncherController.h:248
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual void registerTaskMsgCallbacks()
AcceptLevel
Levels that a task controller can accept a task it has registered for.
Definition: taskControllerComponent.h:55
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...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
Holds a position of some form. May be an absolute position, or a reference to another object...
Definition: rwLocationReference.h:25
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() override
Calls setRadio()
DtMovementLocalObjectFacade myMovementLocalObjectFacade
Definition: laserGuidedLauncherController.h:246
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:64
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:221
virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor)
The component descriptor specified in the order of battle file or parameter file that was used to cre...
An implementation of DtWeaponInforInterface that allows for flexible registering of functions from ot...
Definition: genericWeaponInfo.h:18
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 frame...
std::map< DtEntityType, DtString > MunitionEvaluationReasons
Maps each evaluated munition type to a human-readable reason string. Selected munition maps to &quot;selec...
Definition: genericWeaponInfo.h:35
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
File: laserLauncherPSR.h.
Definition: laserLauncherPSR.h:34
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
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:132
virtual AcceptLevel acceptTask(const DtTaskMessage &task)
Called by the task manager when this controller is being considered to execute a task. Only tasks which already match types that this controller has registered for will be passed. This is used for the case where multiple task controllers have registered for the same task type. This gives the controller a chance to look at the parameters of the task and to reject the execution of the task based on parameters. Controllers can return any of the AcceptLevel levels. The task manager will choose a controller with the lowest AcceptLevel to execute, but will not choose any controller that returns AcceptLevel_NoAccept. Default implementation returns AcceptLevel_Accept. Override this to check parameters and conditionally return a different AccpetLevel.
End User Description: This is a missile launcher controller/actuator combination (does not need to be...
Definition: laserGuidedLauncherController.h:39
bool myWarnedForLostTarget
Indicates that a warning was already displayed when the current target was lost.
Definition: laserGuidedLauncherController.h:244
const DtIntegratedLaserGuidedLauncherDescriptor * myDescriptor
Pointer to my descriptor.
Definition: laserGuidedLauncherController.h:217
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:238
bool myWasTaskedToFireAtTarget
Will be set to true if permissionToFire was because of a fire at target task.
Definition: laserGuidedLauncherController.h:241
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 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)