VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtRemoteEnvironmentController Class Reference

DtRemoteEnvironmentController allows the user to interrogate the back-end which is simulating the environmental weather object to get the current weather state. More...

Public Member Functions

 DtRemoteEnvironmentController ()
 Constructor.
virtual void init (DtVrfMessageInterface *msgIf, DtReflectedEnvironmentProcessList *rel)
 Caches the given pointers as myMsgIf and myReflectedEnvironmentProcessList.
bool reflectingCurrentWeatherState ()
 Indicates if the weather state of the back-end simulating the weather has been reflected.
virtual void processEnvironmentProcessAdded (DtReflectedEnvironmentProcess *obj)
 Checks to see if the first recordPointer in the state repository of the DtReflectedEnvironmentProcess is of type DtEnvVrfWeatherStateRecordType, and if so it caches a pointer to the SR in myReflectedWeatherSR.
virtual void processEnvironmentProcessRemoved (DtReflectedEnvironmentProcess *obj)
 Checks to see if the DtReflectedEnvironmentProcess being removed corresponds to the one cached in myReflectedWeatherSR, and if so myReflectedWeatherSR is set to 0.
virtual void setAirTurbidity (double value)
 Air Turbidity.
virtual double airTurbidity ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setAmbientAirTemperature (double value)
 Ambient Air Temperature.
virtual double ambientAirTemperature ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setCloudState (DtVrfWeatherCloudState)
 Cloud State.
virtual DtVrfWeatherCloudState cloudState ()
 If !reflectingCurrentWeatherState(), the default is DtVrfWeatherCloudStateClear.
virtual void setPrecipitationIntensity (double value)
 Precipitation Intensity.
virtual double precipitationIntensity ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setPrecipitationType (DtVrfWeatherPrecipitationType)
 Precipitation Intensity.
virtual
DtVrfWeatherPrecipitationType 
precipitationType ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setWindSpeed (double value)
 Wind speed in m/s.
virtual double windSpeed ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setWindDirection (double value)
 Wind direction in radians.
virtual double windDirection ()
 If !reflectingCurrentWeatherState(), the default is 0.0.
virtual void setVisibility (double value)
 Visibility in meters.
virtual double visibility ()
 If !reflectingCurrentWeatherState(), the default is 16,000 (16km)
virtual double illumination ()
 Illumination in percentage (0 to 1.0).
virtual void setTimeOfDay (double secondsPastMidnight)
 The current time of day, specified by the number of seconds passed midnight.
virtual double timeOfDay ()
 If !reflectingCurrentWeatherState(), the default is 43200 (12:00 noon)
virtual void setTimeOfDayAdvancementSpeed (double speed)
 The current time of day advancement speed.
virtual double timeOfDayAdvancementSpeed ()
 If !reflectingCurrentWeatherState(), the default is 0 (no advance)
virtual void setUnderwaterVisibility (double underwaterVisibility)
 Underwater visibility in meters.
virtual double underwaterVisibility ()
 Underwater visibility in meters.
virtual void setSurfaceTransparency (double transparency)
 Surface transparency (percentage)
virtual double surfaceTransparency ()
 Surface transparency (percentage)
virtual void setWaterCurrentSpeed (double waterCurrentSpeed)
 Water velocity in meters per second.
virtual double waterCurrentSpeed ()
 Water velocity in meters per second.
virtual void setWaterCurrentDirection (double waterCurrentDirection)
 Water direction in radians clockwise from 0 (north)
virtual double waterCurrentDirection ()
 Water direction in radians clockwise from 0 (north)
virtual void setAmbientWaterTemperature (double waterTemperature)
 Ambient water temperature in Celsius.
virtual double ambientWaterTemperature ()
 Ambient water temperature in Celsius.
virtual void setTidalOffset (double tidalOffset)
 Tidal offset in meters from the water polygons in the database.
virtual double tidalOffset ()
 Tidal offset in meters from the water polygons in the database.
virtual void setTidalDirection (bool tidalDirection)
 Tidal direction where true represents the tide going in and false represents the tide going out.
virtual bool tidalDirection ()
 Tidal direction where true represents the tide going in and false represents the tide going out.
virtual void setSwellState (unsigned int state)
 Swell state according to the Douglas Sea Scale (integer 0 - 9)
virtual unsigned int swellState ()
 Swell state according to the Douglas Sea Scale (integer 0 - 9)
