VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
makVrf::DtTimeZoneManager Class Reference

The timezone manager keeps track of all timezones available for the user to select from in the system. More...

Inheritance diagram for makVrf::DtTimeZoneManager:
Inheritance graph
[legend]

Classes

struct  IlluminationIconData
struct  TimezoneData

Public Types

typedef std::map< std::string,
TimezoneData
Timezones
 Key is abbreviation.
typedef std::map< int,
std::vector
< IlluminationIconData > > 
IlluminationIcon
typedef std::vector< std::string > DateTimeFormats

Public Member Functions

 DtTimeZoneManager (makVrv::DtDe &)
 CTOR.
virtual ~DtTimeZoneManager ()
 DTOR.
virtual const Timezonestimezones () const
virtual void addTimezone (const std::string &abbrev, const std::string &title, double offset, const std::string &location)
 Adds a new timezone into the system.
virtual void removeTimezone (const std::string &abbrev)
 Removes the current timezone by abbreviation.
virtual void setUseLocalTimezone (bool)
 Use local timezone for timezone, irregardless of what the current timezone is set to be.
virtual bool useLocalTimezone () const
virtual void setDateAndTimeOfDayFormat (const std::string &)
 Sets the format for displaying the date/time of day as specified in Qt documentation.
virtual std::string dateAndTimeOfDayFormat () const
virtual time_t offsetForTimezone (const std::string &abbrev) const
 Returns offset for the current timezone.
virtual time_t modifyTimeBasedOnTimezoneSelection (time_t)
 Returns time based from utc time on current timezone selected as defined in the application settings.
virtual void setCurrentTimezone (const std::string &)
 Sets the current timezone by abbreviation and sends out signal for the timezone change.
virtual std::string currentTimezone () const
 Returns current timezone. Blank timezone means local timezone.
virtual std::string timezoneTitle () const
 Returns the title of the currently selected timezone.
virtual time_t offsetForTimezone () const
 Returns the offset for the currently selected timezone.
virtual time_t convertFromLocalTimeToUtcTime (time_t) const
 Converts from local timezone time to utc time.
virtual time_t currentUtcDateTime () const
 Return current simulation date/time as a UTC time.
virtual time_t currentLocalDateTime () const
 Return current simulation date/time in local timezone representation.
virtual time_t convertFromUtcTimeToLocalTime (time_t) const
 Converts from utc time to local timezone.
virtual void convertFromUtcTimeToLocalTime (int y, int m, int d, int h, int mm, int sec, int &year, int &month, int &day, int &hours, int &minutes, int &seconds) const
virtual time_t convert (const std::string &source, time_t, const std::string &dest)
 Converts from supplied timezone to new local timezone given a time in the supplied timezone time.
virtual void load (const DtFilename &, bool merge=false)
 Loads the timezone file, clearing any existing timezones first if the merge flag is false.
virtual std::string dateTimeFormatString (time_t)
 Returns a string formatted with asctime for the current utc value offset to the local timezone.
virtual double illuminationValue (const DtGeodeticCoord &position, time_t time, double nighttimeMaximum=0.1, double illuminationMinimum=0.001, bool useGMTPosition=false, int *sunstate=0) const
 Give a geodetic coordinate and a UTC time, return an illumination value (0 - 1) at that position based on sun/moon position.
virtual double maximumNighttimeValue () const
 Get/set the maximum nighttime value. Default is .2.
virtual void setMaximumNighttimeValue (double)
virtual double minimumIlluminationValue ()
 Get/set the minimal value that the illumination can be. Default is .1.
virtual void setMinimumIlluminationValue (double)
virtual std::string illuminationIcon (double illumination, int sunState) const
 Returns the illumination icon given the sunstate and the illumination value.
virtual void addIlluminationIcon (int sunState, double lowIllumination, double highIllumination, const std::string &)
 Adds a new illumination icon for the given state and the given range of illumination values.
const IlluminationIconilluminationIcons () const
IlluminationIconilluminationIcons ()
virtual const DateTimeFormatsdateTimeFormats () const
virtual DateTimeFormatsdateTimeFormats ()
virtual void addDateTimeFormat (const std::string &)
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtTimeZoneManagerinstance (makVrv::DtDe &de)
 Returns instance of the manager.
