Engines
WeatherUtils Namespace Reference
Enumerations | |
enum | Unit { NoUnit = 0, Celsius, Fahrenheit, Kelvin, KilometersAnHour, MetersPerSecond, MilesAnHour, Kilopascals, InchesHG, Millibars, Hectopascals, Centimeters, Millimeters, Inches, Knots, Beaufort, Kilometers, Miles } |
Functions | |
float | convert (float value, int srcUnit, int destUnit) |
QString | degreesToCardinal (float degrees) |
QString | getUnitString (int unit, bool plain=false) |
int | kilometersToBeaufort (float km) |
int | knotsToBeaufort (float knots) |
int | metersPerSecondToBeaufort (float ms) |
int | milesToBeaufort (float miles) |
Enumeration Type Documentation
enum WeatherUtils::Unit |
- Enumerator:
-
NoUnit Celsius Fahrenheit Kelvin KilometersAnHour MetersPerSecond MilesAnHour Kilopascals InchesHG Millibars Hectopascals Centimeters Millimeters Inches Knots Beaufort Kilometers Miles
Definition at line 32 of file weatherutils.h.
Function Documentation
ION_EXPORT float WeatherUtils::convert | ( | float | value, | |
int | srcUnit, | |||
int | destUnit | |||
) |
Convert from unit to another.
See WeatherUtils::Unit for available units.
- Parameters:
-
value float to convert srcUnit from which unit to convert destUnit to which unit to convert
- Returns:
- converted value
Definition at line 29 of file weatherutils.cpp.
ION_EXPORT QString WeatherUtils::degreesToCardinal | ( | float | degrees | ) |
Converts wind/sun direction given in degrees to the nearest cardinal direction.
- Parameters:
-
degrees wind direction in degrees.
- Returns:
- a cardinal if available, empty string on error.
Definition at line 269 of file weatherutils.cpp.
ION_EXPORT QString WeatherUtils::getUnitString | ( | int | unit, | |
bool | plain = false | |||
) |
Returns a string presentation of of WeatherUtils::Unit.
Set plain to true in case you don't want a localized version of it.
- Parameters:
-
unit unit to convert. plain if true, returned string is not localized. defaults to false.
- Returns:
- a string presentation of WeatherUtils::Unit. Empty string if called for invalid unit.
Definition at line 159 of file weatherutils.cpp.
int WeatherUtils::kilometersToBeaufort | ( | float | km | ) |
Definition at line 348 of file weatherutils.cpp.
int WeatherUtils::knotsToBeaufort | ( | float | knots | ) |
int WeatherUtils::metersPerSecondToBeaufort | ( | float | ms | ) |
Definition at line 353 of file weatherutils.cpp.
int WeatherUtils::milesToBeaufort | ( | float | miles | ) |
Definition at line 343 of file weatherutils.cpp.