virtual void setSwellStateDirection (double direction)
 Swell direction in in radians clockwise from 0 (north)
virtual double swellStateDirection ()
 Swell direction in in radians clockwise from 0 (north)
virtual void setSeaState (unsigned int douglasScale)
virtual unsigned int seaState ()
virtual void setSeaStateDirection (double radiansFromNorth)
virtual double seaStateDirection ()
void setWindDrivenSeaStateEnabled (bool enabled)
bool windDrivenSeaStateEnabled ()
virtual void setChoppiness (double choppiness)
 Wave choppiness (0..1)
virtual double choppiness ()
 Wave choppiness (0..1)
virtual void setSurgeDepth (double depth)
 Surge depth (meters)
virtual double surgeDepth ()
 Surge depth (meters)
virtual void setThermoclineLayer1Depth (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer1Depth ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer1Permeability (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer1Permeability ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer2Depth (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer2Depth ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer2Permeability (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer2Permeability ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer3Depth (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer3Depth ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer3Permeability (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer3Permeability ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer4Depth (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer4Depth ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer4Permeability (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer4Permeability ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer5Depth (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer5Depth ()
 Thermocline depth (in meters) and permeability (0..1).
virtual void setThermoclineLayer5Permeability (double depth)
 Thermocline depth (in meters) and permeability (0..1).
virtual double thermoclineLayer5Permeability ()
 Thermocline depth (in meters) and permeability (0..1).

Static Public Member Functions

static void environmentProcessAddedCallback (DtReflectedEnvironmentProcess *obj, void *userData)
 Registered by onInit, calls processEnvironmentProcessAdded.
static void environmentProcessRemovedCallback (DtReflectedEnvironmentProcess *obj, void *userData)
 Registered by onInit, calls processEnvironmentProcessRemoved.

Protected Member Functions

bool updateVrfEnvironmentalWeatherStateRecord ()
 Called by all the weather accessors to update myVrfEnvironmentalWeatherStateRecord from DtEnvironmentProcessRepository.
virtual void processUpdatedCallback (DtReflectedEnvironmentProcess *e)

Static Protected Member Functions

static void environmentProcessUpdatedCallback (DtReflectedEnvironmentProcess *e, void *usr)
 Update internal data structures.

Protected Attributes

DtReflectedEnvironmentProcessList * myReflectedEnvironmentProcessList
DtVrfMessageInterfacemyMsgIf
DtEnvironmentProcessRepository * myReflectedWeatherSR
DtVrfEnvironmentalWeatherStateRecord * myVrfEnvironmentalWeatherStateRecord

Detailed Description

DtRemoteEnvironmentController allows the user to interrogate the back-end which is simulating the environmental weather object to get the current weather state.

Sim commands can also be sent to change the weather state. If there is no weather state available, the accessors will all provide reasonable default values which represent a clear, windless and sunny environment state. The user can check to see if the back-end's weather values are being reflected by calling reflectingCurrentWeatherState().

Constructor & Destructor Documentation

DtRemoteEnvironmentController::DtRemoteEnvironmentController ( )

Constructor.

Member Function Documentation

virtual void DtRemoteEnvironmentController::init ( DtVrfMessageInterface msgIf,
DtReflectedEnvironmentProcessList *  rel 
)
virtual

Caches the given pointers as myMsgIf and myReflectedEnvironmentProcessList.

Registers environmentProcessAddedCallback and environmentProcessRemovedCallback with the DtReflectedEnvironmentProcessList. In order to check to see if the environment object has already been reflected, the environment list is walked and each reflected object is passed to processEnvironmentProcessAdded.

bool DtRemoteEnvironmentController::reflectingCurrentWeatherState ( )

Indicates if the weather state of the back-end simulating the weather has been reflected.

Unless this returns true, none of the accessors will return real data!

virtual void DtRemoteEnvironmentController::setAirTurbidity ( double  value)
virtual

Air Turbidity.

virtual double DtRemoteEnvironmentController::airTurbidity ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setAmbientAirTemperature ( double  value)
virtual

Ambient Air Temperature.

virtual double DtRemoteEnvironmentController::ambientAirTemperature ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setCloudState ( DtVrfWeatherCloudState  )
virtual

Cloud State.

virtual DtVrfWeatherCloudState DtRemoteEnvironmentController::cloudState ( )
virtual

If !reflectingCurrentWeatherState(), the default is DtVrfWeatherCloudStateClear.

virtual void DtRemoteEnvironmentController::setPrecipitationIntensity ( double  value)
virtual

Precipitation Intensity.

virtual double DtRemoteEnvironmentController::precipitationIntensity ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setPrecipitationType ( DtVrfWeatherPrecipitationType  )
virtual

Precipitation Intensity.

virtual DtVrfWeatherPrecipitationType DtRemoteEnvironmentController::precipitationType ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setWindSpeed ( double  value)
virtual

Wind speed in m/s.

virtual double DtRemoteEnvironmentController::windSpeed ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setWindDirection ( double  value)
virtual

Wind direction in radians.

virtual double DtRemoteEnvironmentController::windDirection ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0.0.

virtual void DtRemoteEnvironmentController::setVisibility ( double  value)
virtual

Visibility in meters.

virtual double DtRemoteEnvironmentController::visibility ( )
virtual

If !reflectingCurrentWeatherState(), the default is 16,000 (16km)

virtual double DtRemoteEnvironmentController::illumination ( )
virtual

Illumination in percentage (0 to 1.0).

Illumination cannot be set directly. It is a function of time of day. If !reflectingCurrentWeatherState() is default is 1.0 (100% illumination)

virtual void DtRemoteEnvironmentController::setTimeOfDay ( double  secondsPastMidnight)
virtual

The current time of day, specified by the number of seconds passed midnight.

virtual double DtRemoteEnvironmentController::timeOfDay ( )
virtual

If !reflectingCurrentWeatherState(), the default is 43200 (12:00 noon)

virtual void DtRemoteEnvironmentController::setTimeOfDayAdvancementSpeed ( double  speed)
virtual

The current time of day advancement speed.

virtual double DtRemoteEnvironmentController::timeOfDayAdvancementSpeed ( )
virtual

If !reflectingCurrentWeatherState(), the default is 0 (no advance)

virtual void DtRemoteEnvironmentController::setUnderwaterVisibility ( double  underwaterVisibility)
virtual

Underwater visibility in meters.

virtual double DtRemoteEnvironmentController::underwaterVisibility ( )
virtual

Underwater visibility in meters.

virtual void DtRemoteEnvironmentController::setSurfaceTransparency ( double  transparency)
virtual

Surface transparency (percentage)

virtual double DtRemoteEnvironmentController::surfaceTransparency ( )
virtual

Surface transparency (percentage)

virtual void DtRemoteEnvironmentController::setWaterCurrentSpeed ( double  waterCurrentSpeed)
virtual

Water velocity in meters per second.

virtual double DtRemoteEnvironmentController::waterCurrentSpeed ( )
virtual

Water velocity in meters per second.

virtual void DtRemoteEnvironmentController::setWaterCurrentDirection ( double  waterCurrentDirection)
virtual

Water direction in radians clockwise from 0 (north)

virtual double DtRemoteEnvironmentController::waterCurrentDirection ( )
virtual

Water direction in radians clockwise from 0 (north)

virtual void DtRemoteEnvironmentController::setAmbientWaterTemperature ( double  waterTemperature)
virtual

Ambient water temperature in Celsius.

virtual double DtRemoteEnvironmentController::ambientWaterTemperature ( )
virtual

Ambient water temperature in Celsius.

virtual void DtRemoteEnvironmentController::setTidalOffset ( double  tidalOffset)
virtual

Tidal offset in meters from the water polygons in the database.

virtual double DtRemoteEnvironmentController::tidalOffset ( )
virtual

Tidal offset in meters from the water polygons in the database.

virtual void DtRemoteEnvironmentController::setTidalDirection ( bool  tidalDirection)
virtual

Tidal direction where true represents the tide going in and false represents the tide going out.

virtual bool DtRemoteEnvironmentController::tidalDirection ( )
virtual

Tidal direction where true represents the tide going in and false represents the tide going out.

virtual void DtRemoteEnvironmentController::setSwellState ( unsigned int  state)
virtual

Swell state according to the Douglas Sea Scale (integer 0 - 9)

virtual unsigned int DtRemoteEnvironmentController::swellState ( )
virtual

Swell state according to the Douglas Sea Scale (integer 0 - 9)

virtual void DtRemoteEnvironmentController::setSwellStateDirection ( double  direction)
virtual

Swell direction in in radians clockwise from 0 (north)

virtual double DtRemoteEnvironmentController::swellStateDirection ( )
virtual

Swell direction in in radians clockwise from 0 (north)

virtual void DtRemoteEnvironmentController::setSeaState ( unsigned int  douglasScale)
virtual

Sea state according to the Douglas Sea Scale.

virtual unsigned int DtRemoteEnvironmentController::seaState ( )
virtual

Sea state according to the Douglas Sea Scale.

virtual void DtRemoteEnvironmentController::setSeaStateDirection ( double  radiansFromNorth)
virtual

The direction waves travel from in radians from North.

virtual double DtRemoteEnvironmentController::seaStateDirection ( )
virtual

The direction waves travel from in radians from North.

void DtRemoteEnvironmentController::setWindDrivenSeaStateEnabled ( bool  enabled)

Flag for enabling sea-state to be driven by wind.

bool DtRemoteEnvironmentController::windDrivenSeaStateEnabled ( )

Flag for enabling sea-state to be driven by wind.

virtual void DtRemoteEnvironmentController::setChoppiness ( double  choppiness)
virtual

Wave choppiness (0..1)

virtual double DtRemoteEnvironmentController::choppiness ( )
virtual

Wave choppiness (0..1)

virtual void DtRemoteEnvironmentController::setSurgeDepth ( double  depth)
virtual

Surge depth (meters)

virtual double DtRemoteEnvironmentController::surgeDepth ( )
virtual

Surge depth (meters)

virtual void DtRemoteEnvironmentController::setThermoclineLayer1Depth ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer1Depth ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer1Permeability ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer1Permeability ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer2Depth ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer2Depth ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer2Permeability ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer2Permeability ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer3Depth ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer3Depth ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer3Permeability ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer3Permeability ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer4Depth ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer4Depth ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer4Permeability ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer4Permeability ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer5Depth ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer5Depth ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual void DtRemoteEnvironmentController::setThermoclineLayer5Permeability ( double  depth)
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

virtual double DtRemoteEnvironmentController::thermoclineLayer5Permeability ( )
virtual

Thermocline depth (in meters) and permeability (0..1).

A depth of zero means that layer is not used.

static void DtRemoteEnvironmentController::environmentProcessAddedCallback ( DtReflectedEnvironmentProcess *  obj,
void *  userData 
)
static

Registered by onInit, calls processEnvironmentProcessAdded.

virtual void DtRemoteEnvironmentController::processEnvironmentProcessAdded ( DtReflectedEnvironmentProcess *  obj)
virtual

Checks to see if the first recordPointer in the state repository of the DtReflectedEnvironmentProcess is of type DtEnvVrfWeatherStateRecordType, and if so it caches a pointer to the SR in myReflectedWeatherSR.

static void DtRemoteEnvironmentController::environmentProcessRemovedCallback ( DtReflectedEnvironmentProcess *  obj,
void *  userData 
)
static

Registered by onInit, calls processEnvironmentProcessRemoved.

virtual void DtRemoteEnvironmentController::processEnvironmentProcessRemoved ( DtReflectedEnvironmentProcess *  obj)
virtual

Checks to see if the DtReflectedEnvironmentProcess being removed corresponds to the one cached in myReflectedWeatherSR, and if so myReflectedWeatherSR is set to 0.

bool DtRemoteEnvironmentController::updateVrfEnvironmentalWeatherStateRecord ( )
protected

Called by all the weather accessors to update myVrfEnvironmentalWeatherStateRecord from DtEnvironmentProcessRepository.

static void DtRemoteEnvironmentController::environmentProcessUpdatedCallback ( DtReflectedEnvironmentProcess *  e,
void *  usr 
)
staticprotected

Update internal data structures.

virtual void DtRemoteEnvironmentController::processUpdatedCallback ( DtReflectedEnvironmentProcess *  e)
protectedvirtual

Member Data Documentation

DtReflectedEnvironmentProcessList* DtRemoteEnvironmentController::myReflectedEnvironmentProcessList
protected
DtVrfMessageInterface* DtRemoteEnvironmentController::myMsgIf
protected
DtEnvironmentProcessRepository* DtRemoteEnvironmentController::myReflectedWeatherSR
protected
DtVrfEnvironmentalWeatherStateRecord* DtRemoteEnvironmentController::myVrfEnvironmentalWeatherStateRecord
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)