static void registerInstance (makVrv::DtDe &, DtTimeZoneManager *)
 Register a new manager instance.

Public Attributes

boost::signal< void(std::string,
std::string)> 
signal_timezoneChanged
 Signal of old and new timezone.
boost::signal< void(std::string)> signal_dateAndTimeFormatChanged

Protected Attributes

Timezones myTimezones
makVrv::DtDemyDe
double myNighttimeMaximumValue
double myMinimumIlluminationValue
IlluminationIcon myIlluminationIcons
DateTimeFormats myDateTimeFormats

Detailed Description

The timezone manager keeps track of all timezones available for the user to select from in the system.

It will also modify UTC timezones for the currently selected timezone. The default timezone file loaded is from the settings directory, timezones.csv

Member Typedef Documentation

typedef std::map<std::string, TimezoneData> makVrf::DtTimeZoneManager::Timezones

Key is abbreviation.

typedef std::vector<std::string> makVrf::DtTimeZoneManager::DateTimeFormats

Constructor & Destructor Documentation

makVrf::DtTimeZoneManager::DtTimeZoneManager ( makVrv::DtDe )

CTOR.

virtual makVrf::DtTimeZoneManager::~DtTimeZoneManager ( )
virtual

DTOR.

Member Function Documentation

static DtTimeZoneManager& makVrf::DtTimeZoneManager::instance ( makVrv::DtDe de)
static

Returns instance of the manager.

static void makVrf::DtTimeZoneManager::registerInstance ( makVrv::DtDe ,
DtTimeZoneManager  
)
static

Register a new manager instance.

virtual const Timezones& makVrf::DtTimeZoneManager::timezones ( ) const
virtual
virtual void makVrf::DtTimeZoneManager::addTimezone ( const std::string &  abbrev,
const std::string &  title,
double  offset,
const std::string &  location 
)
virtual

Adds a new timezone into the system.

virtual void makVrf::DtTimeZoneManager::removeTimezone ( const std::string &  abbrev)
virtual

Removes the current timezone by abbreviation.

virtual void makVrf::DtTimeZoneManager::setUseLocalTimezone ( bool  )
virtual

Use local timezone for timezone, irregardless of what the current timezone is set to be.

If set to false use the timezone that is set

virtual bool makVrf::DtTimeZoneManager::useLocalTimezone ( ) const
virtual
virtual void makVrf::DtTimeZoneManager::setDateAndTimeOfDayFormat ( const std::string &  )
virtual

Sets the format for displaying the date/time of day as specified in Qt documentation.

Default is: MM/dd/yyyy hh:mm Sends out signal when format has changed

virtual std::string makVrf::DtTimeZoneManager::dateAndTimeOfDayFormat ( ) const
virtual
virtual const DateTimeFormats& makVrf::DtTimeZoneManager::dateTimeFormats ( ) const
virtual

Date/time format information. To remove or change use the non-const member access to get direct access to the date/time format list

virtual DateTimeFormats& makVrf::DtTimeZoneManager::dateTimeFormats ( )
virtual

Date/time format information. To remove or change use the non-const member access to get direct access to the date/time format list

virtual void makVrf::DtTimeZoneManager::addDateTimeFormat ( const std::string &  )
virtual

Date/time format information. To remove or change use the non-const member access to get direct access to the date/time format list

virtual time_t makVrf::DtTimeZoneManager::offsetForTimezone ( const std::string &  abbrev) const
virtual

Returns offset for the current timezone.

virtual time_t makVrf::DtTimeZoneManager::modifyTimeBasedOnTimezoneSelection ( time_t  )
virtual

Returns time based from utc time on current timezone selected as defined in the application settings.

If no settings are specific assume local timezone

virtual void makVrf::DtTimeZoneManager::setCurrentTimezone ( const std::string &  )
virtual

Sets the current timezone by abbreviation and sends out signal for the timezone change.

virtual std::string makVrf::DtTimeZoneManager::currentTimezone ( ) const
virtual

Returns current timezone. Blank timezone means local timezone.

virtual std::string makVrf::DtTimeZoneManager::timezoneTitle ( ) const
virtual

Returns the title of the currently selected timezone.

virtual time_t makVrf::DtTimeZoneManager::offsetForTimezone ( ) const
virtual

