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 {
19  {
25  , myNvgMode(0)
26  , myTaxiwayLightsOn(false)
27  , myHduLightsOn(false)
40  {};
41 
43  {
48  myNvgMode = orig.myNvgMode;
63  }
64 
66  {
71  myNvgMode = orig.myNvgMode;
86 
87  return *this;
88  }
89 
90  DEFINE_ACCESSOR_MUTATOR(int, antiCollisionLightsDayNight, AntiCollisionLightsDayNight)
91  DEFINE_ACCESSOR_MUTATOR(int, antiCollisionLightsFlashing, AntiCollisionLightsFlashing)
92  DEFINE_ACCESSOR_MUTATOR(int, formationLightsLuminance, FormationLightsLuminance)
93  DEFINE_ACCESSOR_MUTATOR(int, navigationLightsFlashing, NavigationLightsFlashing)
94  DEFINE_ACCESSOR_MUTATOR(int, nvgMode, NvgMode)
95  DEFINE_ACCESSOR_MUTATOR(bool, taxiwayLightsOn, TaxiwayLightsOn)
96  DEFINE_ACCESSOR_MUTATOR(bool, hduLightsOn, HduLightsOn)
97  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsOn, RefuelingStation1LightsOn)
98  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation1LightsColor, RefuelingStation1LightsColor)
99  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsFlashing, RefuelingStation1LightsFlashing)
100  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation1DayNight, RefuelingStation1DayNight)
101  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsOn, RefuelingStation2LightsOn)
102  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation2LightsColor, RefuelingStation2LightsColor)
103  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsFlashing, RefuelingStation2LightsFlashing)
104  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation2DayNight, RefuelingStation2DayNight)
105  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsOn, RefuelingStation3LightsOn)
106  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation3LightsColor, RefuelingStation3LightsColor)
107  DEFINE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsFlashing, RefuelingStation3LightsFlashing)
108  DEFINE_ACCESSOR_MUTATOR(int, refuelingStation3DayNight, RefuelingStation3DayNight)
109 
110  protected:
149  };
150 
154  {
155  public:
157 
159  : DtFrameStateInterface(storage)
160  {
161  }
162 
163  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, antiCollisionLightsDayNight, AntiCollisionLightsDayNight)
164  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, antiCollisionLightsFlashing, AntiCollisionLightsFlashing)
165  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, formationLightsLuminance, FormationLightsLuminance)
166  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, navigationLightsFlashing, NavigationLightsFlashing)
167  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, nvgMode, NvgMode)
168  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, taxiwayLightsOn, TaxiwayLightsOn)
169  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, hduLightsOn, HduLightsOn)
170  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsOn, RefuelingStation1LightsOn)
171  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation1LightsColor, RefuelingStation1LightsColor)
172  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation1LightsFlashing, RefuelingStation1LightsFlashing)
173  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation1DayNight, RefuelingStation1DayNight)
174  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsOn, RefuelingStation2LightsOn)
175  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation2LightsColor, RefuelingStation2LightsColor)
176  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation2LightsFlashing, RefuelingStation2LightsFlashing)
177  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation2DayNight, RefuelingStation2DayNight)
178  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsOn, RefuelingStation3LightsOn)
179  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation3LightsColor, RefuelingStation3LightsColor)
180  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, refuelingStation3LightsFlashing, RefuelingStation3LightsFlashing)
181  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, refuelingStation3DayNight, RefuelingStation3DayNight)
182 
183  };
184 
187  {
188  public:
190  virtual ~DtAircraftLightingStateComponentNextFrame() override;
191 
194  const DtAircraftLightingStateComponentData& frameState() const { return myData; };
196 
197  virtual const int antiCollisionLightsDayNight() const override;
198  virtual void setAntiCollisionLightsDayNight(const int&) override;
199 
200  virtual const int antiCollisionLightsFlashing() const override;
201  virtual void setAntiCollisionLightsFlashing(const int&) override;
202 
203  virtual const int formationLightsLuminance() const override;
204  virtual void setFormationLightsLuminance(const int&) override;
205 
206  virtual const int navigationLightsFlashing() const override;
207  virtual void setNavigationLightsFlashing(const int&) override;
208 
209  virtual const int nvgMode() const override;
210  virtual void setNvgMode(const int&) override;
211 
212  virtual const bool taxiwayLightsOn() const override;
213  virtual void setTaxiwayLightsOn(const bool&) override;
214 
215  virtual const bool hduLightsOn() const override;
216  virtual void setHduLightsOn(const bool&) override;
217 
218  virtual const bool refuelingStation1LightsOn() const override;
219  virtual void setRefuelingStation1LightsOn(const bool&) override;
220 
221  virtual const int refuelingStation1LightsColor() const override;
222  virtual void setRefuelingStation1LightsColor(const int&) override;
223 
224  virtual const bool refuelingStation1LightsFlashing() const override;
225  virtual void setRefuelingStation1LightsFlashing(const bool&) override;
226 
227  virtual const int refuelingStation1DayNight() const override;
228  virtual void setRefuelingStation1DayNight(const int&) override;
229 
230  virtual const bool refuelingStation2LightsOn() const override;
231  virtual void setRefuelingStation2LightsOn(const bool&) override;
232 
233  virtual const int refuelingStation2LightsColor() const override;
234  virtual void setRefuelingStation2LightsColor(const int&) override;
235 
236  virtual const bool refuelingStation2LightsFlashing() const override;
237  virtual void setRefuelingStation2LightsFlashing(const bool&) override;
238 
239  virtual const int refuelingStation2DayNight() const override;
240  virtual void setRefuelingStation2DayNight(const int&) override;
241 
242  virtual const bool refuelingStation3LightsOn() const override;
243  virtual void setRefuelingStation3LightsOn(const bool&) override;
244 
245  virtual const int refuelingStation3LightsColor() const override;
246  virtual void setRefuelingStation3LightsColor(const int&) override;
247 
248  virtual const bool refuelingStation3LightsFlashing() const override;
249  virtual void setRefuelingStation3LightsFlashing(const bool&) override;
250 
251  virtual const int refuelingStation3DayNight() const override;
252  virtual void setRefuelingStation3DayNight(const int&) override;
253 
255  virtual void makeWritable() override {};
256 
258  virtual void makeReadOnly() override {};
259 
260 
261  protected:
264  };
265 
268  {
269  public:
270 
273 
275  const DtAircraftLightingStateComponentData& frameState() const { return myData; };
276 
277  virtual const int antiCollisionLightsDayNight() const override;
278  virtual const int antiCollisionLightsFlashing() const override;
279  virtual const int formationLightsLuminance() const override;
280  virtual const int navigationLightsFlashing() const override;
281  virtual const int nvgMode() const override;
282  virtual const bool taxiwayLightsOn() const override;
283  virtual const bool hduLightsOn() const override;
284  virtual const bool refuelingStation1LightsOn() const override;
285  virtual const int refuelingStation1LightsColor() const override;
286  virtual const bool refuelingStation1LightsFlashing() const override;
287  virtual const int refuelingStation1DayNight() const override;
288  virtual const bool refuelingStation2LightsOn() const override;
289  virtual const int refuelingStation2LightsColor() const override;
290  virtual const bool refuelingStation2LightsFlashing() const override;
291  virtual const int refuelingStation2DayNight() const override;
292  virtual const bool refuelingStation3LightsOn() const override;
293  virtual const int refuelingStation3LightsColor() const override;
294  virtual const bool refuelingStation3LightsFlashing() const override;
295  virtual const int refuelingStation3DayNight() const override;
296 
297  friend class DtAircraftLightingStateImplementation;
298  void advanceFrame(const DtAircraftLightingStateComponentData& data) { myData = data; };
299 
300  protected:
303  };
304 
308  {
309  public:
311 
312  bool isDoubleBuffered() { return true; };
313  virtual const DtFrameStateInterface* currentFrameState() const override { return &myCurrentFrameState; }
314  virtual DtFrameStateInterface* nextFrameState() override { return &myNextFrameState; };
315  virtual const DtFrameStateInterface* nextFrameState() const override { return &myNextFrameState; };
316 
317  virtual void updateDataStorage() override
318  {
319  if (myNextFrameState.isWritable())
320  {
321  myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
322  }
323 
324  myCurrentFrameState.emitComponentUpdated();
325  }
326 
327  virtual void updateStateData(DtStateData* sd) override
328  {
329  myCurrentFrameState.updateStateData(sd);
330  myNextFrameState.updateStateData(sd);
331  }
332 
333  virtual void aboutToBeDeleted() override
334  {
336  myCurrentFrameState.aboutToBeDeleted();
337  myNextFrameState.aboutToBeDeleted();
338  }
339 
340  protected:
345  };
346 
350 }
int myRefuelingStation2LightsColor
Light color for aerial refueling station 2.
Definition: aircraftLightingStateComponent.h:124
int myRefuelingStation3DayNight
Day/night mode for aerial refueling station 3 lights.
Definition: aircraftLightingStateComponent.h:132
int myRefuelingStation2DayNight
Day/night mode for aerial refueling station 2 lights.
Definition: aircraftLightingStateComponent.h:130
bool myRefuelingStation3LightsOn
Whether aerial refueling station 3 lights are on.
Definition: aircraftLightingStateComponent.h:142
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
bool myRefuelingStation3LightsFlashing
Whether aerial refueling station 3 lights are flashing.
Definition: aircraftLightingStateComponent.h:148
bool myTaxiwayLightsOn
Whether taxiway lights are on.
Definition: aircraftLightingStateComponent.h:134
bool myRefuelingStation1LightsFlashing
Whether aerial refueling station 1 lights are flashing.
Definition: aircraftLightingStateComponent.h:144
bool myHduLightsOn
Whether HDU (Heads-Down Unit) lights are on.
Definition: aircraftLightingStateComponent.h:136
virtual void aboutToBeDeleted() override
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
Definition: aircraftLightingStateComponent.h:333
DtStateComponentCreator< DtAircraftLightingStateComponentImplementation > DtAircraftLightingStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: aircraftLightingStateComponent.h:349
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:194
int myRefuelingStation3LightsColor
Light color for aerial refueling station 3.
Definition: aircraftLightingStateComponent.h:126
int myNavigationLightsFlashing
Flashing mode for navigation lights.
Definition: aircraftLightingStateComponent.h:118
DtAircraftLightingStateComponentNextFrame myNextFrameState
Next frame state providing write access from the controller thread.
Definition: aircraftLightingStateComponent.h:344
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the read-only current frame state. Throws if not double-buffered.
Definition: aircraftLightingStateComponent.h:313
int myRefuelingStation1LightsColor
Light color for aerial refueling station 1.
Definition: aircraftLightingStateComponent.h:122
int myNvgMode
Night-vision goggle (NVG) compatibility mode.
Definition: aircraftLightingStateComponent.h:120
Data container for aircraft lighting state, including anti-collision, formation, navigation, NVG mode, taxiway, HDU, and aerial refueling station light properties.
Definition: aircraftLightingStateComponent.h:18
DtAircraftLightingStateComponentData & operator=(const DtAircraftLightingStateComponentData &orig)
Definition: aircraftLightingStateComponent.h:65
2) Define the next frame class. This will be used for write access.
Definition: aircraftLightingStateComponent.h:186
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
bool myRefuelingStation1LightsOn
Whether aerial refueling station 1 lights are on.
Definition: aircraftLightingStateComponent.h:138
DtAircraftLightingStateComponentCurrentFrame myCurrentFrameState
Current frame state providing thread-safe read access.
Definition: aircraftLightingStateComponent.h:342
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
int myAntiCollisionLightsFlashing
Flashing mode for anti-collision lights.
Definition: aircraftLightingStateComponent.h:114
bool myRefuelingStation2LightsOn
Whether aerial refueling station 2 lights are on.
Definition: aircraftLightingStateComponent.h:140
virtual DtFrameStateInterface * nextFrameState() override
Returns the writable next frame state. Throws if not double-buffered.
Definition: aircraftLightingStateComponent.h:314
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual by-value accessor and an undefined virtual setter, both throwing DtUnimp...
Definition: doubleBufferedDataStorage.h:103
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: aircraftLightingStateComponent.h:327
virtual void makeWritable() override
Override to make component writable.
Definition: aircraftLightingStateComponent.h:255
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
bool myRefuelingStation2LightsFlashing
Whether aerial refueling station 2 lights are flashing.
Definition: aircraftLightingStateComponent.h:146
DtAircraftLightingStateComponentData & frameState()
Definition: aircraftLightingStateComponent.h:195
bool isDoubleBuffered()
Definition: aircraftLightingStateComponent.h:312
int myAntiCollisionLightsDayNight
Day/night mode for anti-collision lights.
Definition: aircraftLightingStateComponent.h:112
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
3) Define the current frame class. This will be used for read access.
Definition: aircraftLightingStateComponent.h:267
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the read-only next frame state. Throws if not double-buffered.
Definition: aircraftLightingStateComponent.h:315
DtAircraftLightingStateComponentData(const DtAircraftLightingStateComponentData &orig)
Definition: aircraftLightingStateComponent.h:42
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: aircraftLightingStateComponent.h:307
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:153
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:275
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
DtAircraftLightingStateComponentData()
Definition: aircraftLightingStateComponent.h:20
int myRefuelingStation1DayNight
Day/night mode for aerial refueling station 1 lights.
Definition: aircraftLightingStateComponent.h:128
int myFormationLightsLuminance
Luminance level for formation lights.
Definition: aircraftLightingStateComponent.h:116
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: aircraftLightingStateComponent.h:317

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)