Launcher: heliport / helipad fixes
This commit is contained in:
parent
3da6d42945
commit
19ec0027e8
4 changed files with 41 additions and 5 deletions
|
@ -143,13 +143,21 @@ void AirportDiagram::setSelectedRunway(FGRunwayRef r)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_selectedParking.clear();
|
m_selectedParking.clear();
|
||||||
|
m_selectedHelipad.clear();
|
||||||
m_selectedRunway = r;
|
m_selectedRunway = r;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AirportDiagram::setSelectedHelipad(FGHelipadRef pad)
|
void AirportDiagram::setSelectedHelipad(FGHelipadRef pad)
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "implement me";
|
if (pad == m_selectedHelipad) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_selectedParking.clear();
|
||||||
|
m_selectedRunway.clear();
|
||||||
|
m_selectedHelipad = pad;
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AirportDiagram::setSelectedParking(FGParkingRef park)
|
void AirportDiagram::setSelectedParking(FGParkingRef park)
|
||||||
|
@ -159,6 +167,7 @@ void AirportDiagram::setSelectedParking(FGParkingRef park)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_selectedRunway.clear();
|
m_selectedRunway.clear();
|
||||||
|
m_selectedHelipad.clear();
|
||||||
m_selectedParking = park;
|
m_selectedParking = park;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -568,7 +577,10 @@ QPainterPath AirportDiagram::pathForHelipad(const HelipadData& h, const QTransfo
|
||||||
QRect r = m_helipadIcon.rect();
|
QRect r = m_helipadIcon.rect();
|
||||||
r.moveCenter(QPoint(0, 0));
|
r.moveCenter(QPoint(0, 0));
|
||||||
pp.addEllipse(r);
|
pp.addEllipse(r);
|
||||||
return t.map(pp);
|
|
||||||
|
QTransform x = t;
|
||||||
|
x.translate(h.pt.x(), h.pt.y());
|
||||||
|
return x.map(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AirportDiagram::buildTaxiways()
|
void AirportDiagram::buildTaxiways()
|
||||||
|
|
|
@ -117,6 +117,7 @@ private:
|
||||||
double m_approachDistanceNm;
|
double m_approachDistanceNm;
|
||||||
FGRunwayRef m_selectedRunway;
|
FGRunwayRef m_selectedRunway;
|
||||||
FGParkingRef m_selectedParking;
|
FGParkingRef m_selectedParking;
|
||||||
|
FGHelipadRef m_selectedHelipad;
|
||||||
|
|
||||||
QPixmap m_helipadIcon;
|
QPixmap m_helipadIcon;
|
||||||
};
|
};
|
||||||
|
|
|
@ -200,15 +200,23 @@ public:
|
||||||
addType(FGPositioned::FIX);
|
addType(FGPositioned::FIX);
|
||||||
addType(FGPositioned::NDB);
|
addType(FGPositioned::NDB);
|
||||||
|
|
||||||
|
// aircraft type isn't reliable yet, until we ensure
|
||||||
|
// most aircraft are tagged accordingly with helicopter,
|
||||||
|
// seaplane, etc. Hnece disabling this logic for now
|
||||||
|
#if 0
|
||||||
if (aircraft == Helicopter) {
|
if (aircraft == Helicopter) {
|
||||||
addType(FGPositioned::HELIPAD);
|
addType(FGPositioned::HELIPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aircraft == Seaplane) {
|
if (aircraft == Seaplane) {
|
||||||
addType(FGPositioned::SEAPORT);
|
addType(FGPositioned::SEAPORT);
|
||||||
} else {
|
|
||||||
addType(FGPositioned::AIRPORT);
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
addType(FGPositioned::HELIPORT);
|
||||||
|
addType(FGPositioned::SEAPORT);
|
||||||
|
#endif
|
||||||
|
// always include airports regardless of acft type
|
||||||
|
addType(FGPositioned::AIRPORT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -391,6 +399,8 @@ LocationWidget::LocationWidget(QWidget *parent) :
|
||||||
this, &LocationWidget::onAirportRunwayClicked);
|
this, &LocationWidget::onAirportRunwayClicked);
|
||||||
connect(m_ui->airportDiagram, &AirportDiagram::clickedParking,
|
connect(m_ui->airportDiagram, &AirportDiagram::clickedParking,
|
||||||
this, &LocationWidget::onAirportParkingClicked);
|
this, &LocationWidget::onAirportParkingClicked);
|
||||||
|
connect(m_ui->airportDiagram, &AirportDiagram::clickedHelipad,
|
||||||
|
this, &LocationWidget::onAirportHelipadClicked);
|
||||||
|
|
||||||
connect(m_ui->locationSearchEdit, &QLineEdit::returnPressed,
|
connect(m_ui->locationSearchEdit, &QLineEdit::returnPressed,
|
||||||
this, &LocationWidget::onSearch);
|
this, &LocationWidget::onSearch);
|
||||||
|
@ -962,6 +972,18 @@ void LocationWidget::onAirportParkingClicked(FGParkingRef park)
|
||||||
updateDescription();
|
updateDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocationWidget::onAirportHelipadClicked(FGHelipadRef pad)
|
||||||
|
{
|
||||||
|
if (pad) {
|
||||||
|
m_ui->runwayRadio->setChecked(true);
|
||||||
|
int rwyIndex = m_ui->runwayCombo->findText(QString::fromStdString(pad->ident()));
|
||||||
|
m_ui->runwayCombo->setCurrentIndex(rwyIndex);
|
||||||
|
m_ui->airportDiagram->setSelectedHelipad(pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateDescription();
|
||||||
|
}
|
||||||
|
|
||||||
QString compassPointFromHeading(int heading)
|
QString compassPointFromHeading(int heading)
|
||||||
{
|
{
|
||||||
const int labelArc = 360 / 8;
|
const int labelArc = 360 / 8;
|
||||||
|
|
|
@ -85,6 +85,7 @@ private:
|
||||||
|
|
||||||
void onAirportRunwayClicked(FGRunwayRef rwy);
|
void onAirportRunwayClicked(FGRunwayRef rwy);
|
||||||
void onAirportParkingClicked(FGParkingRef park);
|
void onAirportParkingClicked(FGParkingRef park);
|
||||||
|
void onAirportHelipadClicked(FGHelipadRef pad);
|
||||||
|
|
||||||
void onOffsetBearingTrueChanged(bool on);
|
void onOffsetBearingTrueChanged(bool on);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue