add calculated gs and reported gs

This commit is contained in:
Zichao Lin 2022-07-24 21:54:39 +08:00
parent dda58ee6ce
commit bfa7e52879
2 changed files with 13 additions and 5 deletions

View File

@ -12,7 +12,8 @@ TinyEurocat::TinyEurocat(void) : CPlugIn ( COMPATIBILITY_CODE,
{
RegisterTagItemType("Metric / Current Altitude", ITEM_MET_AFL);
RegisterTagItemType("Metric / Cleared Altitude", ITEM_MET_CFL);
RegisterTagItemType("Metric / Current Speed", ITEM_MET_GS);
RegisterTagItemType("Metric / Current Speed (Reported)", ITEM_MET_GS_R);
RegisterTagItemType("Metric / Current Speed (Calculated)", ITEM_MET_GS_C);
}
void TinyEurocat::OnGetTagItem( CFlightPlan FlightPlan,
@ -45,12 +46,18 @@ void TinyEurocat::OnGetTagItem( CFlightPlan FlightPlan,
itoa(mcalt, tmpstr, 10);
sprintf(sItemString, "%04s", tmpstr);
break;
case ITEM_MET_GS:
case ITEM_MET_GS_R:
mcspd = RadarTarget.GetPosition().GetReportedGS() * 1.852;
mcspd /= 10;
itoa(mcspd, tmpstr, 10);
sprintf(sItemString, "%03s", tmpstr);
break;
case ITEM_MET_GS_C:
mcspd = RadarTarget.GetGS() * 1.852;
mcspd /= 10;
itoa(mcspd, tmpstr, 10);
sprintf(sItemString, "%03s", tmpstr);
break;
}
}

View File

@ -3,9 +3,10 @@
using namespace EuroScopePlugIn;
const int ITEM_MET_AFL = 1;
const int ITEM_MET_CFL = 2;
const int ITEM_MET_GS = 3;
const int ITEM_MET_AFL = 1; // AFL in metric
const int ITEM_MET_CFL = 2; // CFL in metric
const int ITEM_MET_GS_R = 3; // Reported GS in metric
const int ITEM_MET_GS_C = 4; // Calculated GS in metric
class TinyEurocat : public CPlugIn
{