Fixed a bug in the atmosphere unit conversion

This commit is contained in:
ulteq 2015-04-19 11:02:06 +02:00
parent 336a192302
commit 8f20303a08
3 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@ GVAR(altitude) = -1000 max parseNumber(ctrlText 130030) min 20000;
GVAR(temperature) = -50 max parseNumber(ctrlText 130040) min 160;
GVAR(barometricPressure) = 0 max parseNumber(ctrlText 130050) min 1350;
GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 130060) min 100) / 100;
if (GVAR(currentUnit) == 1) then {
if (GVAR(currentUnit) != 2) then {
GVAR(altitude) = GVAR(altitude) * 0.3048;
GVAR(temperature) = (GVAR(temperature) - 32) / 1.8;
GVAR(barometricPressure) = GVAR(barometricPressure) * 33.86389;

View File

@ -17,18 +17,18 @@
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13007);
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)];
} else {
ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)];
};
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [130050, Str(Round(GVAR(barometricPressure)))];
} else {
ctrlSetText [130050, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)];
};
ctrlSetText [130060, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)];
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [130030, Str(Round(GVAR(altitude)))];
} else {
ctrlSetText [130030, Str(Round(GVAR(altitude) * 3.2808399))];

View File

@ -15,18 +15,18 @@
*/
#include "script_component.hpp"
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)];
} else {
ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)];
};
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [210, Str(Round(GVAR(barometricPressure)))];
} else {
ctrlSetText [210, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)];
};
ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)];
if (GVAR(currentUnit) != 1) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [230, Str(Round(GVAR(altitude)))];
} else {
ctrlSetText [230, Str(Round(GVAR(altitude) * 3.2808399))];