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 
19 class DtIffMode5Settings;
20 class DtString;
22 class DtSimMessage;
23 class DtSetIff2Request;
24 class DtVrfIffPSR;
25 class DtIffModeSetting;
27 
28 namespace makVrf
29 {
30  class DtIffStateComponent;
31 }
32 
33 namespace makVrfEvents
34 {
35  class DtEvent;
36  class DtIffInterrogatorEvent;
37 }
38 
44 {
45 public:
46 
50  DtLocalObject* owner,
51  DtSimulationServices* simManager,
52  DtComponentDescriptor* desc = 0,
53  DtReaderWriterRegistry* parentRegistry = 0);
54 
56  virtual ~DtIffControllerComponent() override;
57 
58  virtual bool init() override;
59 
62  virtual void preFirstTickInit() override;
63 
66  virtual void tick() override;
67 
70  virtual const char* type() const override;
71 
75  static DtSimComponent * creator(const DtString& name,
76  DtLocalObject* owner,
77  DtSimulationServices* simManager,
78  DtComponentDescriptor* desc = 0,
79  DtReaderWriterRegistry* parentRegistry = 0);
80 
82  virtual void registerSetIffRequestMsgCallbacks();
83 
84  static void setIffRequestCallback(DtSimMessage *msg, void * usrData);
85 
86  virtual void processSetIffRequestMessage(DtSimMessage *msg);
87 
88  static void setClutterIcaoIffRequestCallback(DtSimMessage *msg, void * usrData);
89 
90  virtual void processSetClutterIcaoIffRequestMessage(DtSimMessage *msg);
91 
95  virtual DtVrfIffPSR* getPsr();
97 
101  virtual void registerAttributeFunctions() override;
102 
106  static DtReaderWriter* provideSystemOn(void* controller);
107  static DtReaderWriter* provideMode1On(void* controller);
108  static DtReaderWriter* provideMode1Code(void* controller);
109  static DtReaderWriter* provideMode2On(void* controller);
110  static DtReaderWriter* provideMode2Code(void* controller);
111  static DtReaderWriter* provideMode3On(void* controller);
112  static DtReaderWriter* provideMode3Code(void* controller);
113  static DtReaderWriter* provideModeCOn(void* controller);
114  static DtReaderWriter* provideModeSOn(void* controller);
115  static DtReaderWriter* provideModeSTcasI(void* controller);
116  static DtReaderWriter* provideEmergency(void* controller);
117  static DtReaderWriter* provideFlash(void* controller);
120 
121  typedef boost::function<void (const DtIffModeSetting*)> ModeSettingFunction;
122  virtual void setModeSettingFunction(int, ModeSettingFunction);
123 
124 protected:
125  virtual void replyToInterrogation(const makVrfEvents::DtIffInterrogatorEvent* iff);
126  virtual void setupGeneralSettings(const DtIffModeSetting*);
127  virtual void setupBasicSettings(DtModeType, const DtIffModeSetting*);
128  virtual void setupTCASDataSettings(const DtIffModeSetting*);
129  virtual void setupMode5Settings(const DtIffModeSetting*);
130  virtual void setupModeSSettings(const DtIffModeSetting*);
131 
133  virtual void setupStaticMode5Settings();
134 
138 
141  orig);
142 
144  const DtIffControllerComponent & operator=(const
145  DtIffControllerComponent & orig);
146 
148  virtual void setRadio(DtSimRadio* radio) override;
149 
150  virtual bool createPublisher();
152  virtual void updateFromDescriptor();
154  virtual void updateFromSetRequest(DtSetIff2Request *setReq, bool updateInPSR = true);
156  virtual void updateFromIcao(DtSetClutterIcaoIffRequest *setReq);
159  virtual void updateDynamicData();
160 
166  virtual bool createPSR();
167 
169  virtual void setIsEnabled(bool yesNo) override;
170 
171 protected:
172  virtual void enable() override;
173  virtual void disable() override;
174 
175  virtual void processInterrogation(const makVrfEvents::DtEvent&);
176 
177 protected:
179 
183 
186 
187  typedef std::map<int, ModeSettingFunction> ModeSettingFunctions;
189  boost::signals2::connection mySignalForInterrogatorEventConnection;
190 };
#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:43
General settings that apply to all modes.
Definition: iffMode5Settings.h:12
Definition: iffInterrogatorEvent.h:14
const DtIffControllerDescriptor * myIffDescriptor
Descriptor for this controller; nullptr if the descriptor type is wrong.
Definition: iffControllerComponent.h:185
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
std::map< int, ModeSettingFunction > ModeSettingFunctions
Definition: iffControllerComponent.h:187
ModeSettingFunctions myModeSettingFunctions
Definition: iffControllerComponent.h:188
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...
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
virtual const char * type() const override=0
This returns a string from compTypes.h, and identifies the type of component.
Definition: readerWriterRegistry.h:39
makVrf::DtIffStateComponent * myIffComponent
Definition: iffControllerComponent.h:178
virtual void disable() override
Disables the component and resends capable tasks and sets.
class DtSetIff2Request
Definition: setIff2Request.h:20
virtual bool init() override
Calls setRadio()
Definition: event.h:13
Definition: iffModeSettings.h:89
DtIffControllerDescriptor; descriptor for the DtIffControllerComponent component. ...
Definition: iffControllerDescriptor.h:25
boost::signals2::connection mySignalForInterrogatorEventConnection
Definition: iffControllerComponent.h:189
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 frame...
DtVrfIffPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: iffControllerComponent.h:182
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:121
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
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:132
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:102
A locally simulated VRF object.
Definition: localObject.h:98
class DtVrfIffPSR:
Definition: vrfIffPSR.h:21

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)