VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
detonationController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
16 #include "vrfutil/simClock.h"
17 #include "vrfutil/simMunition.h"
18 #include <vlpi/disEnums.h>
19 
27 class DtSimMessage;
29 
38 {
39 
40 public:
41 
44  DtDetonationController(const DtString& name,
45  DtLocalObject* owner,
46  DtSimulationServices* simManager,
47  DtComponentDescriptor* desc = 0,
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
51  virtual ~DtDetonationController() override;
52 
56  virtual bool postAddComponentsInit() override;
57 
60  virtual const char* type() const override;
61 
64  virtual bool init() override;
65 
73  virtual void preFirstTickInit() override;
74 
76  virtual void tick() override;
77 
80  virtual bool createTriggerPort();
81  virtual DtBooleanOutputPort * triggerPort() const;
82 
85  virtual bool createArmedPort();
86  virtual DtBooleanOutputPort * armedPort() const;
87 
88  virtual bool createQuantityOutputPort();
89  virtual DtIntegerOutputPort* quantityOutputPort() const;
90 
91  virtual void setDetonationTime(DtTime detTime);
92  virtual DtTime detonationTime() const;
93 
97  virtual void detonate();
98 
101  virtual void beginSensing();
102 
105  virtual bool tripped(const DtRwSensorContactInfo * potentialVictim);
106 
108  virtual bool setMunitionToDetonate( DtSimMunition& munition );
109 
113  static void setDetonationCallback(DtSimMessage* msg, void* usrData);
114 
115  virtual void processSetDetonation(DtSimMessage* msg);
116 
118  static void setArmedCallback(DtSimMessage * msg, void * usr);
119 
120  virtual void processSetArmed(DtSimMessage* msg);
121 
122  static void setRestoreCallback(DtSimMessage * msg, void * usrData);
123 
124  virtual void processSetRestore(DtSimMessage * msg);
125 
127  virtual DtDetonatorFuze fuseStringToEnum(const DtString & fuseString);
128 
130  virtual DtString fuseStringToEnum(DtDetonatorFuze fuse);
131 
135  static DtSimComponent * creator(const DtString& name,
136  DtLocalObject* owner,
137  DtSimulationServices* simManager,
138  DtComponentDescriptor* desc = 0,
139  DtReaderWriterRegistry* parentRegistry = 0);
140 
141 protected:
142 
144  virtual bool createPorts() override;
145 
146  virtual bool createTypesToDetectPort();
147 
155  virtual void lookupAndCacheProcessSR();
156 
158  virtual void registerRadioMessageCallbacks();
159 
160 protected:
163 
166 
169  orig);
170 
171 protected:
172 
174 
176 
184 
192 
199 
206 
214 
216 
219  DtDetonatorFuze myCurrentFuze;
221  bool myAmArmed;
222 
224 
231 
233 
236 };
const DtDetonationControllerDescriptor * myDetonationDescriptor
Definition: detonationController.h:232
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
A multi-connection input port whose data members are sensor contact lists.
Definition: sensorContactListIOPort.h:46
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
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
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
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:68
This file contains the class declaration for the.
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: detonationController.h:235
DtIntegerOutputPort * myQuantityOutputPort
Output Port Name: quantity Output Port Description: Sends the number of rounds to be fired with a sin...
Definition: detonationController.h:213
virtual bool init() override
Calls setRadio()
File: simMsg.h.
Definition: simMessage.h:35
File: vlClock.h.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtDetonationController is used to detonate a bomb like munition.
Definition: detonationController.h:37
DtBooleanOutputPort * myTriggerPort
Output Port Name: trigger Output Port Description: Sends a new True value when trigger is pulled...
Definition: detonationController.h:198
DtTime myDetonationTime
Definition: detonationController.h:220
DtDetonatorFuze myCurrentFuze
Definition: detonationController.h:219
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtWarheadDetonationActuatorPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: detonationController.h:230
DtDetonationControllerDescriptor; descriptor for the DtDetonationController component.
Definition: detonationControllerDescriptor.h:29
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
DtSimMunition myCurrentMunition
The muntition and fuse to be used in the detonation.
Definition: detonationController.h:218
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
class DtWarheadDetonationActuatorPSR:
Definition: warheadDetonationActuatorPSR.h:27
DtEntityTypesListOutputPort * myTypesToDetectOutputPort
Output Port Name: object-types-to-spot-report Output Port Description: List of types of object the sp...
Definition: detonationController.h:191
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtSimMunition class.
Definition: simMunition.h:31
Instances of DtEntityTypesListOutputPort are output ports through which data producers can send a lis...
Definition: objectTypesListIOPort.h:46
DtSensorContactListMultiInputPort * myDetectedObjectsInputPort
Input Port Name: detected-objects Input Port Description: List of contacts that fall within our range...
Definition: detonationController.h:183
bool myAmArmed
Definition: detonationController.h:221
double myDetonationProximity
Definition: detonationController.h:223
DtBooleanOutputPort * myArmedPort
Output Port Name: armed Output Port Description: Set to true when the object is armed so warhead can ...
Definition: detonationController.h:205
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)