11 #include <matrix/vlVector.h>
13 #include <vrfOM/sets/writeWeatherStateRepository.hpp>
14 #include <vrfOM/sets/readWeatherStateRepository.hpp>
15 #include <vrfOM/sets/readThermoclineLayerRepository.hpp>
30 , myWindLevels(
"wind-levels")
85 virtual const
double visibility(
double atAlt = 0.)
const {
throw DtUnimplementedMethod(
"visibility(atAltidude) is not implemented by this class."); };
87 virtual void setVisibility(
const double& atAlt,
const double&) {
throw DtUnimplementedMethod(
"setVisibility(const double& atAlt, const double& vis) is not implemented by this class."); };
97 virtual void setWindSpeed(
const double& atAlt,
const double&) {
throw DtUnimplementedMethod(
"setWindSpeed(const double& atAlt, const double& vis) is not implemented by this class."); };
126 virtual void addWindLevel(
double altitude,
double windSpeed,
double windDirection,
127 double visibleDistance,
int obscurant,
int cloudType,
double cloudDensity,
double skyCoverage) {
throw DtUnimplementedMethod(
"addWindLevel is not implemented by this class."); };
161 virtual const double ambientAirTemperature()
const override;
162 virtual void setAmbientAirTemperature(
const double&)
override;
164 virtual const double ambientAirPressure()
const override;
165 virtual void setAmbientAirPressure(
const double&)
override;
170 virtual const double precipitationIntensity()
const override;
171 virtual void setPrecipitationIntensity(
const double&)
override;
176 virtual const double windSpeed(
double atAlt = 0.)
const override;
177 virtual void setWindSpeed(
const double&)
override;
178 virtual void setWindSpeed(
const double& atAlt,
const double&)
override;
180 virtual const double windDirection(
double atAlt = 0.)
const override;
181 virtual void setWindDirection(
const double&)
override;
182 virtual void setWindDirection(
const double& atAlt,
const double&)
override;
184 virtual const int priority()
const override;
185 virtual void setPriority(
const int&)
override;
187 virtual const double visibility(
double atAltitude)
const override;
188 virtual void setVisibility(
const double&)
override;
189 virtual void setVisibility(
const double&,
const double&)
override;
191 virtual const int obscurant(
double atAltitude)
const override;
192 virtual void setObscurant(
double baseAlt,
const int&)
override;
194 virtual const double underwaterVisibility()
const override;
195 virtual void setUnderwaterVisibility(
const double&)
override;
197 virtual const double surfaceTransparency()
const override;
198 virtual void setSurfaceTransparency(
const double&)
override;
200 virtual const double waterCurrentSpeed()
const override;
201 virtual void setWaterCurrentSpeed(
const double&)
override;
203 virtual const double waterCurrentDirection()
const override;
204 virtual void setWaterCurrentDirection(
const double&)
override;
206 virtual const double ambientWaterTemperature()
const override;
207 virtual void setAmbientWaterTemperature(
const double&)
override;
209 virtual const double snowAccumulation()
const override;
210 virtual void setSnowAccumulation(
const double&)
override;
212 virtual const double rainAccumulation()
const override;
213 virtual void setRainAccumulation(
const double&)
override;
215 virtual const double snowMinimumAltitude()
const override;
216 virtual void setSnowMinimumAltitude(
const double&)
override;
218 virtual const double snowRoadAccumulation()
const override;
219 virtual void setSnowRoadAccumulation(
const double&)
override;
221 virtual const double tidalOffset()
const override;
222 virtual void setTidalOffset(
const double&)
override;
224 virtual const int swellState()
const override;
225 virtual void setSwellState(
const int&)
override;
227 virtual const double swellStateDirection()
const override;
228 virtual void setSwellStateDirection(
const double&)
override;
230 virtual const int seaState()
const override;
231 virtual void setSeaState(
const int&)
override;
233 virtual const double seaStateDirection()
const override;
234 virtual void setSeaStateDirection(
const double&)
override;
236 virtual const bool windDrivenSeaStateEnabled()
const override;
237 virtual void setWindDrivenSeaStateEnabled(
const bool&)
override;
239 virtual const double choppiness()
const override;
240 virtual void setChoppiness(
const double&)
override;
242 virtual const double surgeDepth()
const override;
243 virtual void setSurgeDepth(
const double&)
override;
245 virtual const double fogHeight()
const override;
246 virtual void setFogHeight(
const double&)
override;
248 virtual const unsigned int flags()
const override;
249 virtual void setFlags(
const unsigned int&)
override;
251 virtual const bool lightningPresent()
const override;
252 virtual void setLightningPresent(
const bool&)
override;
254 virtual const DtVector fogColor()
const override;
255 virtual void setFogColor(
const DtVector&)
override;
257 virtual const double thermoclineLayer1Depth()
const override;
258 virtual void setThermoclineLayer1Depth(
const double&)
override;
260 virtual const double thermoclineLayer1Permeability()
const override;
261 virtual void setThermoclineLayer1Permeability(
const double&)
override;
263 virtual const double thermoclineLayer2Depth()
const override;
264 virtual void setThermoclineLayer2Depth(
const double&)
override;
266 virtual const double thermoclineLayer2Permeability()
const override;
267 virtual void setThermoclineLayer2Permeability(
const double&)
override;
269 virtual const double thermoclineLayer3Depth()
const override;
270 virtual void setThermoclineLayer3Depth(
const double&)
override;
272 virtual const double thermoclineLayer3Permeability()
const override;
273 virtual void setThermoclineLayer3Permeability(
const double&)
override;
275 virtual const double thermoclineLayer4Depth()
const override;
276 virtual void setThermoclineLayer4Depth(
const double&)
override;
278 virtual const double thermoclineLayer4Permeability()
const override;
279 virtual void setThermoclineLayer4Permeability(
const double&)
override;
281 virtual const double thermoclineLayer5Depth()
const override;
282 virtual void setThermoclineLayer5Depth(
const double&)
override;
284 virtual const double thermoclineLayer5Permeability()
const override;
285 virtual void setThermoclineLayer5Permeability(
const double&)
override;
287 virtual const double airTemperatureAltitude()
const override;
288 virtual void setAirTemperatureAltitude(
const double&)
override;
290 virtual const double airPressureAltitude()
const override;
291 virtual void setAirPressureAltitude(
const double&)
override;
293 virtual const bool airTemperatureAltitudeIsSeaLevel()
const override;
294 virtual void setAirTemperatureAltitudeIsSeaLevel(
const bool&)
override;
296 virtual const bool airPressureAltitudeIsSeaLevel()
const override;
297 virtual void setAirPressureAltitudeIsSeaLevel(
const bool&)
override;
299 virtual const double seaLevelWaterConcentration()
const override;
300 virtual void setSeaLevelWaterConcentration(
const double&)
override;
307 virtual void addWindLevel(
double altitude,
double windSpeed,
double windDirection,
double visibleDistance,
int obscurant,
int cloudType,
double cloudDensity,
double skyCoverage)
override;
308 virtual void clearWindLevels()
override;
311 virtual void removeWindLevel(
double baseAltitude)
override;
314 virtual bool windSpeedAndDirectionAtAltitude(
double altMSL,
double& windSpeed,
double& windDirection)
const override;
315 virtual void setWindSpeedAndDirectionAtAltitude(
const double& altMSL,
const double& windSpeed,
const double& windDirection)
override;
318 virtual bool visibilityAndObscurantAtAltitude(
double altMSL,
double&
distance,
int& obs)
const override;
319 virtual void setVisibilityAndObscurantAtAltitude(
const double& altMSL,
const double& distance,
const int& obs)
override;
326 virtual void makeWritable()
override;
329 virtual void makeReadOnly()
override;
335 VRF::WriteThermoclineLayerRepository thermoclineLayer(
int)
const;
341 VRF::WriteThermoclineLayerRepository getOrCreateThermoclineLayer(
int);
345 virtual void setupWindLevels();
362 virtual const double ambientAirTemperature()
const override;
363 virtual const double ambientAirPressure()
const override;
365 virtual const double precipitationIntensity()
const override;
367 virtual const double windSpeed(
double atAlt = 0.)
const override;
368 virtual const double windDirection(
double atAlt = 0.)
const override;
369 virtual const int priority()
const override;
370 virtual const double visibility(
double atAltitude = 0.)
const override;
371 virtual const int obscurant(
double atAltitude)
const override;
372 virtual const double underwaterVisibility()
const override;
373 virtual const double surfaceTransparency()
const override;
374 virtual const double waterCurrentSpeed()
const override;
375 virtual const double waterCurrentDirection()
const override;
376 virtual const double ambientWaterTemperature()
const override;
377 virtual const double snowAccumulation()
const override;
378 virtual const double rainAccumulation()
const override;
379 virtual const double snowMinimumAltitude()
const override;
380 virtual const double snowRoadAccumulation()
const override;
381 virtual const double tidalOffset()
const override;
382 virtual const int swellState()
const override;
383 virtual const double swellStateDirection()
const override;
384 virtual const int seaState()
const override;
385 virtual const double seaStateDirection()
const override;
386 virtual const bool windDrivenSeaStateEnabled()
const override;
387 virtual const double choppiness()
const override;
388 virtual const double surgeDepth()
const override;
389 virtual const double fogHeight()
const override;
390 virtual const DtVector fogColor()
const override;
391 virtual const unsigned int flags()
const override;
392 virtual const bool lightningPresent()
const override;
393 virtual const double thermoclineLayer1Depth()
const override;
394 virtual const double thermoclineLayer1Permeability()
const override;
395 virtual const double thermoclineLayer2Depth()
const override;
396 virtual const double thermoclineLayer2Permeability()
const override;
397 virtual const double thermoclineLayer3Depth()
const override;
398 virtual const double thermoclineLayer3Permeability()
const override;
399 virtual const double thermoclineLayer4Depth()
const override;
400 virtual const double thermoclineLayer4Permeability()
const override;
401 virtual const double thermoclineLayer5Depth()
const override;
402 virtual const double thermoclineLayer5Permeability()
const override;
403 virtual const double airTemperatureAltitude()
const override;
404 virtual const double airPressureAltitude()
const override;
405 virtual const bool airTemperatureAltitudeIsSeaLevel()
const override;
406 virtual const bool airPressureAltitudeIsSeaLevel()
const override;
407 virtual const double seaLevelWaterConcentration()
const override;
410 virtual bool windSpeedAndDirectionAtAltitude(
double altMSL,
double& windSpeed,
double& windDirection)
const override;
413 virtual bool visibilityAndObscurantAtAltitude(
double altMSL,
double&
distance,
int& obs)
const override;
418 bool readComponentValid()
const;
421 bool findReadComponent();
427 VRF::ReadThermoclineLayerRepository thermoclineLayer(
int)
const;
432 virtual void updateWindLevels();
470 if (!myFoundComponent)
472 myFoundComponent = myCurrentFrameState.findReadComponent();
475 if (myNextFrameState.isWritable())
477 myNextFrameState.advancedFrame();
478 myCurrentFrameState.advanceFrame(myNextFrameState);
481 myCurrentFrameState.emitComponentUpdated();
488 myCurrentFrameState.updateStateData(sd);
489 myNextFrameState.updateStateData(sd);
496 myCurrentFrameState.aboutToBeDeleted();
497 myNextFrameState.aboutToBeDeleted();
502 virtual bool forceAdvance()
override;
505 virtual void firstFrameAdvance()
override;
DtVrfWeatherPrecipitationType
Definition: vrfWeatherStateEnums.h:13
virtual void addWindLevel(double altitude, double windSpeed, double windDirection, double visibleDistance, int obscurant, int cloudType, double cloudDensity, double skyCoverage)
Adds or replaces a wind level entry at the given altitude.
Definition: weatherStateComponent.h:126
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
virtual const int obscurant(double atAlt=0.) const
Returns the obscurant type at the given altitude.
Definition: weatherStateComponent.h:112
DtWeatherStateComponentNextFrame myNextFrameState
The next (writable) frame state.
Definition: weatherStateComponent.h:511
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual void setWindSpeed(const double &atAlt, const double &)
Sets the wind speed (m/s) at the given altitude.
Definition: weatherStateComponent.h:97
virtual void setObscurant(double atAlt, const int &)
Sets the obscurant type at the given altitude.
Definition: weatherStateComponent.h:115
virtual void setWindSpeed(const double &)
Sets the base wind speed (m/s).
Definition: weatherStateComponent.h:94
virtual void setVisibility(const double &atAlt, const double &)
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:87
virtual const double windSpeed(double atAlt=0.) const
Returns the wind speed (m/s) at the given altitude.
Definition: weatherStateComponent.h:92
virtual const DtRwWindLevels & windLevels() const override
Accessors/mutators for wind level.
virtual void setWindDirection(const double &atAlt, const double &)
Sets the wind direction (degrees true) at the given altitude.
Definition: weatherStateComponent.h:107
unsigned int myCallbackHandle
Handle for the instance-updated callback registered on the read repository.
Definition: weatherStateComponent.h:445
virtual void setWindDirection(const double &)
Sets the base wind direction (degrees true).
Definition: weatherStateComponent.h:104
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: weatherStateComponent.h:21
VRF::WriteWeatherStateRepository myWriteWeatherStateRepository
Legion write repository used to publish weather state data to the network.
Definition: weatherStateComponent.h:349
virtual void aboutToBeDeleted() override
Notifies both frame states and the base class that this component is about to be destroyed.
Definition: weatherStateComponent.h:493
virtual void updateDataStorage() override
Advances the component: locates the read component on first call and promotes the next frame state in...
Definition: weatherStateComponent.h:468
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
#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
virtual const double windDirection(double atAlt=0.) const
Returns the wind direction (degrees true) at the given altitude.
Definition: weatherStateComponent.h:102
virtual void removeWindLevel(double baseAltitude)
Must be exact match.
Definition: weatherStateComponent.h:132
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
3) Define the current frame class. This will be used for read access.
Definition: weatherStateComponent.h:353
DtWeatherStateComponentCurrentFrame myCurrentFrameState
The current (read-only) frame state.
Definition: weatherStateComponent.h:509
2) Define the next frame class. This will be used for write access.
Definition: weatherStateComponent.h:152
#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 aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: weatherStateComponent.h:450
VRF::ReadWeatherStateRepository myReadWeatherStateRepository
Legion read repository used to access weather state data from the network.
Definition: weatherStateComponent.h:443
DtVrfWeatherCloudState
Definition: vrfWeatherStateEnums.h:24
virtual DtFrameStateInterface * nextFrameState() override
Returns the writable next frame state interface.
Definition: weatherStateComponent.h:462
bool myFoundComponent
True once the Legion read component has been successfully located.
Definition: weatherStateComponent.h:513
bool isDoubleBuffered()
Returns true, indicating this component uses double-buffered storage.
Definition: weatherStateComponent.h:458
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the read-only current frame state interface.
Definition: weatherStateComponent.h:460
virtual const DtRwWindLevels & windLevels() const
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:143
virtual void setVisibility(const double &)
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:86
virtual bool windSpeedAndDirectionAtAltitude(double altMSL, double &windSpeed, double &windDirection) const
Given the altitude, return the wind speed and direction.
Definition: weatherStateComponent.h:135
DtStateComponentCreator< DtWeatherStateComponentImplementation > DtWeatherStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: weatherStateComponent.h:519
virtual void clearWindLevels()
Removes all wind level entries.
Definition: weatherStateComponent.h:129
virtual void setWindLevels(const DtRwWindLevels &)
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:142
#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
virtual bool visibilityAndObscurantAtAltitude(double altMSL, double &distance, int &obs) const
Given the altitude, return the visibility and obscurant.
Definition: weatherStateComponent.h:139
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer in both the current and next frame states.
Definition: weatherStateComponent.h:486
virtual void setVisibilityAndObscurantAtAltitude(const double &altMSL, const double &distance, const int &obs)
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:140
Contains the DtStateComponent class declaration.
Definition: rwWindLevels.h:17
virtual void setWindSpeedAndDirectionAtAltitude(const double &altMSL, const double &windSpeed, const double &windDirection)
Weather state property accessors and mutators. Derived classes provide concrete implementations.
Definition: weatherStateComponent.h:136
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
Definition: stateComponent.h:83
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the read-only next frame state interface.
Definition: weatherStateComponent.h:464
void advanceFrame(const DtWeatherStateComponentNextFrame &data)
Copies wind level data from the next-frame state into this current frame.
Definition: weatherStateComponent.h:436