fix cleared alt to adapt china rvsm
This commit is contained in:
parent
2554e22f66
commit
fe26cb8f24
@ -30,14 +30,23 @@ void TinyEurocat::OnGetTagItem( CFlightPlan FlightPlan,
|
|||||||
char tmpstr[15];
|
char tmpstr[15];
|
||||||
case TAG_ITEM_MET_ASS_ALT:
|
case TAG_ITEM_MET_ASS_ALT:
|
||||||
maalt = FlightPlan.GetClearedAltitude() * 0.3048;
|
maalt = FlightPlan.GetClearedAltitude() * 0.3048;
|
||||||
if (maalt != 0)
|
if (maalt > 0)
|
||||||
{
|
{
|
||||||
maalt /= 100;
|
maalt /= 100;
|
||||||
if (maalt % 3 == 1)
|
if (maalt <= 84)
|
||||||
maalt -= 1;
|
{
|
||||||
else if (maalt % 3 == 2)
|
if (maalt % 3 == 1)
|
||||||
maalt += 1;
|
maalt -= 1;
|
||||||
|
else if (maalt % 3 == 2)
|
||||||
|
maalt += 1;
|
||||||
|
}
|
||||||
|
else if (maalt <= 125)
|
||||||
|
{
|
||||||
|
if ((maalt + 1) % 3 == 1)
|
||||||
|
maalt -= 1;
|
||||||
|
else if ((maalt + 1) % 3 == 2)
|
||||||
|
maalt += 1;
|
||||||
|
}
|
||||||
itoa(maalt * 10, tmpstr, 10);
|
itoa(maalt * 10, tmpstr, 10);
|
||||||
sprintf(sItemString, "%04s", tmpstr);
|
sprintf(sItemString, "%04s", tmpstr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user