mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
And don't forget Fahrenheit
This commit is contained in:
parent
48f9d808cf
commit
42c6b8a016
@ -912,7 +912,7 @@ do -- COORDINATE
|
|||||||
-- The text will reflect the temperature like this:
|
-- The text will reflect the temperature like this:
|
||||||
--
|
--
|
||||||
-- - For Russian and European aircraft using the metric system - Degrees Celcius (°C)
|
-- - For Russian and European aircraft using the metric system - Degrees Celcius (°C)
|
||||||
-- - For American aircraft we link to the imperial system - Degrees Farenheit (°F)
|
-- - For American aircraft we link to the imperial system - Degrees Fahrenheit (°F)
|
||||||
--
|
--
|
||||||
-- A text containing a pressure will look like this:
|
-- A text containing a pressure will look like this:
|
||||||
--
|
--
|
||||||
@ -932,7 +932,7 @@ do -- COORDINATE
|
|||||||
if Settings:IsMetric() then
|
if Settings:IsMetric() then
|
||||||
return string.format( " %-2.2f °C", DegreesCelcius )
|
return string.format( " %-2.2f °C", DegreesCelcius )
|
||||||
else
|
else
|
||||||
return string.format( " %-2.2f °F", UTILS.CelsiusToFarenheit( DegreesCelcius ) )
|
return string.format( " %-2.2f °F", UTILS.CelsiusToFahrenheit( DegreesCelcius ) )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return " no temperature"
|
return " no temperature"
|
||||||
|
|||||||
@ -742,7 +742,7 @@ function PSEUDOATC:ReportWeather(GID, UID, position, location)
|
|||||||
local T=position:GetTemperature()
|
local T=position:GetTemperature()
|
||||||
|
|
||||||
-- Correct unit system.
|
-- Correct unit system.
|
||||||
local _T=string.format('%d°F', UTILS.CelsiusToFarenheit(T))
|
local _T=string.format('%d°F', UTILS.CelsiusToFahrenheit(T))
|
||||||
if settings:IsMetric() then
|
if settings:IsMetric() then
|
||||||
_T=string.format('%d°C', T)
|
_T=string.format('%d°C', T)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2762,7 +2762,7 @@ function RANGE:_DisplayRangeWeather(_unitname)
|
|||||||
local tW=string.format("%.1f m/s", Ws)
|
local tW=string.format("%.1f m/s", Ws)
|
||||||
local tP=string.format("%.1f mmHg", P*hPa2mmHg)
|
local tP=string.format("%.1f mmHg", P*hPa2mmHg)
|
||||||
if settings:IsImperial() then
|
if settings:IsImperial() then
|
||||||
--tT=string.format("%d°F", UTILS.CelsiusToFarenheit(T))
|
--tT=string.format("%d°F", UTILS.CelsiusToFahrenheit(T))
|
||||||
tW=string.format("%.1f knots", UTILS.MpsToKnots(Ws))
|
tW=string.format("%.1f knots", UTILS.MpsToKnots(Ws))
|
||||||
tP=string.format("%.2f inHg", P*hPa2inHg)
|
tP=string.format("%.2f inHg", P*hPa2inHg)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1459,8 +1459,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
|
|
||||||
-- Convert to °F.
|
-- Convert to °F.
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
temperature=UTILS.CelsiusToFarenheit(temperature)
|
temperature=UTILS.CelsiusToFahrenheit(temperature)
|
||||||
dewpoint=UTILS.CelsiusToFarenheit(dewpoint)
|
dewpoint=UTILS.CelsiusToFahrenheit(dewpoint)
|
||||||
end
|
end
|
||||||
|
|
||||||
local TEMPERATURE=string.format("%d", math.abs(temperature))
|
local TEMPERATURE=string.format("%d", math.abs(temperature))
|
||||||
|
|||||||
@ -473,10 +473,10 @@ UTILS.KnotsToMps = function( knots )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Convert temperature from Celsius to Farenheit.
|
--- Convert temperature from Celsius to Fahrenheit.
|
||||||
-- @param #number Celcius Temperature in degrees Celsius.
|
-- @param #number Celcius Temperature in degrees Celsius.
|
||||||
-- @return #number Temperature in degrees Farenheit.
|
-- @return #number Temperature in degrees Fahrenheit.
|
||||||
UTILS.CelsiusToFarenheit = function( Celcius )
|
UTILS.CelsiusToFahrenheit = function( Celcius )
|
||||||
return Celcius * 9/5 + 32
|
return Celcius * 9/5 + 32
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user