From 5a2779c698042a498965463f03c6f79710544bd5 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 24 Apr 2020 16:42:07 +0200 Subject: [PATCH] Update ATIS.lua --- Moose Development/Moose/Ops/ATIS.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 0c34562c6..db2fa22a9 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -531,7 +531,7 @@ _ATIS={} --- ATIS class version. -- @field #string version -ATIS.version="0.7.0" +ATIS.version="0.7.1" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1230,13 +1230,22 @@ function ATIS:onafterBroadcast(From, Event, To) if self.windtrue then magvar=0 end + windFrom=windFrom-magvar + + -- Correct negative values. + if windFrom<0 then + windFrom=windFrom+360 + end - local WINDFROM=string.format("%03d", windFrom-magvar) + local WINDFROM=string.format("%03d", windFrom) local WINDSPEED=string.format("%d", UTILS.MpsToKnots(windSpeed)) - + + -- Report North as 0. if WINDFROM=="000" then WINDFROM="360" end + + env.info(string.format("FF WINDFROM = %s", tostring(WINDFROM))) if self.metric then WINDSPEED=string.format("%d", windSpeed)