VR-Forces 5.0.2 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();
52 
56  virtual bool postAddComponentsInit();
57 
60  virtual const char* type() const;
61 
64  virtual bool init();
65 
73  virtual void preFirstTickInit();
74 
76  virtual void tick();
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();
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
DtObjectTypesListOutputPort * 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 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:20
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 const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:68
virtual bool init()
Calls setRadio()
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
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
Instances of DtObjectTypesListOutputPort are output ports through which data producers can send a lis...
Definition: objectTypesListIOPort.h:46
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:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
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
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtSimMunition class.
Definition: simMunition.h:31
virtual bool postAddComponentsInit()
Calls enableTaskTypes()
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. 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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)