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 
14 #include "vrfobjcore/simObject.h"
17 
18 class DtLaserLauncherPSR;
19 class DtVectorOutputPort;
20 class DtSimMessage;
24 
25 namespace makVrf
26 {
27  class DtLaserDesignatorStateComponent;
28 }
29 
38 {
39 private:
46 
47 public:
48 
52  DtSimulationServices* simManager, DtComponentDescriptor* compDesc = nullptr,
53  DtReaderWriterRegistry* parentRegistry = nullptr);
54 
56  virtual ~DtLaserGuidedLauncherController() override;
57 
60  virtual const char* type() const override;
61 
64  virtual bool init() override;
65 
67  virtual void setComponentDescriptor(DtComponentDescriptor *compDesc) override;
68 
74  virtual bool createPSR();
75 
79  virtual void preFirstTickInit() override;
80 
82  virtual void tick() override;
83 
85 
86  virtual void clearTask() override;
87 
91  static DtSimComponent * creator(const DtString& name,
92  DtLocalObject* owner,
93  DtSimulationServices* simManager,
94  DtComponentDescriptor* desc = nullptr,
95  DtReaderWriterRegistry* parentRegistry = nullptr);
96 
97 protected:
98  virtual void registerTaskMsgCallbacks() override;
99  static void fireLaserGuidedMissileCallback(DtSimMessage* msg, void* usr);
100  virtual void processFireLaserGuidedMissileTask(DtSimMessage* msg);
101 
103  virtual bool fireWithoutDesignator();
104 
106  virtual void addRangeItems();
107 
108  virtual bool createPorts() override;
109 
112  virtual bool missileResourceAvailable() const;
113 
115  virtual void consumeMissileResource();
116 
119  virtual bool fireMunition(const makVrf::DtLaserDesignatorStateComponent* target);
120 
124  virtual DtCreateObjectHandle createMissileObject(int laserCode,
125  const DtString& eventId, const std::map<DtString, DtString>& extendedData = std::map<DtString, DtString>());
126 
129  virtual void createAndSendFireInteraction(DtCreateObjectHandle missile,
130  const makVrf::DtLaserDesignatorStateComponent* targetDesignator,
131  const DtString& eventId);
132 
140  virtual const makVrf::DtLaserDesignatorStateComponent* chooseTarget(bool& targetInFireCone, DtVector& targetLocalPosition) const;
141 
148  virtual bool targetDesginatorValid(const makVrf::DtLaserDesignatorStateComponent& target,
149  DtVector& targetLocalPosition) const;
150 
152  virtual bool targetDesginatorInFireCone(const makVrf::DtLaserDesignatorStateComponent& target) const;
153 
156  virtual bool munitionLoaded() const;
157 
160  virtual DtVector launcherGeocentricPosition() const;
161 
164  virtual DtVector launcherLocalPosition() const;
165 
167  virtual bool missileInFlight();
168 
170  virtual int defaultLaserCode() const;
171 
173  virtual bool canFireAtBasedOnTargetPriorityListRoe(DtSimObjectReference) const;
174 
176 
177  static void setLaserCodeRequestCallback(DtSimMessage* msg, void* usrData);
178  virtual void processSetLaserCodeRequestMessage(DtSimMessage* msg);
180 
183 
184  static void setSyncLaserCodeCallback(DtSimMessage* msg, void* usr);
185  virtual void processSetSyncLaserCode(DtSimMessage* msg);
187 
191  virtual void registerAttributeFunctions() override;
192 
196  static DtReaderWriter* provideLastMissileName(void* controller);
197  virtual DtReaderWriter* processProvideLastMissileName();
199 
200 protected:
203 
207 
209 
210  DtVectorOutputPort* myTargetLocationOutputPort;
218 
224 
227 
230 
232 
234 };
#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:233
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
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:231
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:61
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:206
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:17
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...
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:96
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:131
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:37
bool myWarnedForLostTarget
Indicates that a warning was already displayed when the current target was lost.
Definition: laserGuidedLauncherController.h:229
const DtIntegratedLaserGuidedLauncherDescriptor * myDescriptor
Pointer to my descriptor.
Definition: laserGuidedLauncherController.h:202
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:223
bool myWasTaskedToFireAtTarget
Will be set to true if permissionToFire was because of a fire at target task.
Definition: laserGuidedLauncherController.h:226
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)