From 7f966de28c03783d81476d4e2ddc725274dfb864 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 15 May 2015 21:10:46 +0200 Subject: [PATCH] Added wet bulb calculation, fixed macros --- addons/weather/XEH_preInit.sqf | 1 + .../functions/fnc_calculateAirDensity.sqf | 2 +- .../functions/fnc_calculateDewPoint.sqf | 4 ++-- .../functions/fnc_calculateHeatIndex.sqf | 2 +- .../functions/fnc_calculateWetBulb.sqf | 19 +++++++++++++++++++ .../functions/fnc_calculateWindChill.sqf | 2 +- 6 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 addons/weather/functions/fnc_calculateWetBulb.sqf diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index a6fec1e77e..2a6487f51c 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP(calculateDewPoint); PREP(calculateHeatIndex); PREP(calculateRoughnessLength); PREP(calculateTemperatureAtHeight); +PREP(calculateWetBulb); PREP(calculateWindChill); PREP(calculateWindSpeed); PREP(displayWindInfo); diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index b30e0c4e01..921bff3bf3 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_3(_temperature, _pressure, _relativeHumidity); +PARAMS_3(_temperature,_pressure,_relativeHumidity); _pressure = _pressure * 100; // hPa to Pa diff --git a/addons/weather/functions/fnc_calculateDewPoint.sqf b/addons/weather/functions/fnc_calculateDewPoint.sqf index 81d4c03a7c..750b384ea0 100644 --- a/addons/weather/functions/fnc_calculateDewPoint.sqf +++ b/addons/weather/functions/fnc_calculateDewPoint.sqf @@ -8,7 +8,7 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: heat index + * 0: dew point * * Return value: * None @@ -18,7 +18,7 @@ #define __b 17.67 #define __c 243.5 -PARAMS_2(_t, _rh); +PARAMS_2(_t,_rh); // Source: https://en.wikipedia.org/wiki/Dew_point private ["_gamma"]; diff --git a/addons/weather/functions/fnc_calculateHeatIndex.sqf b/addons/weather/functions/fnc_calculateHeatIndex.sqf index 8b54f4e6a0..4605213e24 100644 --- a/addons/weather/functions/fnc_calculateHeatIndex.sqf +++ b/addons/weather/functions/fnc_calculateHeatIndex.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_2(_t, _rh); +PARAMS_2(_t,_rh); _rh = _rh * 100; // relative humidity in % diff --git a/addons/weather/functions/fnc_calculateWetBulb.sqf b/addons/weather/functions/fnc_calculateWetBulb.sqf new file mode 100644 index 0000000000..c044c2ed57 --- /dev/null +++ b/addons/weather/functions/fnc_calculateWetBulb.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * + * Calculates wet bulb based on temperature and relative humidity + * + * Arguments: + * + * + * Return Value: + * 0: wet bulb + * + * Return value: + * None + */ +#include "script_component.hpp" + +// TODO: ... + +GVAR(currentTemperature) diff --git a/addons/weather/functions/fnc_calculateWindChill.sqf b/addons/weather/functions/fnc_calculateWindChill.sqf index 0eb63e9701..04e26013d7 100644 --- a/addons/weather/functions/fnc_calculateWindChill.sqf +++ b/addons/weather/functions/fnc_calculateWindChill.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -PARAMS_2(_t, _v); +PARAMS_2(_t,_v); _v = _v * 3,6; // wind speed in km/h