|
@@ -461,7 +461,7 @@ void PlugIn::generateAircraftReportMessage(EuroScopePlugIn::CRadarTarget& radarT
|
|
|
|
|
|
int iafRouteIndex = flightPlan.GetExtractedRoute().GetPointsNumber();
|
|
int iafRouteIndex = flightPlan.GetExtractedRoute().GetPointsNumber();
|
|
auto currentPosition = radarTarget.GetPosition().GetPosition();
|
|
auto currentPosition = radarTarget.GetPosition().GetPosition();
|
|
- EuroScopePlugIn::CPosition iafPosition;
|
|
|
|
|
|
+ GeoCoordinate iafPosition;
|
|
std::string iafName;
|
|
std::string iafName;
|
|
|
|
|
|
auto iafIt = this->m_initialApproachFixes.find(destination);
|
|
auto iafIt = this->m_initialApproachFixes.find(destination);
|
|
@@ -469,14 +469,15 @@ void PlugIn::generateAircraftReportMessage(EuroScopePlugIn::CRadarTarget& radarT
|
|
for (const auto& iaf : std::as_const(iafIt->second)) {
|
|
for (const auto& iaf : std::as_const(iafIt->second)) {
|
|
for (int i = 0; i < flightPlan.GetExtractedRoute().GetPointsNumber(); ++i) {
|
|
for (int i = 0; i < flightPlan.GetExtractedRoute().GetPointsNumber(); ++i) {
|
|
if (flightPlan.GetExtractedRoute().GetPointName(i) == iaf.name) {
|
|
if (flightPlan.GetExtractedRoute().GetPointName(i) == iaf.name) {
|
|
|
|
+ iafPosition = iaf.coordinate;
|
|
iafName = iaf.name;
|
|
iafName = iaf.name;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (0 == iafName.length()) {
|
|
|
|
- if (flightPlan.GetControllerAssignedData().GetDirectToPointName() == iaf.name)
|
|
|
|
- iafName = iaf.name;
|
|
|
|
|
|
+ if (0 == iafName.length() && flightPlan.GetControllerAssignedData().GetDirectToPointName() == iaf.name) {
|
|
|
|
+ iafPosition = iaf.coordinate;
|
|
|
|
+ iafName = iaf.name;
|
|
}
|
|
}
|
|
|
|
|
|
if (0 != iafName.length())
|
|
if (0 != iafName.length())
|
|
@@ -485,6 +486,8 @@ void PlugIn::generateAircraftReportMessage(EuroScopePlugIn::CRadarTarget& radarT
|
|
}
|
|
}
|
|
|
|
|
|
if (0 != iafName.length()) {
|
|
if (0 != iafName.length()) {
|
|
|
|
+ report->set_initialapproachfix(iafName);
|
|
|
|
+
|
|
std::string_view direct(flightPlan.GetControllerAssignedData().GetDirectToPointName());
|
|
std::string_view direct(flightPlan.GetControllerAssignedData().GetDirectToPointName());
|
|
bool directBehindIAF = false;
|
|
bool directBehindIAF = false;
|
|
|
|
|
|
@@ -497,18 +500,21 @@ void PlugIn::generateAircraftReportMessage(EuroScopePlugIn::CRadarTarget& radarT
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ EuroScopePlugIn::CPosition iaf;
|
|
|
|
+ iaf.m_Longitude = iafPosition.longitude().convert(degree);
|
|
|
|
+ iaf.m_Latitude = iafPosition.latitude().convert(degree);
|
|
|
|
+
|
|
if (true == directBehindIAF) {
|
|
if (true == directBehindIAF) {
|
|
- PlugIn::distanceToPredictedIaf(radarTarget, flightPlan, iafPosition, report);
|
|
|
|
|
|
+ PlugIn::distanceToPredictedIaf(radarTarget, flightPlan, iaf, report);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- const GeoCoordinate iaf(static_cast<float>(iafPosition.m_Longitude) * degree, static_cast<float>(iafPosition.m_Latitude) * degree);
|
|
|
|
const Velocity groundspeed = static_cast<float>(radarTarget.GetGS()) * knot;
|
|
const Velocity groundspeed = static_cast<float>(radarTarget.GetGS()) * knot;
|
|
Length distanceToIaf;
|
|
Length distanceToIaf;
|
|
- const auto idx = Inbound::matchToPredictedPath(flightPlan.GetPositionPredictions(), iaf, groundspeed, distanceToIaf);
|
|
|
|
|
|
+ const auto idx = Inbound::matchToPredictedPath(flightPlan.GetPositionPredictions(), iafPosition, groundspeed, distanceToIaf);
|
|
|
|
|
|
/* not inbound the IAF -> check if we passed it */
|
|
/* not inbound the IAF -> check if we passed it */
|
|
if (flightPlan.GetPositionPredictions().GetPointsNumber() <= idx)
|
|
if (flightPlan.GetPositionPredictions().GetPointsNumber() <= idx)
|
|
- PlugIn::distanceToPredictedIaf(radarTarget, flightPlan, iafPosition, report);
|
|
|
|
|
|
+ PlugIn::distanceToPredictedIaf(radarTarget, flightPlan, iaf, report);
|
|
else
|
|
else
|
|
report->set_distancetoiaf(static_cast<int>(std::round(distanceToIaf.convert(nauticmile))));
|
|
report->set_distancetoiaf(static_cast<int>(std::round(distanceToIaf.convert(nauticmile))));
|
|
}
|
|
}
|