Updated parameterization in Weather module.

This commit is contained in:
Michael Braun 2015-08-04 02:11:24 +02:00
parent 275b0c4300
commit b1f9e17ab0
12 changed files with 28 additions and 28 deletions

View File

@ -9,14 +9,14 @@
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER> * 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
* *
* Return Value: * Return Value:
* 0: density of air - kg * m^(-3) <NUMBER> * density of air - kg * m^(-3) <NUMBER>
* *
* Return value: * Return value:
* None * None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_temperature,_pressure,_relativeHumidity); params ["_temperature", "_pressure", "_relativeHumidity"];
_pressure = _pressure * 100; // hPa to Pa _pressure = _pressure * 100; // hPa to Pa

View File

@ -4,10 +4,10 @@
* Calculates the barometric pressure based on altitude and weather * Calculates the barometric pressure based on altitude and weather
* *
* Arguments: * Arguments:
* 0: altitude - meters <NUMBER> * altitude - meters <NUMBER>
* *
* Return Value: * Return Value:
* 0: barometric pressure - hPA <NUMBER> * barometric pressure - hPA <NUMBER>
* *
* Return value: * Return value:
* None * None

View File

@ -8,7 +8,7 @@
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER> * 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
* *
* Return Value: * Return Value:
* 0: dew point <NUMBER> * dew point <NUMBER>
* *
* Return value: * Return value:
* None * None
@ -18,7 +18,7 @@
#define __b 17.67 #define __b 17.67
#define __c 243.5 #define __c 243.5
PARAMS_2(_t,_rh); params ["_t", "_rh"];
if (_rh == 0) exitWith { CELSIUS(0) }; if (_rh == 0) exitWith { CELSIUS(0) };

View File

@ -5,10 +5,10 @@
* *
* Arguments: * Arguments:
* 0: temperature - degrees celcius <NUMBER> * 0: temperature - degrees celcius <NUMBER>
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER> * 1: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
* *
* Return Value: * Return Value:
* 0: heat index <NUMBER> * heat index <NUMBER>
* *
* Return value: * Return value:
* None * None
@ -24,7 +24,7 @@
#define __C7 0.000687678 #define __C7 0.000687678
#define __C8 0.000274954 #define __C8 0.000274954
PARAMS_2(_t,_rh); params ["_t", "_rh"];
// Source: https://en.wikipedia.org/wiki/Heat_index // Source: https://en.wikipedia.org/wiki/Heat_index

View File

@ -4,10 +4,10 @@
* Calculates the terrain roughness length at a given world position * Calculates the terrain roughness length at a given world position
* *
* Arguments: * Arguments:
* 0: _this - world position <posASL> * world position <posASL>
* *
* Return Value: * Return Value:
* 0: roughness length <NUMBER> * roughness length <NUMBER>
* *
* Public: No * Public: No
*/ */

View File

@ -4,10 +4,10 @@
* Calculates the temperature based on altitude and weather * Calculates the temperature based on altitude and weather
* *
* Arguments: * Arguments:
* 0: height - meters <NUMBER> * height - meters <NUMBER>
* *
* Return Value: * Return Value:
* 0: temperature - degrees celsius <NUMBER> * temperature - degrees celsius <NUMBER>
* *
* Return value: * Return value:
* None * None

View File

@ -9,7 +9,7 @@
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER> * 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
* *
* Return Value: * Return Value:
* 0: wet bulb <NUMBER> * wet bulb <NUMBER>
* *
* Return value: * Return value:
* None * None
@ -18,7 +18,7 @@
private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"]; private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"];
PARAMS_3(_temperature,_pressure,_relativeHumidity); params ["_temperature", "_pressure", "_relativeHumidity"];
// Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb // Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb
_es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5)); _es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5));

View File

@ -5,16 +5,16 @@
* *
* Arguments: * Arguments:
* 0: temperature - degrees celcius <NUMBER> * 0: temperature - degrees celcius <NUMBER>
* 2: wind speed - m/s <NUMBER> * 1: wind speed - m/s <NUMBER>
* *
* Return Value: * Return Value:
* 0: wind chill <NUMBER> * wind chill <NUMBER>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_t,_v); params ["_t", "_v"];
// Source: https://en.wikipedia.org/wiki/Wind_chill // Source: https://en.wikipedia.org/wiki/Wind_chill

View File

@ -10,7 +10,7 @@
* 3: Account for obstacles <BOOL> * 3: Account for obstacles <BOOL>
* *
* Return Value: * Return Value:
* 0: wind speed - m/s <NUMBER> * wind speed - m/s <NUMBER>
* *
* Public: No * Public: No
*/ */
@ -18,7 +18,7 @@
private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"];
PARAMS_4(_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled); params ["_position", "_windGradientEnabled", "_terrainEffectEnabled", "_obstacleEffectEnabled"];
fnc_polar2vect = { fnc_polar2vect = {
private ["_mag2D"]; private ["_mag2D"];

View File

@ -11,11 +11,12 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_periodPercent", "_periodPosition"];
if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] };
EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period); ACE_WIND_PARAMS params ["_dir", "_dirChange", "_spd", "_spdChange", "_period"];
private ["_periodPercent", "_periodPosition"];
_periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period; _periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period;
_periodPercent = _periodPosition / _period; _periodPercent = _periodPosition / _period;

View File

@ -16,9 +16,8 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_logic", "_units", "_activated"]; private ["_logic", "_units", "_activated"];
_logic = _this select 0;
_units = _this select 1; params ["_logic", "_units", "_activated"];
_activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
@ -36,4 +35,4 @@ if !(_activated) exitWith {};
// Server weather update interval // Server weather update interval
[_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule);
GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600;

View File

@ -14,8 +14,8 @@
if (!GVAR(syncRain)) exitWith {}; if (!GVAR(syncRain)) exitWith {};
if (!isNil "ACE_RAIN_PARAMS") then { if (!isNil "ACE_RAIN_PARAMS") then {
EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period); ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"];
private ["_periodPosition", "_periodPercent"]; private ["_periodPosition", "_periodPercent"];
_periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period; _periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period;
_periodPercent = (_periodPosition / _period) min 1; _periodPercent = (_periodPosition / _period) min 1;