VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aircraftLightingStateComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include "legionDataStore/writeStateInstance.h"
11 
12 #include <vlutil/vlString.h>
13 
14 namespace makVrf
15 {
17  {
23  , myNvgMode(0)
24  , myTaxiwayLightsOn(false)
25  , myHduLightsOn(false)
38  {};
39 
41  {
46  myNvgMode = orig.myNvgMode;
61  }
62 
64  {
69  myNvgMode = orig.myNvgMode;
84 
85  return *this;
86  }
87 
88  DEFINE_ACCESSOR_MUTATOR(int, antiCollisionLightsDayNight, AntiCollisionLightsDayNight)
89  DEFINE_ACCESSOR_MUTATOR(int, antiCollisionLightsFlashing, AntiCollisionLightsFlashing)
90  DEFINE_ACCESSOR_MUTATOR(int, formationLightsLuminance, FormationLightsLuminance)
91  DEFINE_ACCESSOR_MUTATOR(int, navigationLightsFlashing, NavigationLightsFlashing)
92  DEFINE_ACCESSOR_MUTATOR(int, nvgMode, NvgMode)
93  DEFINE_ACCESSOR_MUTATOR(bool, taxiwayLightsOn, TaxiwayLightsOn)
94  DEFINE_ACCESSOR_MUTATOR(bool, hduLightsOn, HduLightsOn)
95  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsOn, RefuelingStation1LightsOn)
96  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation1LightsColor, RefuelingStation1LightsColor)
97  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsFlashing, RefuelingStation1LightsFlashing)
98  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation1DayNight, RefuelingStation1DayNight)
99  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsOn, RefuelingStation2LightsOn)
100  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation2LightsColor, RefuelingStation2LightsColor)
101  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsFlashing, RefuelingStation2LightsFlashing)
102  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation2DayNight, RefuelingStation2DayNight)
103  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsOn, RefuelingStation3LightsOn)
104  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation3LightsColor, RefuelingStation3LightsColor)
105  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsFlashing, RefuelingStation3LightsFlashing)
106  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation3DayNight, RefuelingStation3DayNight)
107 
108  protected:
128  };
129 
133  {
134  public:
136 
138  : DtFrameStateInterface(storage)
139  {
140  }
141 
142  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, antiCollisionLightsDayNight, AntiCollisionLightsDayNight)
143  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, antiCollisionLightsFlashing, AntiCollisionLightsFlashing)
144  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, formationLightsLuminance, FormationLightsLuminance)
145  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, navigationLightsFlashing, NavigationLightsFlashing)
146  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, nvgMode, NvgMode)
147  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, taxiwayLightsOn, TaxiwayLightsOn)
148  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, hduLightsOn, HduLightsOn)
149  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsOn, RefuelingStation1LightsOn)
150  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation1LightsColor, RefuelingStation1LightsColor)
151  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsFlashing, RefuelingStation1LightsFlashing)
152  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation1DayNight, RefuelingStation1DayNight)
153  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsOn, RefuelingStation2LightsOn)
154  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation2LightsColor, RefuelingStation2LightsColor)
155  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsFlashing, RefuelingStation2LightsFlashing)
156  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation2DayNight, RefuelingStation2DayNight)
157  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsOn, RefuelingStation3LightsOn)
158  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation3LightsColor, RefuelingStation3LightsColor)
159  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsFlashing, RefuelingStation3LightsFlashing)
160  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation3DayNight, RefuelingStation3DayNight)
161 
162  };
163 
166  {
167  public:
170 
173  const DtAircraftLightingStateComponentData& frameState() const { return myData; };
175 
176  const int antiCollisionLightsDayNight() const;
177  void setAntiCollisionLightsDayNight(const int&);
178 
179  const int antiCollisionLightsFlashing() const;
180  void setAntiCollisionLightsFlashing(const int&);
181 
182  const int formationLightsLuminance() const;
183  void setFormationLightsLuminance(const int&);
184 
185  const int navigationLightsFlashing() const;
186  void setNavigationLightsFlashing(const int&);
187 
188  const int nvgMode() const;
189  void setNvgMode(const int&);
190 
191  const bool taxiwayLightsOn() const;
192  void setTaxiwayLightsOn(const bool&);
193 
194  const bool hduLightsOn() const;
195  void setHduLightsOn(const bool&);
196 
197  const bool refuelingStation1LightsOn() const;
198  void setRefuelingStation1LightsOn(const bool&);
199 
200  const int refuelingStation1LightsColor() const;
201  void setRefuelingStation1LightsColor(const int&);
202 
203  const bool refuelingStation1LightsFlashing() const;
204  void setRefuelingStation1LightsFlashing(const bool&);
205 
206  const int refuelingStation1DayNight() const;
207  void setRefuelingStation1DayNight(const int&);
208 
209  const bool refuelingStation2LightsOn() const;
210  void setRefuelingStation2LightsOn(const bool&);
211 
212  const int refuelingStation2LightsColor() const;
213  void setRefuelingStation2LightsColor(const int&);
214 
215  const bool refuelingStation2LightsFlashing() const;
216  void setRefuelingStation2LightsFlashing(const bool&);
217 
218  const int refuelingStation2DayNight() const;
219  void setRefuelingStation2DayNight(const int&);
220 
221  const bool refuelingStation3LightsOn() const;
222  void setRefuelingStation3LightsOn(const bool&);
223 
224  const int refuelingStation3LightsColor() const;
225  void setRefuelingStation3LightsColor(const int&);
226 
227  const bool refuelingStation3LightsFlashing() const;
228  void setRefuelingStation3LightsFlashing(const bool&);
229 
230  const int refuelingStation3DayNight() const;
231  void setRefuelingStation3DayNight(const int&);
232 
234  virtual void makeWritable() {};
235 
237  virtual void makeReadOnly() {};
238 
239 
240  protected:
241  DtStateData* myStateData;
243  };
244 
247  {
248  public:
249 
252 
254  const DtAircraftLightingStateComponentData& frameState() const { return myData; };
255 
256  const int antiCollisionLightsDayNight() const;
257  const int antiCollisionLightsFlashing() const;
258  const int formationLightsLuminance() const;
259  const int navigationLightsFlashing() const;
260  const int nvgMode() const;
261  const bool taxiwayLightsOn() const;
262  const bool hduLightsOn() const;
263  const bool refuelingStation1LightsOn() const;
264  const int refuelingStation1LightsColor() const;
265  const bool refuelingStation1LightsFlashing() const;
266  const int refuelingStation1DayNight() const;
267  const bool refuelingStation2LightsOn() const;
268  const int refuelingStation2LightsColor() const;
269  const bool refuelingStation2LightsFlashing() const;
270  const int refuelingStation2DayNight() const;
271  const bool refuelingStation3LightsOn() const;
272  const int refuelingStation3LightsColor() const;
273  const bool refuelingStation3LightsFlashing() const;
274  const int refuelingStation3DayNight() const;
275 
276  friend class DtAircraftLightingStateImplementation;
278  {
279  myData = data;
280  }
281 
282  protected:
285  };
286 
290  {
291  public:
293 
294  bool isDoubleBuffered() { return true; };
295  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
296  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
297  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
298 
300  {
301  if (myNextFrameState.isWritable())
302  {
303  myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
304  }
305 
306  myCurrentFrameState.emitComponentUpdated();
307  }
308 
310  {
311  myCurrentFrameState.updateStateData(sd);
312  myNextFrameState.updateStateData(sd);
313  }
314 
315  virtual void aboutToBeDeleted() override
316  {
318  myCurrentFrameState.aboutToBeDeleted();
319  myNextFrameState.aboutToBeDeleted();
320  }
321 
322  protected:
325  };
326 
330 }
int myRefuelingStation2LightsColor
Definition: aircraftLightingStateComponent.h:115
int myRefuelingStation3DayNight
Definition: aircraftLightingStateComponent.h:119
int myRefuelingStation2DayNight
Definition: aircraftLightingStateComponent.h:118
bool myRefuelingStation3LightsOn
Definition: aircraftLightingStateComponent.h:124
Definition: stateComponent.h:266
bool myRefuelingStation3LightsFlashing
Definition: aircraftLightingStateComponent.h:127
bool myTaxiwayLightsOn
Definition: aircraftLightingStateComponent.h:120
bool myRefuelingStation1LightsFlashing
Definition: aircraftLightingStateComponent.h:125
bool myHduLightsOn
Definition: aircraftLightingStateComponent.h:121
virtual void aboutToBeDeleted() override
Definition: aircraftLightingStateComponent.h:315
DtStateComponentCreator< DtAircraftLightingStateComponentImplementation > DtAircraftLightingStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: aircraftLightingStateComponent.h:329
const DtAircraftLightingStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: aircraftLightingStateComponent.h:173
int myRefuelingStation3LightsColor
Definition: aircraftLightingStateComponent.h:116
int myNavigationLightsFlashing
Definition: aircraftLightingStateComponent.h:112
virtual const DtFrameStateInterface * nextFrameState() const
Definition: aircraftLightingStateComponent.h:297
DtAircraftLightingStateComponentData myData
Definition: aircraftLightingStateComponent.h:284
DtAircraftLightingStateComponentNextFrame myNextFrameState
Definition: aircraftLightingStateComponent.h:324
int myRefuelingStation1LightsColor
Definition: aircraftLightingStateComponent.h:114
int myNvgMode
Definition: aircraftLightingStateComponent.h:113
Definition: aircraftLightingStateComponent.h:16
DtAircraftLightingStateComponentData & operator=(const DtAircraftLightingStateComponentData &orig)
Definition: aircraftLightingStateComponent.h:63
2) Define the next frame class. This will be used for write access.
Definition: aircraftLightingStateComponent.h:165
virtual DtFrameStateInterface * nextFrameState()
Definition: aircraftLightingStateComponent.h:296
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: aircraftLightingStateComponent.h:299
bool myRefuelingStation1LightsOn
Definition: aircraftLightingStateComponent.h:122
DtAircraftLightingStateComponentCurrentFrame myCurrentFrameState
Definition: aircraftLightingStateComponent.h:323
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
int myAntiCollisionLightsFlashing
Definition: aircraftLightingStateComponent.h:110
bool myRefuelingStation2LightsOn
Definition: aircraftLightingStateComponent.h:123
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
bool myRefuelingStation2LightsFlashing
Definition: aircraftLightingStateComponent.h:126
DtAircraftLightingStateComponentData & frameState()
Definition: aircraftLightingStateComponent.h:174
bool isDoubleBuffered()
Definition: aircraftLightingStateComponent.h:294
DtStateData * myStateData
Definition: aircraftLightingStateComponent.h:283
int myAntiCollisionLightsDayNight
Definition: aircraftLightingStateComponent.h:109
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
3) Define the current frame class. This will be used for read access.
Definition: aircraftLightingStateComponent.h:246
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: aircraftLightingStateComponent.h:309
DtAircraftLightingStateComponentData(const DtAircraftLightingStateComponentData &orig)
Definition: aircraftLightingStateComponent.h:40
const DtFrameStateInterface * currentFrameState() const
Definition: aircraftLightingStateComponent.h:295
virtual void makeWritable()
Override to make component writable.
Definition: aircraftLightingStateComponent.h:234
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
DtAircraftLightingStateComponentData myData
Definition: aircraftLightingStateComponent.h:242
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: aircraftLightingStateComponent.h:289
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: aircraftLightingStateComponent.h:132
void advanceFrame(const DtAircraftLightingStateComponentData &data)
Definition: aircraftLightingStateComponent.h:277
Contains the DtStateComponent class declaration.
const DtAircraftLightingStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: aircraftLightingStateComponent.h:254
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
DtAircraftLightingStateComponentData()
Definition: aircraftLightingStateComponent.h:18
int myRefuelingStation1DayNight
Definition: aircraftLightingStateComponent.h:117
int myFormationLightsLuminance
Definition: aircraftLightingStateComponent.h:111

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)