Returns the offset for the currently selected timezone.

virtual time_t makVrf::DtTimeZoneManager::convertFromLocalTimeToUtcTime ( time_t  ) const
virtual

Converts from local timezone time to utc time.

virtual time_t makVrf::DtTimeZoneManager::currentUtcDateTime ( ) const
virtual

Return current simulation date/time as a UTC time.

virtual time_t makVrf::DtTimeZoneManager::currentLocalDateTime ( ) const
virtual

Return current simulation date/time in local timezone representation.

virtual time_t makVrf::DtTimeZoneManager::convertFromUtcTimeToLocalTime ( time_t  ) const
virtual

Converts from utc time to local timezone.

virtual void makVrf::DtTimeZoneManager::convertFromUtcTimeToLocalTime ( int  y,
int  m,
int  d,
int  h,
int  mm,
int  sec,
int year,
int month,
int day,
int hours,
int minutes,
int seconds 
) const
virtual
virtual time_t makVrf::DtTimeZoneManager::convert ( const std::string &  source,
time_t  ,
const std::string &  dest 
)
virtual

Converts from supplied timezone to new local timezone given a time in the supplied timezone time.

virtual void makVrf::DtTimeZoneManager::load ( const DtFilename &  ,
bool  merge = false 
)
virtual

Loads the timezone file, clearing any existing timezones first if the merge flag is false.

virtual std::string makVrf::DtTimeZoneManager::dateTimeFormatString ( time_t  )
virtual

Returns a string formatted with asctime for the current utc value offset to the local timezone.

virtual double makVrf::DtTimeZoneManager::illuminationValue ( const DtGeodeticCoord &  position,
time_t  time,
double  nighttimeMaximum = 0.1,
double  illuminationMinimum = 0.001,
bool  useGMTPosition = false,
int sunstate = 0 
) const
virtual

Give a geodetic coordinate and a UTC time, return an illumination value (0 - 1) at that position based on sun/moon position.

The nighttimeMaximum is the maximum illumination to the full moon. The minimum illumination is that of sunset and no moon (accounting for possible illumination due to stars).

If use GMT position is true then the illumination value returned will always be 1.0

If sunstate is defined, returns the following value: 0 - Sun is not visible 1 - Sun is fully visible 2 - Dawn 3 - Dusk

virtual double makVrf::DtTimeZoneManager::maximumNighttimeValue ( ) const
virtual

Get/set the maximum nighttime value. Default is .2.

virtual void makVrf::DtTimeZoneManager::setMaximumNighttimeValue ( double  )
virtual
virtual double makVrf::DtTimeZoneManager::minimumIlluminationValue ( )
virtual

Get/set the minimal value that the illumination can be. Default is .1.

virtual void makVrf::DtTimeZoneManager::setMinimumIlluminationValue ( double  )
virtual
virtual std::string makVrf::DtTimeZoneManager::illuminationIcon ( double  illumination,
int  sunState 
) const
virtual

Returns the illumination icon given the sunstate and the illumination value.

virtual void makVrf::DtTimeZoneManager::addIlluminationIcon ( int  sunState,
double  lowIllumination,
double  highIllumination,
const std::string &   
)
virtual

Adds a new illumination icon for the given state and the given range of illumination values.

const IlluminationIcon& makVrf::DtTimeZoneManager::illuminationIcons ( ) const
inline
IlluminationIcon& makVrf::DtTimeZoneManager::illuminationIcons ( )
inline

Member Data Documentation

boost::signal<void (std::string, std::string)> makVrf::DtTimeZoneManager::signal_timezoneChanged

Signal of old and new timezone.

boost::signal<void (std::string)> makVrf::DtTimeZoneManager::signal_dateAndTimeFormatChanged
Timezones makVrf::DtTimeZoneManager::myTimezones
protected
makVrv::DtDe& makVrf::DtTimeZoneManager::myDe
protected
double makVrf::DtTimeZoneManager::myNighttimeMaximumValue
protected
double makVrf::DtTimeZoneManager::myMinimumIlluminationValue
protected
IlluminationIcon makVrf::DtTimeZoneManager::myIlluminationIcons
protected
DateTimeFormats makVrf::DtTimeZoneManager::myDateTimeFormats
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)