From f67fed9e09dd82ab510d2b1ff9b1b389cf5b876d Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Sun, 10 Jul 2022 21:38:44 +0800 Subject: [PATCH] change cfl algorithm --- TinyEurocat/TinyEurocat.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/TinyEurocat/TinyEurocat.cpp b/TinyEurocat/TinyEurocat.cpp index fcbc812..0dd680a 100644 --- a/TinyEurocat/TinyEurocat.cpp +++ b/TinyEurocat/TinyEurocat.cpp @@ -29,11 +29,10 @@ void TinyEurocat::OnGetTagItem( CFlightPlan FlightPlan, { char tmpstr[15]; case TAG_ITEM_MET_ASS_ALT: - maalt = FlightPlan.GetClearedAltitude() * 0.3048; - maalt /= 100; - if (maalt > 0 && maalt != int(FlightPlan.GetFinalAltitude() * 0.3048) / 100 && maalt <= 149) + maalt = FlightPlan.GetClearedAltitude() * 0.3048 / 10; + if (maalt > 0) { - itoa(maalt * 10, tmpstr, 10); + itoa(maalt, tmpstr, 10); sprintf(sItemString, "%04s", tmpstr); } else @@ -42,8 +41,7 @@ void TinyEurocat::OnGetTagItem( CFlightPlan FlightPlan, } break; case TAG_ITEM_MET_CURR_ALT: - mcalt = RadarTarget.GetPosition().GetPressureAltitude() * 0.3048; - mcalt /= 10; + mcalt = RadarTarget.GetPosition().GetPressureAltitude() * 0.3048 / 10; itoa(mcalt, tmpstr, 10); sprintf(sItemString, "%04s", tmpstr); break;