VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
baseWeaponController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 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 
22 class DtInputPortGroup;
23 class DtIntegerInputPort;
24 
26 class DtVrfWeaponPSR;
27 
34 {
35 
36 public:
37 
40  DtBaseWeaponController(const DtString& name,
41  DtLocalObject* owner,
42  DtSimulationServices* simManager,
43  DtComponentDescriptor* desc = 0,
44  DtReaderWriterRegistry* parentRegistry = 0);
45 
47  virtual ~DtBaseWeaponController();
48 
50  virtual bool init();
51 
55  virtual bool postAddComponentsInit();
56 
58  virtual bool createMountingController();
59 
62  virtual const char* type() const;
63 
65  virtual void fire();
66 
69  virtual bool waitingForFire();
70 
72  virtual void setWaitingForFire(bool waiting);
73 
75  virtual bool createWeaponOutputPortGroup();
76 
78  virtual DtOutputPortGroup* weaponOutputPortGroup();
79 
81  virtual bool createWeaponInputPortGroup();
82 
84  virtual DtInputPortGroup* weaponInputPortGroup();
85 
88  virtual bool createTriggerPort();
89  virtual DtBooleanOutputPort * triggerPort() const;
90 
91  virtual bool createLoadAmmunitionPort();
92  virtual DtAmmunitionOutputPort * loadAmmunitionPort() const;
93 
94  virtual bool createLoadedPort();
95  virtual DtBooleanOutputPort * loadedPort() const;
96 
97  virtual bool createArtPartTypePort();
98  virtual DtIntegerInputPort * artPartTypePort() const;
99 
107  virtual void setPreloadWeapon(bool doPreload);
108  virtual bool preloadWeapon() const;
109 
110  virtual void setLoadAmmoTime(DtTime loadAmmoTime);
111  virtual DtTime loadAmmoTime() const;
112 
113  virtual void setUnloadAmmoTime(DtTime unloadAmmoTime);
114  virtual DtTime unloadAmmoTime() const;
115 
119  virtual void setMaxVehicleSpeedToFire(DtReal maxVehicleSpeedToFire);
120  virtual DtReal maxVehicleSpeedToFire() const;
121 
122  virtual bool weaponCorrectlyOriented() const;
123 
130  virtual void setMaxAzimuthAngleOffBoresight(DtReal maxAngle);
131  virtual DtReal maxAzimuthAngleOffBoresight() const;
132  virtual void setMaxElevationAngleOffBoresight(DtReal maxAngle);
133  virtual DtReal maxElevationAngleOffBoresight() const;
135 
136 
138  virtual void initProcessSR();
139 
141  virtual DtBaseMountingController * mountingController();
142 
144  virtual void setCurrentMunitionName(const DtString & currentMunitionName);
146  virtual const DtString & currentMunitionName() const;
147 
149  virtual DtVrfWeaponPSR* weaponProcessState();
151  virtual const DtVrfWeaponPSR* weaponProcessState() const;
152 
154  virtual void tick();
155 
159  static DtSimComponent * creator(const DtString& name,
160  DtLocalObject* owner,
161  DtSimulationServices* simManager,
162  DtComponentDescriptor* desc = 0,
163  DtReaderWriterRegistry* parentRegistry = 0);
164 
165 protected:
166 
169  virtual bool createPortGroups();
170 
172  virtual bool createPorts();
173 
181  virtual void lookupAndCacheProcessSR();
182 
183  virtual void preFirstTickInit();
184 
185 protected:
186 
189 
192 
195  orig);
196 
197 
198 protected:
199 
202 
206 
213 
220 
227 
231 
238 
240 
247 
252 
256 
259 
263 
270 
273 };
const DtBaseWeaponControllerDescriptor * myBaseWeaponCtlrDesc
Get ammo select tables from here.
Definition: baseWeaponController.h:261
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtIntegerInputPort * myArtPartTypePort
Input Port Name: art-part-type Input Port Description: Type of articulated part. Input Port Range: I...
Definition: baseWeaponController.h:237
DtBaseWeaponController is a controller that creates the ports needed to choose ammo for...
Definition: baseWeaponController.h:33
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
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...
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
DtVrfWeaponPSR * myWeaponProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: baseWeaponController.h:269
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtBooleanOutputPort * myLoadedPort
Output Port Name: loaded Output Port Description: True if loaded. Output Port Range: Output Port Def...
Definition: baseWeaponController.h:226
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
Instances of DtAmmunitionOutputPort are output ports through which data producers can send informatio...
Definition: ammunitionIOPort.h:48
File: weaponPSR.h.
Definition: vrfWeaponPSR.h:33
virtual bool init()
Calls setRadio()
This file contains the class declaration for the.
Contains class declarations for DtIntegerInputPort, DtIntegerOutputPort, and DtIntegerPortData.
Definition: integerIOPort.h:25
DtReal myFireMaxVehicleSpeed
Some vehicles must stop to shoot, others have a maximum speed to launch a munition.
Definition: baseWeaponController.h:255
bool myWaitingForFire
This flag is set to true when the controller pulls the trigger, and set back to false when the contro...
Definition: baseWeaponController.h:251
File: vlClock.h.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtAmmunitionOutputPort * myLoadAmmunitionPort
Output Port Name: ammunition Output Port Description: Type of ammunition to use Output Port Range: O...
Definition: baseWeaponController.h:212
DtOutputPortGroup * myWeaponOutputPortGroup
Output Port Group Name: weapon-control Output Port Group Description:
Definition: baseWeaponController.h:205
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
DtBaseWeaponControllerDescriptor; descriptor for the DtBaseWeaponController component.
Definition: baseWeaponControllerDescriptor.h:30
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
DtInputPortGroup * myWeaponInputPortGroup
Input Port Group Name: weapon-info Input Port Group Description:
Definition: baseWeaponController.h:230
DtReal myMaxAzimuthAngleOffBoresight
Definition: baseWeaponController.h:257
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: baseWeaponController.h:272
DtReal myMaxElevationAngleOffBoresight
Definition: baseWeaponController.h:258
virtual bool postAddComponentsInit()
Calls enableTaskTypes()
DtBaseMountingController is a controller that generates the azimuth and elevation controls needed to ...
Definition: baseMountingController.h:36
bool myDoWeaponPreload
If myDoWeaponPreload is true, the loader will load the first munition from the ammoselect table if th...
Definition: baseWeaponController.h:246
DtBooleanOutputPort * myTriggerPort
Output Port Name: trigger Output Port Description: True to fire. Output Port Range: Output Port Defa...
Definition: baseWeaponController.h:219
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
DtBaseMountingController * myBaseMountingController
Definition: baseWeaponController.h:262

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)