VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
iffControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
16 #include <boost/function.hpp>
17 
18 class DtString;
20 class DtSimMessage;
21 class DtSetIff2Request;
22 class DtVrfIffPSR;
23 class DtIffModeSetting;
24 
25 namespace makVrf
26 {
27  class DtIffStateComponent;
28 }
29 
30 namespace makVrfEvents
31 {
32  class DtEvent;
33  class DtIffInterrogatorEvent;
34 }
35 
41 {
42 public:
43 
47  DtLocalObject* owner,
48  DtSimulationServices* simManager,
49  DtComponentDescriptor* desc = 0,
50  DtReaderWriterRegistry* parentRegistry = 0);
51 
53  virtual ~DtIffControllerComponent();
54 
55  virtual bool init();
56 
59  virtual void preFirstTickInit();
60 
63  virtual void tick();
64 
67  virtual const char* type() const;
68 
72  static DtSimComponent * creator(const DtString& name,
73  DtLocalObject* owner,
74  DtSimulationServices* simManager,
75  DtComponentDescriptor* desc = 0,
76  DtReaderWriterRegistry* parentRegistry = 0);
77 
79  virtual void registerSetIffRequestMsgCallbacks();
80 
81  static void setIffRequestCallback(DtSimMessage *msg, void * usrData);
82 
83  virtual void processSetIffRequestMessage(DtSimMessage *msg);
84 
85  static void setClutterIcaoIffRequestCallback(DtSimMessage *msg, void * usrData);
86 
87  virtual void processSetClutterIcaoIffRequestMessage(DtSimMessage *msg);
88 
92  virtual DtVrfIffPSR* getPsr();
94 
98  virtual void registerAttributeFunctions();
99 
103  static DtReaderWriter* provideSystemOn(void* controller);
104  static DtReaderWriter* provideMode1On(void* controller);
105  static DtReaderWriter* provideMode1Code(void* controller);
106  static DtReaderWriter* provideMode2On(void* controller);
107  static DtReaderWriter* provideMode2Code(void* controller);
108  static DtReaderWriter* provideMode3On(void* controller);
109  static DtReaderWriter* provideMode3Code(void* controller);
110  static DtReaderWriter* provideModeCOn(void* controller);
111  static DtReaderWriter* provideModeSOn(void* controller);
112  static DtReaderWriter* provideModeSTcasI(void* controller);
113  static DtReaderWriter* provideEmergency(void* controller);
114  static DtReaderWriter* provideFlash(void* controller);
117 
118  typedef boost::function<void (const DtIffModeSetting*)> ModeSettingFunction;
119  virtual void setModeSettingFunction(int, ModeSettingFunction);
120 
121 protected:
122  virtual void replyToInterrogation(const makVrfEvents::DtIffInterrogatorEvent* iff);
123  virtual void setupGeneralSettings(const DtIffModeSetting*);
124  virtual void setupBasicSettings(DtModeType, const DtIffModeSetting*);
125  virtual void setupTCASDataSettings(const DtIffModeSetting*);
126  virtual void setupMode5Settings(const DtIffModeSetting*);
127  virtual void setupModeSSettings(const DtIffModeSetting*);
128 
132 
135  orig);
136 
138  const DtIffControllerComponent & operator=(const
139  DtIffControllerComponent & orig);
140 
142  virtual void setRadio(DtSimRadio * radio);
143 
144  virtual bool createPublisher();
146  virtual void updateFromDescriptor();
148  virtual void updateFromSetRequest(DtSetIff2Request *setReq, bool updateInPSR = true);
150  virtual void updateFromIcao(DtSetClutterIcaoIffRequest *setReq);
153  virtual void updateDynamicData();
154 
160  virtual bool createPSR();
161 
163  virtual void setIsEnabled(bool yesNo) override;
164 
165 protected:
166  virtual void enable() override;
167  virtual void disable() override;
168 
169  virtual void processInterrogation(const makVrfEvents::DtEvent&);
170 
171 protected:
173 
177 
178  typedef std::map<int, ModeSettingFunction> ModeSettingFunctions;
180  boost::signals2::connection mySignalForInterrogatorEventConnection;
181 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtIffControllerComponent is a controller that manages a IFF publisher for an entity.
Definition: iffControllerComponent.h:40
Definition: iffInterrogatorEvent.h:14
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
std::map< int, ModeSettingFunction > ModeSettingFunctions
Definition: iffControllerComponent.h:178
ModeSettingFunctions myModeSettingFunctions
Definition: iffControllerComponent.h:179
Definition: simRadio.h:30
virtual void setRadio(DtSimRadio *radio)
virtual void enable() override
Enables the component and resends capable tasks and sets.
virtual void setIsEnabled(bool yesNo)
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
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.
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: setClutterIcaoIffRequest.h:27
Definition: readerWriterRegistry.h:39
virtual void disable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
makVrf::DtIffStateComponent * myIffComponent
Definition: iffControllerComponent.h:172
class DtSetIff2Request
Definition: setIff2Request.h:20
virtual bool init() override
Calls setRadio()
Definition: event.h:13
Definition: iffModeSettings.h:88
boost::signals2::connection mySignalForInterrogatorEventConnection
Definition: iffControllerComponent.h:180
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 ...
DtVrfIffPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: iffControllerComponent.h:176
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
boost::function< void(const DtIffModeSetting *)> ModeSettingFunction
Definition: iffControllerComponent.h:118
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
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:133
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: iffStateComponent.h:83
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
class DtVrfIffPSR:
Definition: vrfIffPSR.h:21

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)