VR-Forces 4.10 Class Documentation
 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 
15 #include "vrfutil/simClock.h"
16 #include <vl/hostStructs.h>
17 #include "vrfutil/simMunition.h"
18 #include <vlpi/disEnums.h>
19 
26 class DtSimManager;
27 class DtSimMessage;
29 
38 {
39 
40 public:
41 
44  DtDetonationController(const DtString& name,
45  DtVrfObject* owner,
46  DtSimManager* 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  DtVrfObject* owner,
137  DtSimManager* 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 };
const DtDetonationControllerDescriptor * myDetonationDescriptor
Definition: detonationController.h:232
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:146
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
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:42
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:67
virtual bool init()
Calls setRadio()
This file contains the class declaration for the.
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.
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.
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
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
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
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtSimMunition class.
Definition: simMunition.h:34
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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)