From e63a95feb93436750e55c057d55fb374935cc6aa Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 15 Nov 2015 15:55:07 +0000 Subject: [PATCH] Draw aircraft on airport diagram --- src/GUI/AirportDiagram.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/GUI/AirportDiagram.cxx b/src/GUI/AirportDiagram.cxx index 2fd2ce7e9..dea718e54 100644 --- a/src/GUI/AirportDiagram.cxx +++ b/src/GUI/AirportDiagram.cxx @@ -217,6 +217,10 @@ void AirportDiagram::paintContents(QPainter* p) drawILS(p, r.runway->reciprocalRunway()); } + bool drawAircraft = false; + SGGeod aircraftPos; + int headingDeg; + // now draw the runways for real Q_FOREACH(const RunwayData& r, m_runways) { @@ -256,6 +260,12 @@ void AirportDiagram::paintContents(QPainter* p) p->drawText(QRect(-100, 5, 200, 200), recipIdent, Qt::AlignHCenter | Qt::AlignTop); } + if (m_selectedRunway) { + drawAircraft = true; + aircraftPos = m_selectedRunway->geod(); + headingDeg = m_selectedRunway->headingDeg(); + } + if (m_selectedRunway && (m_approachDistanceNm > 0.0)) { p->setTransform(t); // draw approach extension point @@ -266,11 +276,14 @@ void AirportDiagram::paintContents(QPainter* p) pen.setWidth(2.0 / m_scale); p->setPen(pen); p->drawLine(pt, pt2); + + aircraftPos = m_selectedRunway->pointOnCenterline(-d); } - - // aircraft pos and heading... - // paintAirplaneIcon(painter, ); + if (drawAircraft) { + p->setTransform(t); + paintAirplaneIcon(p, aircraftPos, headingDeg); + } } void AirportDiagram::drawILS(QPainter* painter, FGRunwayRef runway) const